Solved

crystal reports and Delphi - changing selection criteria of sub report

Posted on 2013-02-04
5
1,028 Views
Last Modified: 2013-08-16
I have a crystal reports xi report which has a main report and subreport. I wish to set the selection criteria within the subreport to select by date.

I am accessing the crystal report through the VCL from Delphi 2007  but am at a loss as how I can modify the subreport selection through the vcl.

Can anyone help?
0
Comment
Question by:robertminjoot
5 Comments
 
LVL 19

Accepted Solution

by:
Thommy earned 250 total points
ID: 38852563
Maybe this previous EE question can help you
Delphi 7 with Crystal Reports

Especially have a look at below code part in the Accepted solution
if (crRepObject.Kind = crSubReportObject) then
                begin
                  // get the sub report object
                  crSubRep:= ISubreportObject(crRepObject);
                  // open the subreport
                  crSubReport:= crSubRep.OpenSubreport;

Open in new window

0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 250 total points
ID: 38853462
You then treat the subreport as a report and change it just ike you would a report using crSubReport

mlmcc
0
 

Author Comment

by:robertminjoot
ID: 38854698
Thanks for the suggested solutions. While they didn't solve my problem they did point my mind in the right direction.

I needed to access the subreport through the VCL. What I needed was:

CRreport.SubReports[1].Selection.Formula.Text := 'The selection formula'.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question