How to email Pdfs Using BI PUBLISHER

Hi ,
we have a bi publisher report which generates AR Pdf Invoices.
We have a requirement that when bi publisher generates pdf invoices it should send an email to the customer with the pdf file as attatchment.
The Customer name will be on the invoice.Now in bursting file we have the code like
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- $Header: BURSTING_FILE_XXXX_AR_XXXINVOU1.xml 115.3 2009/01/27 01:11:57 xdouser noship $
-->
- <!-- dbdrv: none
-->
- <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
- <xapi:request select="/XXXINVOU/LIST_G_INVOICE_HDR/G_INVOICE_HDR">
- <xapi:delivery>
<xapi:filesystem output="${CF_PDF_DIR}/${D_PDF_FILE_NAME}" />
</xapi:delivery>
- <xapi:document output-type="pdf">
<xapi:template type="rtf" location="xdo://XXXX_AR.XXXINVOU1.en.US/?getSource=true" filter=".//G_INVOICE_HDRC_ORG_ID = 240 or C_ORG_ID = 330 or C_ORG_ID = 407 or C_ORG_ID = 994 or C_ORG_ID = 1174" />
<xapi:template type="rtf" location="xdo://XXXX_AR.XXXINVOU1_AUSTRALIA.en.US/?getSource=true" filter=".//G_INVOICE_HDRC_ORG_ID = 592" />
<xapi:template type="rtf" location="xdo://XXXX_AR.XXXINVOU1_JAPAN.en.US/?getSource=true" filter=".//G_INVOICE_HDRC_ORG_ID = 550" />
<xapi:template type="rtf" location="xdo://XXXX_AR.XXXINVOU1_SWEDEN.en.US/?getSource=true" filter=".//G_INVOICE_HDRC_ORG_ID = 852 or C_ORG_ID = 1913 or C_ORG_ID = 1973 or C_ORG_ID = 1873" />
<xapi:template type="rtf" location="xdo://XXXX_AR.XXXINVOU1_GENERIC.en.US/?getSource=true" filter=".//G_INVOICE_HDRC_ORG_ID != 240 and C_ORG_ID != 330 and C_ORG_ID != 407 and C_ORG_ID != 550 and C_ORG_ID != 592 and C_ORG_ID != 994 and C_ORG_ID != 1174 and C_ORG_ID != 852 and C_ORG_ID != 1913 and C_ORG_ID != 1973 and C_ORG_ID != 1873" />
</xapi:document>
</xapi:request>
</xapi:requestset>
could anyone please suggest me what code i should add to this and where should i add.
Thanks,
M

Are you using Oracle's BI Publisher (the full module)? or are you using the BI Publisher that comes as part of PeopleSoft Application?
The reason I am asking is that we have a similar request were we need to email out our ACH advices from Accounts Payable and I have been told we need to create an application engine program to run the BI Publisher report and then email thru the SendMail() function.
I am just trying to see if anyone has already done something like this as I cannot find sample app engine coding to run, save and email an ACH pdf file.
Thanks.
Jennifer

