Printing Multiple Templates' output in a single PDF

Hi All,
I have a requirement wherein I have to print the data from several or a few templates into a single pdf.
Requirement:
All the Service Contracts created on a particular day will need to be printed in a single report
For eg: If there are 5 different Service contracts created on a particular day, then each of the service contracts will be associated with a different template, but the output should be printed within a single report.
Also, there can be more than one instance of the same service contract.
Explanation
Suppose I have SC1....SC9 and I have 5 templates Template1....Template5 and each of the SC1...SC9 may or may not be associated with a template
Consider that SC1..SC5 has to be printed in Template1, SC6, SC7 in Template2
SC8,SC9 to be printed in Template3.
Issue
Now I do get the output in a single report, but I get 2 blank pages when there is no data for Template4 and Template5.
Approach
I have create a single template file with all the 5 template in it and each of the templates are in a single page.
TEMPLATE 1+
COMPANY LOGO
<?for-each-group:G_TEMPLATE;TEMPLATE?> <?if:TEMPLATE = ‘TEMP_A’?><?for-each: G_MAIN?>
..... Template Body.....
<?split-by-page-break:?> <?end if?> <?end for-each?><?end if?> ?><?end if?> <?end for-each-group?>
The same thing repeats for Template2... Template5, with only the difference being the Template Body.
Subtemplate Approach not feasible:
I have worked with sub-templates and I know for sure that it is not feasible for this approach becuz all the pages have to be printed within the single report
Is there a way to resolve this issue of eliminating the blank pages when there is no data in the xml file for the particular template.
Thanks in advance to all who might give a thought to this
XML FILE
<?xml version="1.0" encoding="UTF-8" ?>
- <ROWSET>
- <LIST_G_MAIN>
- <G_TEMPLATE>
<TEMPLATE>TEMP_A</TEMPLATE>
- <G_MAIN>
<PARAM_1>P1</PARAM_1>
<PARAM_2>P2</PARAM_2>
<PARAM_3>P3</PARAM_3>
<PARAM_4>P4</PARAM_4>
</G_MAIN>
- <G_MAIN>
<PARAM_1>P1</PARAM_1>
<PARAM_2>P2</PARAM_2>
<PARAM_3>P3</PARAM_3>
<PARAM_4>P4</PARAM_4>
</G_MAIN>
- <G_MAIN>
<PARAM_1>P1</PARAM_1>
<PARAM_2>P2</PARAM_2>
<PARAM_3>P3</PARAM_3>
<PARAM_4>P4</PARAM_4>
</G_MAIN>
</G_TEMPLATE>
- <G_TEMPLATE>
<TEMPLATE>TEMP_B</TEMPLATE>
- <G_MAIN>
<PARAM_1>P1</PARAM_1>
<PARAM_2>P2</PARAM_2>
<PARAM_3>P3</PARAM_3>
<PARAM_4>P4</PARAM_4>
</G_MAIN>
</G_MAIN>
</G_TEMPLATE>
- <G_TEMPLATE>
<TEMPLATE>TEMP_C</TEMPLATE>
- <G_MAIN>
<PARAM_1>P1</PARAM_1>
<PARAM_2>P2</PARAM_2>
<PARAM_3>P3</PARAM_3>
<PARAM_4>P4</PARAM_4>
</G_MAIN>
- <G_MAIN>
<PARAM_1>P1</PARAM_1>
<PARAM_2>P2</PARAM_2>
<PARAM_3>P3</PARAM_3>
<PARAM_4>P4</PARAM_4>
</G_MAIN>
</G_MAIN>
</G_TEMPLATE>
</LIST_G_MAIN>
</ROWSET>

