Skip to Content

How to read a group value programming after crystal report loaded

Dec 03, 2016 at 04:09 AM


avatar image

Dear Expert,

Here's the scenario: We need to send invoices to customer in batch. The crystal report shows multiple invoices (let's say 100 invoices, 150 pages total) in preview, after preview it will send to different customers. One invoice in one PDF file, could be more than one page depends on how many items the invoice has. So now the issue is how to split by invoice number?

The report was grouped by invoice number. My idea is if there's a way to loop through whole report (150 pages), on each page, check invoice number, if same then keep in same export to PDF. Something like below:

Foreach (page in reportDocument.Pages){

if (page.invoiceNumber == previousNumber) {

'do something



Once page range identified, I can export by page range. I've googled, read SDK and also searched in this community, but could not find any way to loop through a report document. The in pro RAS SDK sample code mainly focus on report definition manipulation.

Is there a way to loop through a loaded report? or other way to achieve this?

Thank you for your help!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Don Williams
Dec 06, 2016 at 09:09 PM

Hi Stone,

You can use the SavedDataRecordSelection formula to add more filtering.

Or this one: crystalReportViewer1.ViewTimeSelectionFormula

I had a sample on how to add more filtering using parameters but I can't find it now... I'll keep looking.

Work flow is to export the report to RPT format so it has saved data and then preview that and add filtering, export to new report and then do it again for each....


10 |10000 characters needed characters left characters exceeded
Ido Millet Dec 03, 2016 at 12:08 PM

Several of the 3rd-party Crystal Reports desktop schedulers listed here: provide report bursting functionality.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks for the information. 3rd-party scheduler was not a option in this case. If it's a library can include in our project maybe ok.