Crystal Report - placing the result of a customized SQL statement onto a report

BlueJay924

Well-known member
Joined
May 6, 2003
Messages
46
I want to create a report thats based on a users selection, basically a form with checkboxes and comboboxes. The end user will not have to write an sql statement.

to start with, I have a form with check boxes and comboboxes and based on those that are selected i want to be able to grab that record or count the number of records. Thats the easy part. Im stuck on how i go about displaying that information on to the report. Id do an Add Command when i create the report; however, im not sure what will be selected or what will be needed until runtime.

Also I want to be able to edit a text object without having to actually touch the report, specifically in the page header. I want to be able to have some code that will do that for me but im at a loss here too.

for e.g., suppose the end user wanted to know the total number of orders sold rather than the total number of employees. how would that be displayed? (From access northwind.mdb)
 
First of all create a data adapter which will contain the required fields on you report, this is so the fields are available at run time.

Create a dataset in code that will be filled with the data depending on the selection by the user, then set this dataset as the reports reportsource.

I have a single report that services four different datasets using this method.

As for the textbox, you will need to create a formula, in Field Explorer right click Formulas, then select New
 
Back
Top