So here is the problem,
I have a crystal report 8.5 file which I use with delphi 6 application that i am building.
I have two buttons on a form "Report" and "Query". This is what i would like to do...and i cant.
When i click the report button I wanna display my crystal file say "x.rpt" with every record in it.
And when i click "Query" I wanna display the file queried by date which the user chooses on the delphi form using calendar compnent in delphi.
Now here is the problem, Suppose the report has a field called "Call Date" which had all records on 06/20/03.
What I do is, include a Parameter Field called "CallDate" which takes the date from the calendar component and only displays those record that match.
So if the user choses "06/20/03" from the calendar component on the form and hits "Query" it will display all records on that date.
But when the user hits "Report" I get and empty report! I want crystal to show every record, but instead it takes the default date in the "CallDate" parameter which might not occur in the report and displays an empty report.
How do I override the "CallDate" Parameter. How do I write a query to do that. I tried doing any value on date in the Select Expert which works fine except for that fact that delphi code throws an error.
If delphi code looks like this
with Report do
begin
ReportName := ExtractFilePath(Application.ExeName) + 'reports\X.RPT';
{Pass the report name and path}
ParamFields.Retrieve;
{Retrieve the parameters in the report}
ParamFields[0].AsDate := dtpBeginDate.Date;
{Pass the date selected in the DateTimePicker(calendar component)}
Output := toWindow;
{Tell it where to output}
WindowState := wsNormal;
{Specify how to display the report}
WindowZoom.Preview := pwPageWidth;
{Specify the report view size}
Execute;
{Print the report}
end;
Then what should i put on the RHS when i do "anyvalue" in the SELECT EXPERT ?
ParamFields[0].??? := ???????????
I have a crystal report 8.5 file which I use with delphi 6 application that i am building.
I have two buttons on a form "Report" and "Query". This is what i would like to do...and i cant.
When i click the report button I wanna display my crystal file say "x.rpt" with every record in it.
And when i click "Query" I wanna display the file queried by date which the user chooses on the delphi form using calendar compnent in delphi.
Now here is the problem, Suppose the report has a field called "Call Date" which had all records on 06/20/03.
What I do is, include a Parameter Field called "CallDate" which takes the date from the calendar component and only displays those record that match.
So if the user choses "06/20/03" from the calendar component on the form and hits "Query" it will display all records on that date.
But when the user hits "Report" I get and empty report! I want crystal to show every record, but instead it takes the default date in the "CallDate" parameter which might not occur in the report and displays an empty report.
How do I override the "CallDate" Parameter. How do I write a query to do that. I tried doing any value on date in the Select Expert which works fine except for that fact that delphi code throws an error.
If delphi code looks like this
with Report do
begin
ReportName := ExtractFilePath(Application.ExeName) + 'reports\X.RPT';
{Pass the report name and path}
ParamFields.Retrieve;
{Retrieve the parameters in the report}
ParamFields[0].AsDate := dtpBeginDate.Date;
{Pass the date selected in the DateTimePicker(calendar component)}
Output := toWindow;
{Tell it where to output}
WindowState := wsNormal;
{Specify how to display the report}
WindowZoom.Preview := pwPageWidth;
{Specify the report view size}
Execute;
{Print the report}
end;
Then what should i put on the RHS when i do "anyvalue" in the SELECT EXPERT ?
ParamFields[0].??? := ???????????