Similar Messages

  • How to Print PDF using BI Publisher or Apache FOP in APEX 4.0.1

    Hi friends.
    I have a problem with APEX and print report in ouput of PDF.
    My configuration is:
    1. Database: Oracle 11gR2 Standart Edition
    2. APEX version: 4.0.1
    3. APEX Listener version: 1.0.2.238.15.24
    4. Oracle WebLogic Server version: 10.1.3.3.0
    5. Oracle BI Publisher version: 10.1.3.4.1
    6. Apache Tomcat version: 6.0
    7. Cocon version: 2
    8. Operating System of Install Weblogic Server, BI Publisher, Apache Tomcat is Windows 2008 Server 32 bits.
    9. Operating System of Install Database is HP-UX 11i
    Ive configured a weblogic Server with BI Publisher and I have also configured the printing properties of the APEX Server with the following settings:
    Tab Report Printing.
    Print Server: Advanced(Rqueries Oracle BI Publisher)
    Print Server Protocol: HTTP
    Print Server Host Address: 174.17.49.106
    Print Server Port: 7001
    Print Server Script: /xmlpserver/convert
    When I want to print the report in a PDF format it returns me the following error:
    ORA-20001: The printing engine could not be reached because either the URL specified is incorrect or a proxy URL needs to be specified.
    Error failed
    I have search for documentation but i cant still print the report.
    I would appreciate a lot if anyone of you guys can help me figure this out

    Hello Tux Dueñas,
    I think you need to have ACL's setup in Oracle 11g in order to be able to connect to the BI Publisher server. Check the following link on how to setup ACL's in 11g...
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/afterup.htm#BABFCBJI
    Thanks,
    Machaan
    Edited by: Machaan on Jan 25, 2011 11:49 AM

  • Cannot generate chart in PDF using BI Publisher

    I have a java program to generate chart in PDF using BI publisher. In some platforms the chart cannot be generated. Get the following exception.
    [061812_075947838][][ERROR] java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.apps.xdo.template.rtf.img.RTFChartUtil.invokeMethod(Unknown Source)
    at oracle.apps.xdo.template.rtf.img.RTFChartUtil.generateChartAsBase64(Unknown Source)
    at oracle.apps.xdo.template.rtf.XSLTFunctions.chart_svg(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.xdo.parser.v2.XSLExtFunctions.callStaticMethod(XSLExtFunctions.java:111)
    at oracle.xdo.parser.v2.XPathExtFunction.evaluateMethod(XPathExtFunction.java:307)
    at oracle.xdo.parser.v2.XPathExtFunction.evaluate(XPathExtFunction.java:226)
    at oracle.xdo.parser.v2.XSLValueOf.processAction(XSLValueOf.java:101)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLTemplate.processAction(XSLTemplate.java:191)
    at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:512)
    at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
    at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
    at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
    at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
    at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
    at com.edocs.common.reporting.batch.BatchEventHandler.generatePDFFile(BatchEventHandler.java:327)
    at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:252)
    at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:136)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:126)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:46)
    at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
    at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.NoSuchMethodError: oracle.dss.util.CustomStyle.<init>(Ljava/io/InputStream;)V
    at oracle.dss.graph.CommonGraph.setStyleStream(CommonGraph.java:10774)
    at oracle.dss.graph.CommonGraph.setStylePath(CommonGraph.java:10743)
    at oracle.dss.graph.CommonGraph.setStylePathXML(CommonGraph.java:12138)
    at oracle.dss.graph.CommonGraph.setXML(CommonGraph.java:13348)
    at oracle.dss.graph.CommonGraph._setXML(CommonGraph.java:15821)
    at oracle.dss.graph.CommonGraph.setXML(CommonGraph.java:14751)
    at oracle.dss.graph.Graph.setXML(Graph.java:5243)
    ... 60 more
    In office word bi publisher plugin, load the xml, the chart can be generated.
    The above exception only occurs in some linux and solaris platforms, but never occurs in windows.
    The following plateform throws exception.
    Oracle Linux Server release 5.6 + java version "1.6.0_25"
    The following plateform doesn't throw exception.
    Enterprise Linux Enterprise Linux Server release 5.4 (Carthage) + java version "1.6.0_05"
    The strange thing is in those platforms which can throw exception, if the code is not running in EJB, the chart still can be generated.
    In other words, if the normal web or standalone app invokes that program; the chart can be generated.
    The java code is as below.
         public static void generate(String inputXML, String pdfTempPath, String outputPDF) {
              Reader reader = null;
              try {
                   File xmlFile = new File(inputXML);
         reader = new BufferedReader(new InputStreamReader(new FileInputStream(xmlFile), "UTF-8"));               
              ByteArrayOutputStream tmpXSL = new ByteArrayOutputStream();           
              RTFProcessor rtfProcessor = new RTFProcessor(pdfTempPath);
                   rtfProcessor.setOutput(tmpXSL);
                   rtfProcessor.process();           
              ByteArrayInputStream in = new ByteArrayInputStream(tmpXSL.toByteArray());
              FOProcessor processor = new FOProcessor();
              processor.setData(reader);
              processor.setTemplate(in);
              processor.setOutput(outputPDF);
              processor.setOutputFormat(FOProcessor.FORMAT_PDF);           
              processor.generate();
              catch(Exception e) {
                   e.printStackTrace();
              finally {
                   try {
                        if(reader!=null) {
                             reader.close();
                   } catch (Exception e) {
    Can anyone explain why this exception is thrown?
    Thanks a lot.

    Hello Tux Dueñas,
    I think you need to have ACL's setup in Oracle 11g in order to be able to connect to the BI Publisher server. Check the following link on how to setup ACL's in 11g...
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/afterup.htm#BABFCBJI
    Thanks,
    Machaan
    Edited by: Machaan on Jan 25, 2011 11:49 AM

  • Cannot email pdf using Acrobat Reader XI v11.0.3 in Windows 8. No problem when using in ms vista. ge

    Cannot email pdf using Acrobat Reader XI v11.0.3 in Windows 8. No problem when using in ms vista. get "authentication error". Sometimes will get a very quick dialogue box showing the gmail login screen but then disappears. I use firefox and IE

    Hi Rodney
    Welcome to Apple Discussions
    This sounds like one of those "oddities", contributed to by a few sources.
    I can clear the Safari cache files as a temporary solution, but I encounter the same difficulties with the “problematic” files once they have been opened again.
    Wondering if you disabled the Safari Cache would the refresh function work correctly? As a test you can disable the Safari Cache by Emptying the Cache first via the Safari menu, then Quit Safari. Now go to the Finder>Your User Library>Caches>Safari. Single click on the Safari folder, then Apple Key + I to open Info panel. There, check the "locked" box. This prevents further additions to the cache. The downside, you lose your ability to upload images etc. within Safari (my cache is disabled, so I use Firefox for the uploads).
    Then restart Safari. Try the PDF from within Safari.
    Post back

  • How to do subtemplate Using XML Publisher Template Builder for Word 5.6.2

    Is it possible to do subtemplate (similar to subreport in crystal report) using XML Publisher Template Builder for Word 5.6.2?. If yes, can anyone explain how to call or import subtemplate from main template?
    Thank you
    V.Piraba

    Hi V. Piraba,
    Here is how it works for me in Microsoft Word 2003. I'm not sure if it will work in Word 5.6.2.
    Creating Subtemplates
    1) Make sure you fill in the “Territory” field when creating Subtemplates. Otherwise there will be no way to import the Subtemplate into another Template. The Import command requires the Territory field to call it from other Templates. You will get a big Java error if you try to import a Subtemplate that does not have the Terriroty field populated.
    Importing Subtemplates
    1) Place the following syntax at the beginning of your XML Publisher template to import a subtemplate (in Oracle Applications)
    <?import:xdo://XDO.[Template Code Name].English.US?>
    Example: <?import:xdo://XDO.WC_SUBTEMPLATE_LOGOS.English.US?>
    2) Use the following commands to importing Subtemplates from local/network drives (outside of Oracle Applications):
    <?import:file:C:/Temp/WC Subtemplate - Logos.rtf?>
    <?import:file:L://Templates/WC Subtemplate - Logos.rtf?>
    <?import: file:///C:WorkChemical.xsl?>
    You can email me at [email protected] if you have further questions.
    Hope this helps!
    Dan

  • How to email .pdf PO to supplier after approval?

    Hi All,
    My client has a requirement to email .pdf PO to supplier after approval of PO.
    kindly give me setup steps as to how I can acheive this through workflow.
    You can mail me setup steps to this email address: [email protected]
    Thanks,
    Younus

    The setups are detailed on a note in the following metalink note.
    FAQ: E-Mail PO Functionality [ID 307577.1]
    Basically, make sure XDO is installed, change Purchasing email option to PDF and make sure you enter an email address on po site. For details, refer to the note above.
    Hope this answers your question
    Sandeep Gandhi
    Omkar Technologies Inc.
    Independent Techno-functional Consultant
    513-325-9026

  • Default reply-to email address using XML Publisher Enterprise

    I'm currently just testing out XML Publisher. I've noticed that when I use the web interface to email a report (with either the send button or scheduling the report to run at a specific time), the SENDER is always set to "[email protected]". How do I go about changing this default email address.
    I've seen samples on how to do this with a control file when trying to create reports using java API, but nothing on how to setup a default email address when users are using the out of the box configuration (the sample reports in this case).

    After more searching, I found this for anyone who is interested:
    Re: how to personalize from address in xml publisher
    I did as instructed and copied the file from the installation CD, modified the file and it worked like a charm.

  • PDFs using BI publisher and special characters - pound sterling

    I have a table with character strings which include the £ pound sterling sign.
    If I create an xml file from the table using the escape sequence for the pound sign & # 163; and load it into BI publisher, the pdf renders correctly using an rtf template.
    If I include the pound sign in the rtf template itself the pdf renders correctly and if I use a report query in Apex based on the table, and an rtf template then the pdf renders correctly.
    However there is a limit to the number of columns that can be sent to BI via the report query - we have found this to be 119 columns. For more than this we have been using a stored function to return xml data as a clob and use the clob to generate the pdf with the rtf report layout (using get_print_document). This method works fine but the pound sign is not rendered correctly (appears as "?").
    The NLS_LANG is set to english_united kingdom in the database and in BI publisher. The locale in bi publisher is en_GB. BI will create the pdf correctly with the pound sign if using a standard xml file (with escape seq for pound) so I am sure it is not a language issue in BI/Apex.
    Any ampersands in the xml cause the pdf to fail completely and we cannot represent special characters with a sequence containing the ampersand for this reason. I have tried "& # 163;" and "& amp;#163;" and variations and have also tried using CDATA, none of which gives the correct pdf output. I have also tried to switch the encoding to Windows-1252 or ISO-8859-1 in the header of the xml (xml generated by stored procedure so can control this), but this gives incorrect results too.
    We also need to send other special characters to BI via get_print_document and apex (bullet points, ampersands, dashes ) but cannot use the escape sequences because of the ampersand problem.
    Has anyone had any success with this?
    Is there any plan ( for a future version of Apex) to increase the number of columns that can be used in report query using Apex/BI publisher?
    Thanks
    Kathryn

    Hi Kathryn
    I've had exactly the same problem as you've mentioned.
    Firstly, I've also found that I cannot select more than 119 columns from a view using a report query and have opted to the use the stored function to return the xml (same as you).
    After conducting a lot of searching and experimenting i've found that you can use the following escape characters in REPLACE in your stored function:-
    '£' can be replaced with CHR(194)||CHR(163)
    '%' can be replaced with '%25'
    '&' can be replaced with '%26amp;'
    I found the above escape characters from the xml file or by opening the xml file in Wordpad. Therefore I'm sure you'll be able to find the escape characters for the other symbols that you mentioned i.e. bullet points, dashes etc.
    I hope this has helped. Good luck and let me know if you get any developments with the limitation on the number of columns that can be selected from a report query as this would save a lot of trouble (as I'm sure you're aware).
    Thanks
    Natalie

  • How to generate PDF using FDF file and the PDF form template (PHP)

    Hi Folks,
    I'm really sorry that I couldn't follow all the valuable discussions going on here, regularly. I need some immediate help.
    I NEED A PHP SOLUTION. I'm able to generate FDF files using the PDF Form Template in PHP. So, I have a collection of FDF files, which seeks the PDF template, while opened and populates the template with FDF data. Now if I need to save this PDF file, I have to do it manually clicking SAVE option. But, I need to convert FDF to PDF in bulk. So, I need some PHP based solution. The PHP script takes the PDF template and the FDF file and merges them to generate a complete populated PDF file. I know it's possible, but don't know how. I've seen Adobe FDF Toolkit. But by default it doesn't show any guideline for PHP. Please help me to write this code. I'm a professional coder. I can understand your hints and tutorials. PLEASE HELP GOOD PEOPLE.

    The only reason I am responding to this post is because the poster sent me a request through the forum message system asking for my help.
    Although I did populate PDFs with FDF data generated by web forms a year or so ago, I have since abandoned that kind of solution. It was a big headache. I found it far more stable and flexible to use html, php and css to populate forms that are almost as nice looking as PDFs.
    So my advice is, if you can possibly avoid going the FDF/PDF route, you will be better off.

  • How to generate PDF using selcted row from datagrid in mxml flex4 web application

    hi friends.
    i am using flex4 web application with mxml tabs.
    i am having one datagrid and one button outside the grid ,
    i   am having one datagrid in that i am having 5 records if i click a   record from the datagrid then click that button means that particular   record will save as PDF in my local PC.
    How to do that,
    Any suggession or examples.
    Thanks in advance
    B.venkatesan.

    Thanks Vibhuti,
    i got some idea abt PDF save bt please tell .i have some doubts in this code
    var bytes:ByteArray = claimPDF.save(Method.LOCAL);
    var f:FileReference = new FileReference();
    f.save(bytes,"tourdeflex-pdf-sample.pdf");
    what is claimpdf and Method? it show undefiened probery error
    and f and bytes also show the same error.
    what header files i have to import for file reference concepts;
    i am using FLASH PLAYER 10;
    tell what i will do
    Thanks
    B.venkatesan

  • How to generate PDF using fonts from Extended Font Pack?

    Hello
    Extended Font Pack, available for download contains MyriadPro-Regular.otf font that has cyrillic glyphs.
    I want to generate PDF document with cyrillic unicode data  that can refer to the MyriadPro-Regular font resource without embedding font.
    Are Extended Font Pack resources CID keyed fonts or not?
    Looks like such example of PDF structure allowed me to use it only in ANSI encoding
               'Type':'/Font',
                'Subtype':'/Type1',
                 'Name': '/MyriadPro-Regular' ,
                'BaseFont':  '/MyriadPro-Regular',
                 'Encoding': '/WinAnsiEncoding',
    What values should be for `Subtype` and `Encoding` to render cyrillic unicode (UTF-8 encoded) data and use MyriadPro-Regular Open Type downloaded from adobe and installed into local system without embedding it?
    Thanks

    Sorry for the delay. I admired with investigation of this case.
    My aim is to generate PDF docs on web site that have i18ned content. ALso client does not want to deal with any font licenses (font embedding will raise question about font licensing) and to reduce PDF file size with such approach. So I'm looking for the ability to link fonts in PDF source, that can be easiely downloaded from adobe.com and installed into local desktop. With Latin group (en-us, french, german) we  can use one of the 14 standard fonts, for CJK - Adobe Asian Font pack. I was considering (Myriad Pro or Minion Pro) font resources from Extended Font pack to cover Cyrillic glyphs. I observed that such fonts are usually installed with Adobe Reader installation (MyriadPro-regular.otf). To render cyrillic glyphs I followed such steps like converted into cp1251 encoding range of the cyrillic unicode data (as you told those fonts do not support unicode encodings the same way as CID keyed asian fonts) and pointed to the Type1 MyriadPro-Regular with custom WinAnsiEncoding. One problem I faced with is - that glyphnames are differrent in diferent Extended Font pack versions. I mean that cyrillic glyphnames for the Adobe Reader 8 started from `afii100xx`, when for the Adobe Reader 9 they are named `uni0xx` for the same font named MyriadPro. I used such glyphnames in the /Differences list in PDF source. How can I generate PDF source that can be viewed successfully in both Adobe Readers version 8 and 9?

  • How to create PDF using pdfSource in WD ABAP

    Hi All,
    We are storing the PDF in a XSTRING. How can I create a PDF from this XSTRING in WD ABAP. I know we have pdfMode available in WD Java. Is there any similar functionality available in WD ABAP also.
    Please let me know, how we can achieve this
    Thanks in Advance,
    Amit

    Please posting into webdynpro ABAP section

  • How to email PDF form as attachment?

    Hi All,
    I have developed online interactive form app(dynamic).
    When user clicks the submit button after entered the data,
    I want to email the PDF form as an attachment to some users.
    Could anyone please explain the steps or give me some sample code?
    Thanks
    Sundar

    Hi Sundar,
    I suggest you to see<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2c678dc3-0401-0010-3c80-8ef48f450491">this.</a>
    Regards,
    Ram.

  • How to email PDF form as an attachment?

    Hi All,
    I have developed online interactive form app(dynamic).
    When user clicks the submit button after entered the data,
    I want to email the PDF form as an attachment to some users.
    Could anyone please explain the steps or give me some sample code?
    Thanks
    Sundar

    I found this in one of the forums dont remember which, here is the code
      public boolean EmailForm( java.lang.String pernr, java.lang.String toEmail, java.lang.String fromEmail )
        //@@begin EmailForm()
    boolean flag = true;
       try {
        String host = "exchangerelay.yourserver.com";
        //    Get system properties
        Properties props = System.getProperties();
        //    Setup mail server
        props.put("mail.smtp.host", host);
        //    Get session
        Session session = Session.getDefaultInstance (props, null);
        //    Define message
        MimeMessage message = new MimeMessage(session);
        byte[] b = wdContext.currentContextElement().getPdfSource();  
       //Attachment
        ByteArrayInputStream ba = new ByteArrayInputStream(b);
        String filename ="Filename.pdf";
        //This will create a file on the server under folder "server0"
       File file = new File(filename);  
        FileOutputStream fos = new FileOutputStream(file);
        int i = 0;
        for (i = 0; i < b.length; i++) {
         fos.write(b<i>);
        fos.close();  
        DataSource source = new FileDataSource(file);
        BodyPart messageBodyPart = new MimeBodyPart();
        message.setFrom(new InternetAddress(fromEmail));
        message.addRecipient(
         Message.RecipientType.TO,
         new InternetAddress(toEmail));
        message.setSubject ("Subject : ");
        message.setText(
         "This is a confirmation receipt.");
        Multipart multipart = new MimeMultipart();
        messageBodyPart.setDataHandler(new DataHandler(source));
        messageBodyPart.setHeader("Content-Type", "application/pdf");
        messageBodyPart.setFileName(filename);
        multipart.addBodyPart(messageBodyPart);
        message.setContent(multipart);
        Transport transport = session.getTransport("smtp");
        transport.connect(host, "username", "password");
        transport.sendMessage(message, message.getAllRecipients());
        transport.close();  
        flag = true;
        //delete file if you want to here
        file.delete();
       } catch (FileNotFoundException e) {
        flag = false;
        wdComponentAPI.getMessageManager().reportException(
         "FileNotFoundException : " + e.getMessage(),
         false);
       } catch (IOException e) {
        flag = false;
        wdComponentAPI.getMessageManager ().reportException(
         "IOException : " + e.getMessage(),
         false);
       } catch (MessagingException e) {
        flag = false;
        wdComponentAPI.getMessageManager().reportException(
         "MessagingException : " + e.getMessage(),
         false);
       return flag;
        //@@end
    thanks,
    Sanketh

  • How to export pdf using jsp

    hai friends
    i know to export excel using jsp
    but tried the same process to pdf, it s not work..
    please give some solution......
    thanks
    rex

    It's working absolutely fine for me. I suspect the problem is one of these two:
    1. You're giving the incorrect path of the file. Check the size of the downloaded file, it's probably 0 bytes.
    2. Check the file that has been created on the server first; is that fine? That could also be the origin of the problem.
    This is th code I've used. I copied an existing PDF to my webapps root folder ( $CATALINA_HOME/webapps/myApp/test.pdf ) and hardcoded the values of filename to check it and it works for me.
    BufferedOutputStream out = new BufferedOutputStream( resp.getOutputStream());
    try
        filename = "test.pdf";
        resp.setContentType("application/pdf");//vnd.ms-excel" );
       resp.setHeader("Content-disposition","attachment; filename=\"" + filename + "\"" );
        BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(getServletContext().getRealPath("/") + filename));
        int i;
        while ((i=bufferedInputStream.read()) != -1)
         out.write(i);
        bufferedInputStream.close();
      out.flush();
       out.close();
    catch ( Exception e )
         System.out.println(e);
    }

Maybe you are looking for

  • Photos do not show up in iPhoto yet still in user/pics/iPhoto Library. Why?

    I opened iPhoto 6.0.3 today only to find it void of all my pictures and of any sourcer folders I created for each year pictures were taken. However, all my pics are still in user/pictures/iPhoto Library along with all the Data folder, created folders

  • Follow up customer

    Dear friends, I don't know whether the system has any functions that allow to follow up one customer when she is pregnant until she has baby and her babies. Because I have customers they want to keep track all data relevant their customers in long te

  • SSL Passphrases with Nginx and Systemd

    I'm currently looking to migrate one of my systems to Arch Linux with Nginx powering my web stack. For my site I use a wildcard SSL certificate for communication, and of course my SSL key is passphrased. While finishing up the last things on the syst

  • Error when trying to connect to I-tunes

    Our computer crashed. It has now been fixed. I can no longer connect to I-tunes. My computer shows an error report everytime I click the icon. I have deleted and restored the CD program my I-pod came with. I have also downloaded the software from the

  • I need to hire a replacement computer. How can I download and install my CS6 software again?

    I need to hire a replacement computer. How can I download and install my CS6 software again?