Page 1 of 1

SalesInvoice report

Posted: Fri Feb 18, 2011 7:32 am
by luczan
Hi all,

i have two questions about demo report SalesInvoice:

what can i do if i want to save (or export to e.g. pdf, byte stream) each invoice (there are 5 invoices in demo report) separately (e.g. invoice_order11077.pdf ; invoice_order11076.pdf ...)
..and i need to get some data from rendered report - in this case order_id

Is it possible to do it programmatically in my application?

thanks

SalesInvoice report

Posted: Mon Feb 21, 2011 1:08 am
by Alex K.
Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.

SalesInvoice report

Posted: Mon Feb 21, 2011 3:12 am
by luczan
Hello,

I have rendered your sample report SalesInvoice with data from Demo.xml in my c# application. Such rendered report contains 5 invoices. When i call report.ExportDocument(...) - rendered report is exported into one file. But I need to export every invoice from rendered report separately -> one invoice = one file.

SalesInvoice report

Posted: Wed Feb 23, 2011 2:44 am
by Alex K.
Hello,

If every invoice is located on a separate page, you can use the following code:

Code: Select all

StiReport report = new StiReport();
report.Load("D:\\YourReport.mrt");
report.Render();

Stimulsoft.Report.Export.StiPdfExportSettings es = new Stimulsoft.Report.Export.StiPdfExportSettings();
for (int index = 0; index < report.RenderedPages.Count; index++)
{
    string pageNumber = (index + 1).ToString();
    es.PageRange = new StiPagesRange(pageNumber);
    report.ExportDocument(StiExportFormat.Pdf, "d:\\ReportName_Page" + pageNumber + ".pdf", es);
}
If your report has a slightly different structure, let us know, we will find other ways.

Thank you.

SalesInvoice report

Posted: Mon Feb 28, 2011 7:17 am
by luczan
thank you very much..
and what can i do in case that some invoice has more than one page?

thank you

SalesInvoice report

Posted: Tue Mar 01, 2011 6:32 am
by Alex K.
Hello,

You can use Excel Sheet properties.
Please see the sample project in attachment.

Thank you.