Individual pdf file generation

Hi all,
I want to genrate pdf file after execution of my report in such a way that I give it a parameter name cust_id = 9092 and occurance in second text box is 5...it means loop started from 9092 and create 9092,9093,9094,9095,9096 files in specific folder and stop.it is not necessary that cust_id is in sequence.
Following in my code:
DECLARE
     v_SAM_CUST_ID       NUMBER(22);
       --v_ACCT_CUST_ID     NUMBER(22);
     v_rid               NUMBER;
     --v_p_cust_id         NUMBER(22);
     v_start_from        number(10):= :START_FROM;
     v_to_next           number(10):= :to_next;
     v_trid          number;
CURSOR C1 IS  SELECT A.RID,SAM_CUST_ID      FROM (SELECT ROWNUM RID,SAM_CUST_ID
                              FROM SAM ,DE_ADDR
                              WHERE SAM.SAM_CUST_ID=DE_ADDR.DE_CUST_ID
                              AND SAM.SAM_CUST_ID >= 1
                              AND SAM.SAM_FREQUENCY IN ('DAILY','MONTHLY','Quarterly','Half yearly','Yearly')) A
                              WHERE A.RID <= 10;
BEGIN
     v_start_from      := :START_FROM;
     v_to_next     := :to_next;
     v_rid:=0;
     v_p_cust_id:=0;
     if :TEXT_BOX1='S' then
     message('Firing IF..');
       OPEN C1;
       LOOP
            FETCH C1 INTO v_trid,v_SAM_CUST_ID;
            EXIT WHEN C1%NOTFOUND;
            message('generating rport...');
            host('rwclient server=reptest report=c:\cust_print1.rdf p_1='||v_SAM_CUST_ID||' userid=wh1/wh1@dwh desformat=pdf destype=file desname=c:/temp/'||v_SAM_CUST_ID||'.pdf');
          END LOOP;
       CLOSE C1;     
          END LOOP;
  ELSE
message('ELSE.....');
  END IF;
  END; 
  Any help would be appriciated.

You are almost there ...
Assuming that SAM.SAM_CUST_ID holds the customer ids (9092...)
- change the cursor
- to accept the input parameter of "p_cust_id"
- modify the where clause selecting als customer_id >= p_cust_id
- implement an order by clause ORDER BY SAM.CUST_ID
- change the OPEN C1 statement to OPEN C1(p_cust_id);
- declare a counter variable v_records_fetched NUMBER := 0;
- EXIT WHEN C1%NOTFOUND OR v_records_fetched >= 5;
- after the EXIT WHEN statement insert row :
v_records_fetched := v_records_fetched +1;
Your code should look like this
DECLARE
     v_SAM_CUST_ID       NUMBER(22);
       --v_ACCT_CUST_ID     NUMBER(22);
     v_rid               NUMBER;
     v_p_cust_id         NUMBER(22);
     v_start_from        number(10):= :START_FROM;
     v_to_next           number(10):= :to_next;
     v_trid          number;
                v_records_fetched NUMBER := 0;
CURSOR C1(p_cust_id    NUMBER)
IS  SELECT A.RID,SAM_CUST_ID      FROM (SELECT ROWNUM RID,SAM_CUST_ID
                              FROM SAM ,DE_ADDR
                              WHERE SAM.SAM_CUST_ID=DE_ADDR.DE_CUST_ID
                              AND SAM.SAM_CUST_ID >= p_cust_id
                              AND SAM.SAM_FREQUENCY IN ('DAILY','MONTHLY','Quarterly','Half yearly','Yearly')) A
                              WHERE A.RID <= 10 ORDER BY SAM.CUST_ID;
BEGIN
     v_start_from      := :START_FROM;
     v_to_next     := :to_next;
     v_rid:=0;
     v_p_cust_id:=9092;
               v_records_fetched := 0;
     if :TEXT_BOX1='S' then
     message('Firing IF..');
       OPEN C1(v_p_cust_id);
       LOOP
            FETCH C1 INTO v_trid,v_SAM_CUST_ID;
            EXIT WHEN C1%NOTFOUND OR v_records_fetched >=5;
                                v_records_fetched := v_records_fetched +1;
            message('generating rport...');
            host('rwclient server=reptest report=c:\cust_print1.rdf p_1='||v_SAM_CUST_ID||' userid=wh1/wh1@dwh desformat=pdf destype=file desname=c:/temp/'||v_SAM_CUST_ID||'.pdf');
          END LOOP;
       CLOSE C1;     
          END LOOP;
  ELSE
