2 page report

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v8)  /  2 page report

DynamicPDF CoreSuite for .NET (v8) Forum

 Apr 02 2015 5:58 AM
I have a two page pdf document that I am looking to recreate by using two report forms.

When I attempt to print 8 of these it displays 8 page 1s followed by 8 page 2s when I want it to display page 1 page 2, page 1 page 2, etc.

How can I accomplish this?
 Apr 02 2015 6:59 AM
The structure of the documents is:

Document1
  --> Report 1
       --> Template1
       --> Header1
       --> Details1
       --> Footer1
  --> Report 2
       --> Template2
       --> Header2
       --> Details2
       --> Footer2


Any help would be greatly appreciated
 Apr 02 2015 1:08 PM
Posted by a ceTe Software moderator
Hello,

The number of pages added to the PDF report generated using DPLX file and the DynamicPDF ReportWriter is dependent on the dynamic contents being added to it.

Can you please send over the following details to support@cete.com so that we can look into it further ?

1.Code sample used to generate PDF.
2.DPLX file.
3.Output PDF.
4.More details about your requirement regarding how you would like to output PDF. Images and sample PDFs showing the expected behavior will help us to understand your requirements better.
5.Exact version and build number of the DynamicPDF DLL file. You can get this information in DL references properties (Version and Description fields) in Visual Studio.

Thanks,
ceTe Software Support Team.
 Apr 03 2015 2:41 PM
I essentially have two reports in my layout, one for the front page and one for the back but when I run a select * query from my sql then it prints out 8 front pages and then 8 back pages.
 Apr 03 2015 5:00 PM
Posted by a ceTe Software moderator
Hello,

If a report is generating multiple pages, they will be generated back to back. So if you have two reports in the layout each generating multiple pages, then the first report will generate all of its pages and then the second one will generate its pages. So in the resulting PDF, the first 8 pages will come from report 1 and the next 8 pages from report 2 and this is expected behavior for the layout you have.

In order for us to suggest a layout that would work for you, we need the actual copy of your dlpx and other information we have requested in our previous post. Please email that information over to support@cete.com and we can look into it further.

Thanks,
ceTe Software Support Team.

 Apr 03 2015 9:14 PM
I have sent the requested info
 Apr 06 2015 12:02 AM
Any update on how best I could lay out my report to accomplish my goal of having the reports print one after another per bill so i can print on one piece of double sided paper? files have been sent
 Apr 14 2015 9:12 AM
Posted by a ceTe Software moderator
Hello,

We received all the details. We looked into the output PDF generated using DPLX file and ReportWriter API. The DPLX file contains two reports and it is not possible to mix the two report contents. The ReportWriter API will generate whole report1 and then report2. This is expected behavior with DynamicPDF ReportWriter API.

You can achieve your requirement by generating the report for individual customers and then add the pages of this generated report to main document to create a PDF.  You can have the BillID in a collection and then loop through this collection and generate individual PDF report for each BillID and then create a new document by adding pages from the generated report. Below is the code sample for it.

            int[] billIDs = new int[5];
            billIDs[0] = 10248;
            billIDs[1] = 10249;
            billIDs[2] = 10250;
            billIDs[3] = 10251;
            billIDs[4] = 10252;
            Document mainDocument = new Document();

            foreach (int id in billIDs)
            {
                ParameterDictionary parameters = new ParameterDictionary();
                parameters.Add("BillID", id);
                DocumentLayout report = new DocumentLayout(@"C:\Temp\Document1.dplx");
                Document document = report.Run(parameters);
                string output = @"D:\Temp\" + id + ".pdf";
                //Saving individual document.
                document.Draw(output);
                //Creating main document by adding all the pages
                for (int k = 0; k < document.Pages.Count; k++)
                {
                    mainDocument.Pages.Add(document.Pages[k]);
                }
            }
            mainDocument.Draw(@"D:\Temp\mainDocument.pdf");

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 3:29 AM.