Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using ADO recordsets in Crystal Reports
Message
From
04/12/2002 18:11:20
 
 
To
04/12/2002 18:01:24
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Miscellaneous
Thread ID:
00729636
Message ID:
00729675
Views:
47
>
>I didn't have this information before. If you don't have access to the data when you design the report, you'll need to use a TTX file.
>
>Did you create the TTX file with the Database Definition Tool?

Craig,

Thanks for the quick reply. I probably should have given a bit more info in my first post.

The way I am making the ttx file is by using the supplied function in the p2smon.dll file, I need to use a VB COM object to do this though as VFP is unable to pass the ADO object correctly to the function.
 Private Declare Function CreateFieldDefFile Lib "p2smon.dll" (lpUnk As Object, _
ByVal fileName As String, ByVal bOverWriteExistingFile As Long) _
As Long

Function CreateTTXfile(toADO As ADODB.Recordset, tcFile As String)
    Dim lnRes As Integer
    lnRes = CreateFieldDefFile(toADO, tcFile, True)
    CreateTTXfile = lnRes
End Function
When this runs it create the TTX file with all datetime fields defined as TIME, it is then possible to go through this file and adjust the TIME fields back into DATETIME field, doing this allows the designer to create a report using the fields as DATETIME in functions and formulas, however at runtime when I call SetDataSource to replace the TTX file with the ADO recordset Crystal will then not display the datetime fields because it seems to convert them TIME as described in my earlier post.

I've got an idea for a really dodgy workaround that I don't really want to use, it involves adding a seperate field to the Recordset for the DATE and TIME parts of the datetime field (i.e. for field tIncDate, create a field tIncDate_TIME and dIncDate_DATE and then use these in the report.). So hopefully I can find a solution before I have to resort to this.

Thanks again,

Chris.
Have a nice day :)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform