Skip to Content

How to read a group value programming after crystal report loaded

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!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    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....

    Don

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 03, 2016 at 12:08 PM

    Several of the 3rd-party Crystal Reports desktop schedulers listed here: http://kenhamady.com/productlinks/default.html#desktopsched provide report bursting functionality.

    Add comment
    10|10000 characters needed characters exceeded