Adding two different dplx templates to one PDF document for the same record

Adding two different dplx templates to one PDF document for the same record

Forum member · Feb 29, 2008
Hi, I have to create a document, which each time has two different pages for one record. This means if the user selects 5 records, the output will be 10 pages, each time 2 pages for each object after each other. Now the 2 pages are two different dplx files (templates). If I just add them, I get 5x times the first page for each record, followed by 5 times the second page for each record. Which I don't want :). I just want to have Record 1 : Page 1 , Followed by Page 2, Record 2: Page 1 , followed by Page 2, etc.. How can I accomplish this ?

Re: Adding two different dplx templates to one PDF document for the same record

Support · Feb 29, 2008
Hello, It is not possible to display the pages alternatively from both the dplx files directly. But you can do this using the EventDrivenQueries. You can pass the query dynamically so you will have to write a unique query to select the data to display in the first page and then for the second page. Add all these pages to make a document. The Run method takes the document as a parameter also. But this may not be efficient way to do this. We can give you an example if you send a mail to our [^a|mailto:support@cete.com|Support Team^]. You can do this using the Generator product easily. You can have more control over all the page elements and the pages to add to the document. So this will be more easier and efficient to do this. Thanks, ceTe Software Support Team.

Re: Adding two different dplx templates to one PDF document for the same record

Forum member · Feb 29, 2008
Ok. Thanks for the info. I'll contact support about this. Another solution I found, is to create two pdf documents based on the different dplx files, and than merging the pages from the second document into the first document : Dim document As ceTe.DynamicPDF.Document = report.Run Dim document2 As ceTe.DynamicPDF.Document = report2.Run 'Merge 2 PDF templates .... Dim lcount As Integer = document.Pages.Count Dim i As Integer Dim lindex As Integer = 1 For i = 0 To lcount - 1 document.Pages.Insert(lindex, document2.Pages(i)) lindex = lindex + 2 Next This works too .....