Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Previewing reports in VFP using Crystal Reports RDC
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00488459
Message ID:
00490735
Views:
9
>Hi!
>
>I've checked today the following link: http://support.crystaldecisions.net/library/kbase/articles/c2008253.asp
>
>It's very nice, it lets you preview a Crystal Reports designed report ( RPT file ) in a VFP form. The only problem i have, is that i would like the report to be filtered to some condition depending on the fields in the form, i.e: i have a textbox where i can define a value, and then this value should be part of the 'where' clause in the query that will generate the report.
>Anyone dealed with this? Im using CR 8.0.
>
>Thanks


Jaime,

Before you actually tell the viewer control to launch the report, you will need to manipulate the report object itself. Most likely the SQLQueryString of the report object should give you what you need - it's a read/write property of the report object.

You can retrieve the current SQL query from that property. Then, just modify your WHERE clause and set the property to your new query (e.g. oCrystalReport.SQLQueryString = cQuery). Again, be sure to do this BEFORE you set the viewer's report source and view the report. Then you should be good to go.

Laterness,
Jon
Jon Rosenbaum
Devcon Drummer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform