Solved

crystal reports and Delphi - changing selection criteria of sub report

Posted on 2013-02-04
5
994 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now