assuming my corrected sample data structure is correct, here is a template that works with it. No blank pages for template D and E:
<?if@section:count(G_TEMPLATE[TEMPLATE='TEMP_A'])>0?>
<?for-each-group:G_TEMPLATE[TEMPLATE='TEMP_A'];TEMPLATE?>
Template: <?TEMPLATE?>
<?for-each:G_MAIN?>
..... Template Body A.....
Param 1: <?PARAM_1?>
Param 2: <?PARAM_2?>
Param 3: <?PARAM_3?>
Param 4: <?PARAM_4?>
<?end for-each?>
<?end for-each?>
<?end if?>=====secton brk (next page)========
<?if@section:count(G_TEMPLATE[TEMPLATE='TEMP_B'])>0?>
<?for-each-group:G_TEMPLATE[TEMPLATE='TEMP_B'];TEMPLATE?>
Template: <?TEMPLATE?>
<?for-each:G_MAIN?>
..... Template Body B.....
Param 1: <?PARAM_1?>
Param 2: <?PARAM_2?>
Param 3: <?PARAM_3?>
Param 4: <?PARAM_4?>
<?end for-each?>
<?end for-each?>
<?end if?>=====secton brk (next page)========
<?if@section:count(G_TEMPLATE[TEMPLATE='TEMP_C'])>0?>
<?for-each-group:G_TEMPLATE[TEMPLATE='TEMP_C'];TEMPLATE?>
Template: <?TEMPLATE?>
<?for-each:G_MAIN?>
..... Template Body C.....
Param 1: <?PARAM_1?>
Param 2: <?PARAM_2?>
Param 3: <?PARAM_3?>
Param 4: <?PARAM_4?>
<?end for-each?>
<?end for-each?>
<?end if?>=====secton brk (next page)========
<?if@section:count(G_TEMPLATE[TEMPLATE='TEMP_D'])>0?>
<?for-each-group:G_TEMPLATE[TEMPLATE='TEMP_D'];TEMPLATE?>
Template: <?TEMPLATE?>
<?for-each:G_MAIN?>
..... Template Body D.....
Param 1: <?PARAM_1?>
Param 2: <?PARAM_2?>
Param 3: <?PARAM_3?>
Param 4: <?PARAM_4?>
<?end for-each?>
<?end for-each?>
<?end if?>=====secton brk (next page)========
<?if@section:count(G_TEMPLATE[TEMPLATE='TEMP_E'])>0?>
<?for-each-group:G_TEMPLATE[TEMPLATE='TEMP_E'];TEMPLATE?>
Template: <?TEMPLATE?>
<?for-each:G_MAIN?>
..... Template Body E.....
Param 1: <?PARAM_1?>
Param 2: <?PARAM_2?>
Param 3: <?PARAM_3?>
Param 4: <?PARAM_4?>
<?end for-each?>
<?end for-each?>
<?end if?>

