Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any Crystal Report Gurus?
Message
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00657026
Message ID:
00658141
Views:
20
That did it....

I had the DiscardSavedData() function in there just before I called the report. I guess that cleared the information I was sending to it out of the report. I moved it to before I made the parameter call and it worked fine.

Thanks for the help,

Ron

>Sure, here goes:
>
>crApp=createobject("crystalruntime.application")
>crReport=createobject("crystalruntime.report")
>crReport=crApp.openreport('myreport')
>crApp.LogOnServer('p2ssql','sqlsrvr','database','user','pwd')
>crReport.Database.Tables.Item(1).SetLogOnInfo('sqlsrvr','database','user','pwd')
>crReport.ParameterFields(1).AddCurrentValue('23456')
>crReport.PrinterSetup(0)
>
>
>My parameter field is used in the WHERE clause of the record selection formula (this report pulls from SQL Server, but I can't see why it would be different if pulling from a VFP DBC). If I use this, it pulls oen record, the one where the field value=23456. If I alter the '23456' to '12345' I get the one record where the field value=12345.
>
> I'm still experimenting with the SQL Server logon, I might not need the call to SetLogonInfo for it to work, but that's the code segment I have now and it works with the parameter. No prompts appear, just the report with the data. Speaking of which - make sure you didn't save the data with the report, it's a checkbox under File,Report Options in 8.x, maybe it was the same in 6.
>
> Randy
>
>>OK I have the 8.5 Professional Version now and I still cant get it to work.
>>
>>Do you have some sample code I could look at?
>>
>>I would hate to have to remove that Parameter from the report.
>>
>>Ron
>>
>>>>Ron
>>>>
Ronald L. Thorp
http://www.Fox-Pros.com
Fox-Pros, Inc.
Office 407-498-0100
Previous
Reply
Map
View

Click here to load this message in the networking platform