message('ELSE.....');
  END IF;
  END; 
  Message was edited by:
user434854

Similar Messages

  • Payslips to be converted into individual PDF file&sent to email of employee

    Dear Friends,
    My client wants that the Payslips generated by Transaction- PC00_M40_CEDT, to be converted into separate individual PDF files based on Personnel Numbers, and sent to their Individual Email Ids as maintained in Infotype - 0105.
    There should be no printing of payslips from hereon at the client.
    Need some help and guidance, regarding the details for it. Where to start and what needs to be implemented to get the above required objective. We are using Z layouts for Remuneration statements.
    Thanks & Regards,
    Sunny

    Hi Sunny,
          Please make use of program RSTXPDFT4 which converts list output to PDF 
          format.  You need to give spool number as input parameter which you can get 
          from SP01 transaction.
          This doesn't fulfill your exact requirement but you can achieve conversion of
          output to PDF format.
          Reward points if found useful.
    Best Regards,
    Krishnan.

  • Payslips to be converted into individual PDF file & sent to email of emp

    Dear Friends,
    My client wants that the Payslips generated by Transaction- PC00_M40_CEDT, to be converted into separate individual PDF files based on Personnel Numbers, and sent to their Individual Email Ids as maintained in Infotype - 0105.
    There should be no printing of payslips from hereon at the client.
    Need some help and guidance, regarding the details for it. Where to start and what needs to be implemented to get the above required objective. We are using Z layouts for Remuneration statements.
    Thanks & Regards,
    Sunny

    Hi Sunny,
    you don't have to implement or be using ESS to take advantage of its features.
    Take a look at the code that generate the ESS payslip, this contains all you need to be able to write a program to generate a PDF payslip per employee. There is no need to get SCOT or Adobe Acrobat to generate the PDF - there exist standard SAP function modules that can do this.
    From this it is then a simple step to enhance the program to generate an email and attach the payslip.
    I have written a program to do exactly this in the past, so I know that it is possible. I will not send you the code for the program, please do not ask.
    However, it is possible and SAP have already done the greatest part of the work for you by building the ESS code - take advantage of it!
    Hope this helps,
    Chris

  • Creating individual pdf files?

    Hello,
    I have a MacBook with OS-X 10.5.8
    I used Excel and Word to create a mail merge Word doc which contains grade reports for 75 students. I need to turn each page into an individual pdf document which I can then email to each individual student.
    Is there a way to Save As or print to pdf and automatically create 75 new pdf files or do I need to copy, paste and save each page into a new file manually?
    Thanks for any help!
    I am new to this site so may apologies if this is the incorrect place to post this question.

    Hi Katie, might try this...
    http://mac.softpedia.com/get/Utilities/PDF-Split-and-Merge.shtml
    Or slower more arduous methods...
    http://www.documentsnap.com/how-to-split-pdf-documents-into-single-pages-using-m ac-osx/
    http://www.makeuseof.com/tag/how-to-merge-and-split-pdf-documents-on-a-mac/

  • Need help exporting multiple individual PDF files out of Indesign CC

    I work for a monthly publication and we send our files to the press at the end of the month. There are around 190+ pages that need to be exported as individual PDF's and each PDF needs to be labled as their correct page number. Since we often are backed up against the wall at our deadline, we really need a way to export all these files at one time. Is there a way to export multiple PDF files at one time in Indesign CC?

    You could script InDesign to export each page as individual PDF with specific export presets and labeled with correct page number.
    But you could also use Acrobat Pro for this task (sorry for the certainly wrong translation of the Acrobat UI – I use a german version ...):
    Export the whole publication as 1 PDF file (pp. 1-190).
    Open it in Acrobat Pro and choose »Tools › Extract Pages«.
    Type 1 to 190 and check the box »extract pages as single pages«, choose the location where to extract to and acrobat automatically numbers your new PDFs sequentially from 1 to x. (Caution: it doesn’t take the correct page number, but numbers sequentially, so it is important to have a PDF from pp. 1-190 in the correct order.)
    So with this (as mentioned – sorry for German ):
    You’ll get this:
    Tobias

  • Individual pdf files for every page

    Hi..
    We have a scenario like this.
    We have around 8000 records in a table and we have to generate a report which has to create 8000 pdf files at a stretch. ( 1 pdf for every row)
    Please throw some light on this...and let us know how to do this..
    Thanx and regards
    Sriram

    Hi Sriram,
    You can use 'Advanced Distribution' Feature to achieve this.In the distribution file, use the ' Foreach' tag and set the 'Repeat On' property in the section.
    For more information, have a look at the 15- Chapter: Creating Advanced Distributions in the ' Publishing Reports' manual ( http://www.oracle.com/technology/documentation/reports.html).
    Thanks,
    Vidya

  • FOP Serializer, PDF File generation

    In attempting to generate PDF files from XSQL: Any ideas which jar files from the Apache FOP-0.20.5 release need to be included in the classpath of the XSQL servlet (XDK 9.2.0.2.0) to make the emptablefo.xsl demo function? Are there other jar files required (other than xsqlserializers.jar)? The docs seem to want w3c.jar, which doesn't come with that release. Where does one find it, if needed?
    I keep turning up with
    XSQL-017: Unexpected Error Occurred
    java.lang.NoSuchMethodError
    at oracle.xml.xsql.serializers.XSQLFOPSerializer.serialize(XSQLFOPSerializer.java:19)
    Is my Adobe plugin meant to fire up if this works correctly?
    Cheers

    Hi All,
    I got the latest FOR version and have all the orther jars in my class path. I am using XSQL and with the previous version of FOP, my PDF display was fine.
    With the new version of FOP i am having the problems mentined on this forum.
    As 12... suggested, i got the XSQLFORSerializer , compiled and added it in the jar(xsqlserializers.jar) and added the jar in my class path, added the other mentioned jar(except xercesImpl-2.2.1.jar since xerces1-2.3.jar is in the class path and adding xercesImpl-2.2.1.jar causes JRun not to start with some kind of weird Null TLD string "--" cannot be in the comments error).
    Everything looks fine ,just that the pdf does not show and the message is
    07/01 10:47:23 user CacheFilesServlet: Processing XSQLRequest...
    [INFO] java.lang.NullPointerExceptionbuilding formatting object tree
    at org.apache.fop.pdf.PDFDocument.outputHeader(PDFDocument.java:1321)
    at org.apache.fop.render.pdf.PDFRenderer.startRenderer(PDFRenderer.java:
    237)
    at org.apache.fop.apps.StreamRenderer.startRenderer(StreamRenderer.java:
    188)
    at org.apache.fop.fo.FOTreeBuilder.startDocument(FOTreeBuilder.java:240)
    at org.apache.fop.tools.DocumentReader.parse(DocumentReader.java:454)
    at org.apache.fop.apps.Driver.render(Driver.java:498)
    at org.apache.fop.apps.Driver.render(Driver.java:518)
    at oracle.xml.xsql.serializers.XSQLFOPSerializer.serialize(XSQLFOPSerial
    izer.java:38)
    at oracle.xml.xsql.XSQLPageProcessor.process(XSQLPageProcessor.java:257)
    at oracle.xml.xsql.XSQLRequest.process(XSQLRequest.java:304)
    at oracle.xml.xsql.XSQLRequest.process(XSQLRequest.java:198)
    at com.cleverdevices.util.CacheFilesServlet.generateReport(CacheFilesSer
    vlet.java:1045)
    at com.cleverdevices.util.CacheFilesServlet.doGet(CacheFilesServlet.java
    :372)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at jrun.servlet.security.StandardSecurityFilter.doFilter(StandardSecurit
    yFilter.java:102)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
    241)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
    527)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPoo
    l.java:348)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:451)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.
    java:294)07/01 10:48:04 user CacheFilesServlet: output length = 0
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    com.cleverdevices.util.ReportGenerationException: No output from XSQL
    at com.cleverdevices.util.CacheFilesServlet.generateReport(CacheFilesSer
    vlet.java:1065)
    at com.cleverdevices.util.CacheFilesServlet.doGet(CacheFilesServlet.java
    :372)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at jrun.servlet.security.StandardSecurityFilter.doFilter(StandardSecurit
    yFilter.java:102)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
    241)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
    527)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPoo
    l.java:348)07/01 10:48:04 user CacheFilesServlet: Deleting bad cache file: C:\JR
    un4\servers\default\tatools\main\reports\cache\whc_kneel_bu
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:451)
    at jrunx.scheduler.ThreadPool$UpstreamMetrsdepot_dd_1,,_20040630.pdf
    ics.invokeRunnable(ThreadPool.java:294)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    com.cleverdevices.util.ReportGenerationException: IO Error: com.cleverdevices.ut
    il.ReportGenerationException: No output from XSQL
    at com.cleverdevices.util.CacheFilesServlet.generateReport(CacheFilesSer
    vlet.java:1076)
    at com.cleverdevices.util.CacheFilesServlet.doGet(CacheFilesServlet.java
    :372)
    Any pointers will help.
    I am using XSQL and JRun server.
    Thanks

  • Input stream to pdf file generation in WDJ

    Hi Experts,
    I want to create a pdf file from some inputstream or string content in Webdynpro Java code.
    Can anyone please provide me some code snippet related to this.
    I tried below code:
    public class test {
         public static void main(String[] args) {
                   String strFilePath = "C://demo.pdf";
                   try {
                             FileOutputStream fos = new FileOutputStream(strFilePath);
                             String strContent =
                                       "Write File using Java FileOutputStream example !";
                             fos.write(strContent.getBytes());
                             fos.close();
                   } catch (FileNotFoundException ex) {
                             System.out.println("FileNotFoundException : " + ex);
                   } catch (IOException ioe) {
                             System.out.println("IOException : " + ioe);
    It is creating a pdf file in my local system but while opening the file it is saying "Corrupted file".-
    Any kind of help will be highly appreciated.
    Regards,
    Sambarn

    You have to use WDResource and related classes for reading/writing the files on portal app server.
    For getting some Idea, look at this wiki.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71?quicklink=index&overridelayout=true
    -Yugandhar Reddy

  • PDF File Generation in SAP-ByD

    Dear All,
    How to generate PDF file based  reports in SAP-ByD
    Best Regards,
    Harish.Y

    Hi Harish,
    What do you mean by PDF file based reports?
    In ByD, typically you can generate PDF for various use-cases like preview (read only PDF), Send To (Read / write PDF) e.g. Sales order as PDF, etc. There is  a concept of Form Template maintenance, where you can view/edit the existing template and even create your own variant.
    Please describe your requirement if this doesnot answer your question fully.
    Regards,
    Damandeep
    Edited by: Damandeep Thakur on Mar 6, 2012 7:05 AM

  • PDF file generation

    I am unable to generate a pdf file of a report that I generated. I get Rep-03335 error. I can use all the help I can get

    Be sure you have a default printer
    assigned. Check the permissions on
    the machine as well. Try installing a
    later version of acrobat too.

  • I'm hoping someone can kindly help with me with an error message that is causing PDF file generation failure when using InDesign CS6 for Windows and Acrobat Distiller 8.0

    <PDFX ISO="15930-1:2001" COMPLIANT="true">
    PDF/X Compliance Report
    1.  Summary
       Warnings: The total found in this document was 0.
       Violations: The total found in this document was 0.
       No problems were found in the document.
       This document passes PDF/X-1a:2001 compliance checks.
    </PDFX>

    @Jack – this is no error message, just a log, that all was running ok.
    See detailed answer here:
    Re: I am getting some errors while distilling the post script file.
    Uwe

  • AIX-based printing and PDF file generation

    Greetings,
    looking to find a best practices approach to scheduled printing of pdf BOXI reports hosted by in an AIX environment to a Windows AD secured network printer. 
    Looking at three possible approaches:
    1. AIX-based printing: lpr queue with some ghostscript translation to postscript
    2. Windows-based printing via SAMBA: AIX based printing using samba services
    3. Windows-based printing via  FTP: transfer the file out from the AIX server and script the printing using Control-M
    Leaning towards #3 presently.  Expert guidance would be greatly appreciated.
    Martin

    Hi Martin,
    I faced a similar situation at a client site and after actually trying out Option 1, then considering the cost of Option 2 (resources, skill sets and long-term maintenance), we decided to go for Option 3.
    With Option 1, we used the lpr queue commands to send the reports to particular printers (print queues) on the that were registered on the AIX box. We faced two major problems with this approach.
    (1) We had what we called the 'default' printer problem, where, may be based on the volume of pages we were printing or the performance issues on the server itself, print jobs would go the default print queue on the AIX server. As you can imagine, that was not good. Jobs that were intended for one department were ending up in another, and the default location had to start parsing through the print outs and create piles. Operational nightware.
    (2) Cover sheets... We had 1 report (basically a form) that needed to be printed with data for different departments (six depts). So a developer wrote a little java app that called BusinessObjects and passed in the report parameters - and ID, and the printer name. The problem that we faced was that the print jobs would come out the other end, each with its own cover sheet. Even though we passed in the AIX command to suppress the  cover sheet, they came out. I don't remember whether specifying the switch in the CMC worked or not - but we didn't have that luxury - we had to do programmatically because the printing was so dynamic.
    So we opted for a rather simple situation, which was made possible also because the customer's license allowed it. We installed the report job servers (no CMS) on a windows servers, assigned them to the CMS pool on the AIX server, installed the printers we needed on the Win server. Then we created a Server group that included just the Windows servers (report processing servers), and locked the report in question to only be processed by servers in that group. So the report would only be processed by the Windows servers with the necessary printers.
    The solution has been in operation for over 12 months and working great. We can manage all the servers from the CMC and with auditing turned on, we have great visibly on the performance of the system. Because this printing system is so critical, the process is being enhanced by throwing the stats on an Xcelsius dashboard for real-time monitoring by the operations folks.
    Hope this helps. I'll be glad to share more if you're interested.
    Will

  • PDF File Generation in LabWindows/CVI

    Hi,
    I'm looking for ideas on how to automatically generate multiple-page PDF documents in LabWindows/CVI.
    The pages consist of images of panels that have automatically updated some graphs.
    Any ideas?
    Thanks,
    Kirk

    Howdy Kirk,
    Great question. You might try one of these four options:
    Install a "PDF Printer" in Windows. This is essentially a virtual Windows printer that we can print to in CVI using functions like PrintPanel, PrintTextFile, etc.
    Find a commandline PDF creator and call the commandline application from CVI. (See the launchexe.cws example located in the Example Finder under Comm w/External Apps » OS)
    Find a DLL you can call to create a PDF. (See the examples located in the Example Finder under Comm w/External Apps » Using External Code)
    Install a PDF creator and communicate with it through ActiveX if it has an ActiveX server.
    Sorry I can't provide a specific recommendation for PDF software for these suggestions, but I hope it gets you going in the right direction!
    Message Edited by pBerg on 02-05-2010 10:00 AM
    Warm regards,
    pBerg

  • Export to PDF - Can a single report (rpt file) create multiple PDF files using the export command?

    Post Author: markeyjd2
    CA Forum: Exporting
    Greetings forum members,
    My question is, in its entirety: Can a single report (rpt file) create multiple PDF files using the export command, ideally one PDF file per DB record?
    In my case; I have a Crystal Report that reads data from a DB table containing ~ 500 records.  When I export the report to a PDF file, I get one PDF file, with ~ 500 pages.
    What I would like to do is export the report to ~ 500 individual PDF files; One file per DB record.  The file names would be based on the table's primary key.
    Is this possible?

    Post Author: Micha
    CA Forum: Exporting
    Hi,
    you need some lines of code, but its easy. Dependend on how to start the generation of your 500 PDFs, you can write an ASP page and start it via Web Browser, or a Windows Script and start it via scheduled job...
    Here's an abstract of the ASP code I use:
    First, you create a recordset (here: "rsc") which gives you the list of ID fields you want to export, then you create CrystalRuntime.Application object, then you loop through the recordset, open your report (here: "oRpt") and set login info. Then set the selectionformula, so that the report displays only the data of the current ID, e.g.:
      oRpt.RecordSelectionFormula = "(" & oRpt.RecordSelectionFormula & ") AND {myTab.myVal}=" & rsc("myVal")
    Then you export the report, move to the next record in recordset, and repeat the loop until recordset.EOF. Then you close recordset and connection.
    Micha

  • How do I create 1 pdf file out of multiple pdf's

    I have about 40 individual pdf files that I'd like to turn into 1 file with 40 pages.  How do I do it?
    Thank you, Joe

    Hi Captain Puget,
    You can use either Adobe PDF Pack of Acrobat to combine PDF files. With PDF Pack, you can combine 12 files at once, so you'd have to combine in batches. You wouldn't have that same limitation with Acrobat.
    Please see cloud.acrobat.com and www.adobe.com/products/acrobat.html for more information.
    Best,
    Sara

Maybe you are looking for