Similar Messages

  • Merging Smartform Output and Adobe Form Output in a single PDF File

    Hi All,
    My Requirement is as follows -
    I have multiple Smartforms and a single Adobe Form.
    I want to merge the Smartform Outputs and Adobe Form output in a single PDF.
    I am able to merge multiple Smartform Output in a PDF , but not able to find any way to merge smartform and adobe form output as the Smartform output is in OTF Format and Adobe form output is in PDF Format itself.
    I have tried few ways , but could not find any success.
    Request you all to give me some direction to this problem.
    Thanks & Regards
    Bhavika

    Kumar,
    I am afraid this is not possible using SAP functionality. There are probably 3rd party tools which allow you to merge several PDFs into one, but SAP itself does not offer such a mechanism. There is an internal SAP function, though, which can merge several "parts" (=several PDFs) within an Adobe-created spool request into a single PDF, intended for downloading this PDF from SP01.
    This is described in note 1717357.
    Best regards,
    Alexander

  • How do you print multiple different images on a single page in preview

    How do you print multiple different images on a single page in preview?

    Chances are no one who saw your question knew the answer.
    Unless you're willing to share the answer you found here, then anyone else like you searching for the problem who comes across this thread will also be unable to thank you for providing the answer too.  

  • How to download BI Queries(more than 2) Output into a single PDF file?

    Dear All,
    Requirement:
    How to download BI Queries(more than 2) Output into a single PDF file?
    Purpose:
    The user wants to see 9 queries output into a single file (preferably a zipped file), sent to his email id on daily basis.
    Constraints:
    1) The user may not have SAP GUI on his system.
    2) The user do not want to log into the portal. (otherwise I would not have needed this help)
    Please help me with all possible ways to achieve this task.
    Regards,
    Avinash.

    Hi,
    Please check this links;
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0bfcac90-0201-0010-52a3-d5b270b86ef3
    Information Broadcasting Part 1 u2013 System Parameter Setting
    http://sapbwneelam.blogspot.com/2008/09/information-broadcasting-part-1-system.html
    Information Broadcasting-Part 2 -System Settings
    http://sapbwneelam.blogspot.com/2008/09/information-broadcasting-part-2-system.html
    Information Broadcasting Part 3 u2013 Scheduling the First Report
    http://sapbwneelam.blogspot.com/2008/09/information-broadcasting-part-3.html
    How To... Troubleshoot Information Broadcasting (BEx Workbooks)
    http://sapbwneelam.blogspot.com/2008/09/how-to-troubleshoot-information.html
    Hope it Helps
    Regards
    CSM Reddy

  • How do I print multiple tabs in excel to one pdf

    I am using Excel for Mac 2011 and want to select multiple tabs and have this print to one pdf file.  I can print to a normal printer, and have done this for years on a PC, but the Mac pdf function seperates it into seperate files.  I am happy to buy an aftermarket soeftware program for a reasonable price.

    i would not have posted this without extensive experience, please don't feel slighted.  There are a number of posts about this on other blogs and i am hoping this network might help me solve it. 
    I did make one error in my description, as it is true that sigle page documents under seperate tabs will sometimes combine into a single pdf...but not always in my experience. 
    I am absolutely certain that multiple page documents under seperate tabs will not combine.  I will also crarify that while all tabs are portrait, they do not have the same fomatting and # of columns. 
    Finally, this absolutely does work in Excel 2010 for PC when writing to a pdf writer, the problem seems to be Mac based.  My sense is I need to buy a 3rd party pdf writer that truly acts like a printer with its own drivers, does anyone make this?

  • After moving to Lion, I can no longer print multiple different images on a single page as before when I select "copies per page". Is there any way to regain that ability?

    In systems prior to "lion" when I wanted to select and print multiple different imagews per page, I could select the number I desired in "copies per page". Now when I select a number in "Copies per page", I get that number of a single image instead of 1 of each each different image. Is there a way around this?
    Thanks,
    Tom

    Chances are no one who saw your question knew the answer.
    Unless you're willing to share the answer you found here, then anyone else like you searching for the problem who comes across this thread will also be unable to thank you for providing the answer too.  

  • How to print multiple mail forms in a single run?

    How can multiple, personalized letters be printed out from SAP CRM 7.0?
    Business requirement:
    When for example entrance tickets for a trade fair are sent to a group
    of customers, the accompanying letters are to be printed out of the CRM
    system.
    In SAP CRM 5.0 this was done by creating a marketing campaign, linking
    a target group & assigning a mail form to it.
    By selecting the communication medium "Printer" it was possible to
    print multiple letters in one run and send these documents by mail (not e-mail).
    The quantities of letters that have to be sent are too small to
    outsource the job to an external service provider (e.g. a printing house).
    In the latest version of SAP CRM the communication medium "Printer" is
    however no longer available in marketing campaigns.
    Does anyone know how this requirement can be met in SAP CRM 7.0?
    Thanks in advance for your reply,

    Thanks for your reaction.
    We considered working this way, but the idea was dropped because the quantities of letters that have to be sent are too large (several hundreds) & also because no follow-up of these activities is needed.

  • Printing multiple Payment documents on a single page

    Hi All,
    I am using a standard Program RFFOD__V to print the payment documents.When I execute the program with the provided variant, the output of this program creates spool request for Payment Advice . When I see the output of the spool request it prints 50 payment documents on 50 pages(One document per page).
    The requirement is that  the client wants to print 3 documents on a single page hence it will reduce the amount of pages in the printout.
    Please suggest how can we do it. The Script attached to this standards program is a customized script.Do I need to copy the standard program and make changes to it or Can I achieve it only by changing the script ?
    Can we achieve it thorough customization,if not , then please suggets how can I achieve the desired functionality.
    Earliest reply would be appreciated.
    Thanks
    Manish

    That's one of those things that is just easier in some other programs. In ID you have to do your own n-up page.
    You can reduce the overhead, though, but making your label 1-up to start and saving that. For the n-up page place the original ID file, then use step and repeat to make a grid of linked-file labels. Now there's only one file you have to worry about updating -- the single instance. The n-up file will ask you to update the link the next time you need to print.
    You still need two files for each label, but you only need to work in the second one once.
    Peter

  • Problems printing multiple page sizes in a single document

    I print loan documents. When my documents are emailed, they are mixed page size documents of letter and letter. I cannot get the printer to switch page sizes automatically. I have to switch them manually. I am using MAC book pro with OS version 10.9.1 and acrobat reader 11.0.04. This is on a Brother Laser printer model HL5470DW

    The documents are emailed to me as a PDF file with formatting set in the documents.  We do not get a screen that allows us to tell the driver to use the Adobe document page settings.

  • Can I covert multiple Word Documents into a single PDF using Acrobat Pro

    I'm using Acrobat Pro X version 10.1.10...I'm trying to select multiple Word Document files  (Mac Version 14.4.3) but when choosing the files, Word Documents I cannot select them as a convertible file format. If I drag them into the conversion box it says they are not a recognised file format....any ideas?

    Can you open any WORD file in Acrobat? If not, it is likely a limitation of Acrobat on the MAC. On the PC, you can simply use the Combine option in the file menu to create a new PDF. The conversion of the WORD document uses the PDF Maker option installed in WORD that must work, but this is the same process as opening a DOC or DOCX file directly in Acrobat. There are limitation with the compatibility of various versions of OFFICE and Acrobat that could be another issue you are having, but I don't know the combinations for a MAC. This only gives you some thoughts to consider. Some of the MAC users may be by later to give further thoughts.
    The alternative is to create a PDF for each of the WORD files and then use the combine feature to combine the PDFs.

  • Multiple audio files on a single PDF page ?

    Hi
    I have an interactive pdf with 10 audio clips on a page
    and ten buttons each button has ten actions - 1 action to play a specific audio clip and 9 actions to stop all others.
    The thing is when I first load up this page and click on any of the buttons every single audio clip triggers! Please tell me there is a way around this problem?!
    Thanks
    JB

    You're making it too complicated. I just tested the following with three clips, it should work also with ten.
    Make ten buttons to play the 10 clips. Each has only one action: Sound > Play (name of clip)
    Make one button to stop the music (I called it "Stop the Music"). It has 10 actions. Each of them is Sound > Stop (clip1), Sound > Stop (clip2), etc.

  • Printing multiple 'sheets' per page, using adobe pdf printer

    I've got a number of PDFs that are scanned books, and they were scanned 2 pages at a time, and then OCRed
    What I'd like to be able to do is re'print' the file to a new PDF file (so that the OCRed text remains searchable in the new file), in a5, so that in stead of 2 pages on every a4 'page' i get one 'book page' per 'PDF page'.
    While it's fairly easy to tell Acrobat to print to a5, this will result in every left half of the a4 page being printed to the new file, and every right side of the page being discarded.
    But if I rotate all pages in the file 180 degrees and print that, the print preview does show the reversed page properly, but once I print the file, it will rotate the pages back before printing them, once again yielding only the left side of every page (probably in a misguided effort to help me)
    Why doesn't the printer automatically print the right side on a new a5 sheet, or at least allow me to orient the pages any way i like while printing them?
    Does anyone know of a way for me to print these pages properly, or if the acrobat pdf printer is somehow bugged? (and can/will this be fixed?)

    Hi Timothy,
    Please ask your question on the regular Acrobat User-to-User forum. This forum deals with 3D specific issues, and although you may have Acrobat 3D installed, your question would most likely get a good response on the other forum.

  • How to print multiple identical-copies in one single page?

    Hi all,
    I need to print several copies of the same image in one single page. I've tried the following:
    - selecting the layout 4-pages in one.
    - printing 4 copies.
    However, this produce 4 physical pages, with the miniaturized image.
    No way to get 4 copies of the same image in the same page.
    Very thanks in advance,
    Jonatan

    jonatanc, welcome to Apple Discussions.
    Is the "image" you wish to print a picture image like a .jpg?
    I do this many times when I want to print 4 images on letter size photo paper. I use Photoshop Elements, but you could probably use most any graphic application.
    I do a Select All & Copy of the image. Then open a new file with a letter size. I then paste the image on the page 4 times & move the image towards the 4 corners of the page. Then print.
     Cheers, Tom

  • Multiple PO output in a single smartform

    Hi,
    I giving multiple PO as input....
    I need to display sutotal & Total at end of each PO . I have total and subtotal in footer.
    How to control footer to display after each PO..
    Some PO takes 4 pages and some takes 10 pages...
    How to control criteria.....
    Can anybody help me in this issue..
    regards,
    Jenifer

    Hi,
    There is two ways to achive this .
    1. Process data in your driver program it self and populate subtotal and totals as internal table line items and just display it in the smart forms.
    2. Insert a process logic line in your smartforms and play with the text you can display the total and subtotal.
    Should you require further help feel free to get back.
    Regards
    Bikas

  • Multiple JSPs output into single PDF file

    Could anyone guide me on how do I combine output of multiple JSP files into a single PDF file? I have got 8 different reports and shall required to have single output of all of them in a PDF file. Its urgent. Please help.

    Hi Mahalakshmi,
    Clik on the link to view document: <b>[Combining Multiple Smartform Outputs Into One PDF File|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/62ae7fcd-0b01-0010-3e9d-a54f26944450?overridelayout=true]</b>
    Thanks
    Venkat.O

Maybe you are looking for

  • IPhone 4S takes ages to refresh mobile signal

    My new iPhone 4S has just been delivered and I switched to use it from my old iPhone 4.  Despite the apparently better signal level of 4S, I found it is annoying that whenever I enter areas with no mobile coverage (e.g. Lift, underground carpark, etc

  • Any way to get the area of a mask to use in an expression?

    I'd like to find the area of a mask, or even just the bounding width or height to use as a variable in an expression. For example I'd like to have the brightness of a solid based on the area( or a dimension)  of a mask that resides in it. I can't see

  • DVD won't play in computer

    Interesting Thing... I can burn DVDs on all sorts of media. I am currently using TDK discs. I can play them (well, as well as burned DVDs play) on a multitude of players. For some reason, I can't play the burned DVDs on my own Mac. Yet, I can play bu

  • Unable to update of iOS

    unable to update of iOS. it gives network connection error after downloading the software please help

  • Easy way to log processing

    Hello all together, I have fileadapter with certain content. I want to ensure that the data in this file are processed exactly once. The argument for checking this is i.e. an invoiceNo. in the file. What would you propose is the easiest way to come t