Generate PDF report with HTML data

Hi All,
I am using BI Publisher to generate my reports but I stumbled on a big problem...
I have a table with a column TASK_DESCRIPTION. This column is a CLOB containing a simple HTML coded page. When a user works with the application he sees a nicely formatted page but when I generate a report I get all the html tags in it (< html > < h4 > ...etc...)
Is it possible to somehow convert the source data from the table (which is html code) into readable formatted text when generating the report?
ANY ideas are very welcome!
Regards,
Pawel.

Yes you can do this with an XSL template converting HTML to Formatting objects.
There are a few catches however. First, you must be sure your markup-fragment is valid XHTML, that is all tags must be closed. Luckily the builtin standard HTML-editor does this.
I wasn't able to call BI-publisher from within Apex without the XHTML-fragment being escaped, but i managed to create a query on a table containing the fragment within BI-publisher itself. This leaves the fragment intact, producing a valid XML-document.
This is very important because the XSL attached to the RTF-template must be able to match and convert the XHTML-tags to FO.
Basic setup :
Create a datasource (query) within BIP.
Create the RTF-template and add an extra field (at the top) containing : <?import:file:///C:\xhtml-to-xslfo.xsl?> or whatever location the XSL-file resides.
Now, layout your report using the wizard and change the field containing the XHTML-fragment into <xsl:apply-templates select="TASK_DESRIPTION"/>
There are a few XSL-templates out there converting XHTML to FO. One I found particularly useful : http://www.ibm.com/developerworks/library/x-xslfo2app/xhtml-to-xslfo.xsl
You might want to change the .xsl so it matches tags case insensitive (eg. <xsl:template match="a|A"> )
Another caveat is the html-entities for special characters. When the XML from the datasource is parsed by BIP it doesn't recognise entities like &Agrave ; .
This can be solved by creating a pl/sql function converting these characters to numeric entities like &#192 ;. and use this function in the select statement of your datasource. see http://www.w3schools.com/tags/ref_entities.asp
Now you can call the report from Apex using an URL to the report definiton (see BIP docs for URL syntax and parameter passing)
Not a 'really' integrated solution but I had some nice results.
It would be nice though if we could specify a .dtd containing the references for HTML-entities and a sort of flag wheter the report column should be escaped or not, from within Apex. This would allow us to embed XML-fragments within the XML that Apex produces, resulting in a valid XML doc. Using XSL, you can then match the tags of the XML-fragment and convert it to FO.
Good luck !
Maarten

Similar Messages

  • Writing a java program for generating .pdf file with the data of MS-Excel .

    Hi all,
    My object is write a java program so tht...it'll generate the .pdf file after retriving the data from MS-Excel file.
    I used POI HSSF to read the data from MS-Excel and used iText to generate .pdf file:
    My Program is:
    * Created on Apr 13, 2005
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    package forums;
    import java.io.*;
    import java.awt.Color;
    import com.lowagie.text.*;
    import com.lowagie.text.pdf.*;
    import com.lowagie.text.Font.*;
    import com.lowagie.text.pdf.MultiColumnText;
    import com.lowagie.text.Phrase.*;
    import net.sf.hibernate.mapping.Array;
    import org.apache.poi.hssf.*;
    import org.apache.poi.poifs.filesystem.*;
    import org.apache.poi.hssf.usermodel.*;
    import com.lowagie.text.Phrase.*;
    import java.util.Iterator;
    * Generates a simple 'Hello World' PDF file.
    * @author blowagie
    public class pdfgenerator {
         * Generates a PDF file with the text 'Hello World'
         * @param args no arguments needed here
         public static void main(String[] args) {
              System.out.println("Hello World");
              Rectangle pageSize = new Rectangle(916, 1592);
                        pageSize.setBackgroundColor(new java.awt.Color(0xFF, 0xFF, 0xDE));
              // step 1: creation of a document-object
              //Document document = new Document(pageSize);
              Document document = new Document(pageSize, 132, 164, 108, 108);
              try {
                   // step 2:
                   // we create a writer that listens to the document
                   // and directs a PDF-stream to a file
                   PdfWriter writer =PdfWriter.getInstance(document,new FileOutputStream("c:\\weeklystatus.pdf"));
                   writer.setEncryption(PdfWriter.STRENGTH128BITS, "Hello", "World", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);
    //               step 3: we open the document
                             document.open();
                   Paragraph paragraph = new Paragraph("",new Font(Font.TIMES_ROMAN, 13, Font.BOLDITALIC, new Color(0, 0, 255)));
                   POIFSFileSystem pofilesystem=new POIFSFileSystem(new FileInputStream("D:\\ESM\\plans\\weekly report(31-01..04-02).xls"));
                   HSSFWorkbook hbook=new HSSFWorkbook(pofilesystem);
                   HSSFSheet hsheet=hbook.getSheetAt(0);//.createSheet();
                   Iterator rows = hsheet.rowIterator();
                                  while( rows.hasNext() ) {
                                       Phrase phrase=new Phrase();
                                       HSSFRow row = (HSSFRow) rows.next();
                                       //System.out.println( "Row #" + row.getRowNum());
                                       // Iterate over each cell in the row and print out the cell's content
                                       Iterator cells = row.cellIterator();
                                       while( cells.hasNext() ) {
                                            HSSFCell cell = (HSSFCell) cells.next();
                                            //System.out.println( "Cell #" + cell.getCellNum() );
                                            switch ( cell.getCellType() ) {
                                                 case HSSFCell.CELL_TYPE_STRING:
                                                 String stringcell=cell.getStringCellValue ()+" ";
                                                 writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                 phrase.add(stringcell);
                                            // document.add(new Phrase(string));
                                                      System.out.print( cell.getStringCellValue () );
                                                      break;
                                                 case HSSFCell.CELL_TYPE_FORMULA:
                                                           String stringdate=cell.getCellFormula()+" ";
                                                           writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                           phrase.add(stringdate);
                                                 System.out.print( cell.getCellFormula() );
                                                           break;
                                                 case HSSFCell.CELL_TYPE_NUMERIC:
                                                 String string=String.valueOf(cell.getNumericCellValue())+" ";
                                                      writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                      phrase.add(string);
                                                      System.out.print( cell.getNumericCellValue() );
                                                      break;
                                                 default:
                                                      //System.out.println( "unsuported sell type" );
                                                      break;
                                       document.add(new Paragraph(phrase));
                                       document.add(new Paragraph("\n \n \n"));
                   // step 4: we add a paragraph to the document
              } catch (DocumentException de) {
                   System.err.println(de.getMessage());
              } catch (IOException ioe) {
                   System.err.println(ioe.getMessage());
              // step 5: we close the document
              document.close();
    My Input from MS-Excel file is:
         Planning and Tracking Template for Interns                                                                 
         Name of the Intern     N.Kesavulu Reddy                                                            
         Project Name     Enterprise Sales and Marketing                                                            
         Description     Estimated Effort in Hrs     Planned/Replanned          Actual          Actual Effort in Hrs     Complexity     Priority     LOC written new & modified     % work completion     Status     Rework     Remarks
    S.No               Start Date     End Date     Start Date     End Date                                        
    1     setup the configuration          31/01/2005     1/2/2005     31/01/2005     1/2/2005                                        
    2     Deploying an application through Tapestry, Spring, Hibernate          2/2/2005     2/2/2005     2/2/2005     2/2/2005                                        
    3     Gone through Componentization and Cxprice application          3/2/2005     3/2/2005     3/2/2005     3/2/2005                                        
    4     Attend the sessions(tapestry,spring, hibernate), QBA          4/2/2005     4/2/2005     4/2/2005     4/2/2005                                        
         The o/p I'm gettint in .pdf file is:
    Planning and Tracking Template for Interns
    N.Kesavulu Reddy Name of the Intern
    Enterprise Sales and Marketing Project Name
    Remarks Rework Status % work completion LOC written new & modified Priority
    Complexity Actual Effort in Hrs Actual Planned/Replanned Estimated Effort in Hrs Description
    End Date Start Date End Date Start Date S.No
    38354.0 31/01/2005 38354.0 31/01/2005 setup the configuration 1.0
    38385.0 38385.0 38385.0 38385.0 Deploying an application through Tapestry, Spring, Hibernate
    2.0
    38413.0 38413.0 38413.0 38413.0 Gone through Componentization and Cxprice application
    3.0
    38444.0 38444.0 38444.0 38444.0 Attend the sessions(tapestry,spring, hibernate), QBA 4.0
                                       The issues i'm facing are:
    When it is reading a row from MS-Excel it is writing to the .pdf file from last cell to first cell.( 2 cell in 1 place, 1 cell in 2 place like if the row has two cells with data as : Name of the Intern: Kesavulu Reddy then it is writing to the .pdf file as Kesavulu Reddy Name of Intern)
    and the second issue is:
    It is not recognizing the date format..it is recognizing the date in first row only......
    Plz Tell me wht is the solution for this...
    Regards
    [email protected]

    Don't double post your question:
    http://forum.java.sun.com/thread.jspa?threadID=617605&messageID=3450899#3450899
    /Kaj

  • How to generate complex reports with JHeadStart?

    I have data from a DataSourceSet process in the infoTable (I use BC4J 9.0.3.10.7, JHeadStart 9.0.3.58, Oracle MVC R.Candidate 2.0, UIX 2.1.9).I need to generate a report with this data in a UIX Table. Actually, I show the data as retrieved from the ViewObject(Whole query in a table). One of the columns has Numbers and I add them at the bottom row with a GetTotalsRow process.
    Now I need to have subtotals in the same table as if I do a GROUP BY but without modifying the query (I have to do this using data stored in infoTable). I also have to add complex calculations for each row.
    Any idea?
    PD: I'm thinking in reading data from infoTable and in a custom process create DataObjectList with all details.
    is it a good approach?
    is there something better?

    Ariel,
    I think I already answered this question on the internal mailing list. Is this correct?
    If you are an Oracle employee, please use the internal mailing list.
    Thanks,
    Steven Davelaar.
    JHeadstart team.

  • Generate a new pdf report with itens on my pdf form

    Hi! My name is Heitor.
    I have Adobe Forms Central and Adobe Acrobat XI Pro installed on my machine.
    I would like to know if its possible to make a pdf report.
    Example: Clicking in a button "print" on my already open and filled pdf form, and gathering all my 30 itens (see that i am only showing 5 itens on my form. but on my form exists a "Add" button to add itens on variables) on a dropdown list and generating a new pdf report with all these itens listed.
    Thanks!
    Heitor Teixeira
    www.heitorteixeira.com

    Hi! My name is Heitor.
    I have Adobe Forms Central and Adobe Acrobat XI Pro installed on my machine.
    I would like to know if its possible to make a pdf report.
    Example: Clicking in a button "print" on my already open and filled pdf form, and gathering all my 30 itens (see that i am only showing 5 itens on my form. but on my form exists a "Add" button to add itens on variables) on a dropdown list and generating a new pdf report with all these itens listed.
    Thanks!
    Heitor Teixeira
    www.heitorteixeira.com

  • Unable to generate Pdf report for crystal 9/10  in Windows 2012 (Standard) server with Times New Roman font. With same font, report getting generated in excel, text, csv format in Windows 2012.

    For Times New Roman font in Windows server 2012 R2 (Standard), crystal 9/10 report in pdf format is not getting generated. When we change the font for specific report like Arial, Calibri , Cambria then pdf report getting created.
    In Windows 2008 R2, same application worked fine to generate pdf report for TimesNewRoman font and there is no change done in the application which is being used in Windows 2012 R2 server.

    Ok, thanks for the reply. You need to contact support or a forum for the Crystal software. Third party products don't usually include Adobe technology, they have their own software. When you contact them, you may want to expand "unable to generate" to give any specific symptoms including any error messages.

  • How to generate PDF report directly instead of RPT report by using JRC ?

    Hi,
    Good Day !
    How to generate PDF report directly instead of RPT report by using Crystal Reports XI Release 2 Java Reporting Component (JRC) in desktop (Swing thick-client) ?
    My GUI program will generate a RPT report, then i can export to PDF file, this is ok, no problem.
    BUT
    i want it direct to generate a PDF report, not a RPT report.
    The code like below (2 java files)
    ClassA.java
    ReportClientDocument reportClientDoc = new ReportClientDocument();
    reportClientDoc.open(XXX, 0);  
    ParameterFieldController paramFieldController = reportClientDoc.getDataDefController().getParameterFieldController();
    paramFieldController.setCurrentValue("", "XXX", DomainClass.getXXX());        
    new ReportViewerFrame(reportClientDoc);
    // End of ClassA.java
    // Begin ReportViewerFrame.java
    public class ReportViewerFrame extends JFrame
           //Initial window frame properties.
         private final int XPOS = 80;
         private final int YPOS = 60;
         private final int WIDTH = 760;
         private final int HEIGHT = 550;
         private ReportViewerBean reportViewer = new ReportViewerBean();     
         private ReportClientDocument reportClientDoc = new ReportClientDocument();     
         public ReportViewerFrame(ReportClientDocument reportClientDoc) throws    Exception
              //Initialize frame properties.
              this.setResizable(true);
              this.setLocation(XPOS, YPOS);
              this.setSize(WIDTH, HEIGHT);
              this.setTitle("Crystal Report Java Viewer");
              //Add GUI components to the frame including the ReportViewerBean.
              addComponents();
              //Add GUI listeners to the frame.
              addListeners();
              //Set the report that the ReportViewerBean will display.
              this.reportClientDoc = reportClientDoc;
              reportViewer.setReportSource(reportClientDoc.getReportSource());     
              reportViewer.init();
              reportViewer.start();
              //Display the frame.
              this.setVisible(true);     
    How to set the export option to PDF base on existing code ?
    Where can i download this package/jar ?
    regards

    Please find a console app that you can extend it to a JFrame app by importing the relevant swing package:
    //Crystal Java Reporting Component (JRC) imports.
    import com.crystaldecisions.reports.sdk.*;
    import com.crystaldecisions.sdk.occa.report.lib.*;
    import com.crystaldecisions.sdk.occa.report.exportoptions.*;
    //Java imports.
    import java.io.*;
    public class ExportReport {
         static final String REPORT_NAME = "ExportReport.rpt";
         static final String EXPORT_FILE = "C:\\myExportedReport.pdf";
         public static void main(String[] args) {
              try {
                   //Open report.               
                   ReportClientDocument reportClientDoc = new ReportClientDocument();               
                   reportClientDoc.open(REPORT_NAME, 0);
                   //NOTE: If parameters or database login credentials are required, they need to be set before.
                   //calling the export() method of the PrintOutputController.
                   //Export report and obtain an input stream that can be written to disk.
                   //See the Java Reporting Component Developer's Guide for more information on the supported export format enumerations
                   //possible with the JRC.
                   ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
                   //Release report.
                   reportClientDoc.close();
                   //Use the Java I/O libraries to write the exported content to the file system.
                   byte byteArray[] = new byte[byteArrayInputStream.available()];
                   //Create a new file that will contain the exported result.
                   File file = new File(EXPORT_FILE);
                   FileOutputStream fileOutputStream = new FileOutputStream(file);
                   ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(byteArrayInputStream.available());
                   int x = byteArrayInputStream.read(byteArray, 0, byteArrayInputStream.available());
                   byteArrayOutputStream.write(byteArray, 0, x);
                   byteArrayOutputStream.writeTo(fileOutputStream);
                   //Close streams.
                   byteArrayInputStream.close();
                   byteArrayOutputStream.close();
                   fileOutputStream.close();
                   System.out.println("Successfully exported report to " + EXPORT_FILE);
              catch(ReportSDKException ex) {
                   ex.printStackTrace();
              catch(Exception ex) {
                   ex.printStackTrace();
    As to the relevant jar(s) deployment refer to this link (Java Reporting Component Configuration):
    http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/JRC_SDK/jrc_java_dg_doc/doc/jrcsdk_java_dg/WorkingWithJRC2.html#1004391
    Cheers

  • How to generate my report in HTML format

    Hi
    I am using Forms and reports 6i . How to generate a report in Html format.
    Please explain what are the option available in reports and the way to do
    thanks in advance
    prasanth a.s.

    *specify  desformat=html  in cmd line
    refer
    * Forms Reports integration 6i
    http://otn.oracle.com/products/forms/pdf/277282.pdf
    [    All Docs for all versions    ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
    ---------------------------------------------------------------------------------

  • Generation PDF Report with Graph 6i

    Hello all of u,
    I have a problem to Generate 6i report with pie Graph in PDF format ,,
    Report run well and at the bottom show the pie graph with different color
    But when I Generate a PDF file, graph did not show and only back circle show
    What is the problem with the oracle graph and why color did not shown?
    Please help me
    Thanks to all

    Hi Julie,
    Sorry my english.
    I will try to explain in more details the problem.
    I have identified that the bar code name into the PDF output is lowercase (mw6code39mt).
    I only visualize or print the PDF output with the bar code when I manually alter that bar code name from lowercase to uppercase (MW6Code39MT).
    I do that in my Unix server using the vi editor.
    Please, see what I need to alter in the PDF output file on Unix server:
    <</Type /Font
    /Name /F1
    /Subtype /Type1
    /Encoding /WinAnsiEncoding
    /BaseFont /mw6code39mt ====> alter to MW6Code39MT
    /FirstChar 24
    /LastChar 255
    /Widths 9 0 R
    /FontDescriptor 10 0 R
    >>
    endobj
    Thank you.
    Edson

  • PDF Report with MS word document attchments in Shared Drive

    Hello,
    I need PDF report with attachments. the attachments ( could be image , word document) are stored in a shared drive made accessible from apps server.
    Please let me know if this is doable using xml publisher and what is the approach.
    thanks
    Arun

    Check this out
    http://blogs.oracle.com/xmlpublisher/2008/07/file_attachments.html
    Tim

  • How can we generate a report in master data?

    hi,
    can we generate a report in master data,if yes pl give me the procedure, i am un able to get it.
    thanks & regards
    venkat

    Hi,
    Once we make the MAster infoobject as the data target, then we can create the report on the master data. to make the IO as Data target , you just need to mention the tick mark for<i> Infoprovide</i> check box  in the <i>MAster data /Texts</i> tab page of the IO.
    help says that:
    <i>InfoProvider:
    This indicator specifies whether the characteristic is an InfoProvider.
    If you want to use a characteristic as an InfoProvider, you have to assign an InfoArea to the characteristic. The system displays the characteristic in the InfoProvider tree in the Data Warehousing Workbench. You can use the characteristic as an InfoProvider in reporting and analysis.
    You can only use a characteristic as an InfoProvider if the characteristic contains texts or attributes.
    You can define queries for the characteristic (more precisely, for the master data of the characteristic) if you are using a characteristic as an InfoProvider. In this case, on the Attributes tabstrip, you are able to switch-on dual-level navigation attributes (navigation attributes for navigation attributes) for this characteristic in its role as InfoProvider.</i>
    With rgds,
    Anil kumar Sharma .P
    IBM-India.

  • Get Windows message "Terminate 5-1" after printing pdf reports with Orarrp

    Hi,
    I get error message "Terminate 5-1" on clients machine after pdf report is printed with Orarrp.
    The clients is Windows XP with acrobat reader 5.
    I test on acrobat reader 6 and get the same result.
    This occur for all pdf reports and all clients.
    However this message just shows when perform printing, if I cancel printing from print dialog box then this message does not show.
    How can I avoid this message?
    Thanks in advance
    Tawatchai R.
    ===================
    Hi,
    I have same error message(Message Title: TerminateProcess Value; Message Body: 5-1) showing up when using Orarrp to print directly to printer on WEB using Oracle Forms. On my pc it shows when I have adobe acrobat reader opened up already and on others it may shows even if adobe acrobat is not already opened. However document gets printed but this is very annoying for the user to see this message.
    Client Environments:
    1. Windows XP, HP LaserJet 5P and HP LaserJet 4100 Series PCL, Adobe Acrobat 6.0
    2. Windows 2000 Professional, HP LaserJet 4000 Series PCL, Adobe Acrobat 5.0 and 6.0
    Thanks
    Kulwinder Sidhu

    Hi Kulwinder,
    We are getting this problem whenever we go through the following steps:
    - Generate a PDF report without an ORARRP file extension on a dedicated reports server. Preview the report by opening in Adobe Reader using WEB.SHOW_DOCUMENT.
    - Generate a PDF report with a ORARRP file extension of rrpa on a dedicated reports server. Directly print the report without a print dialog box using WEB.SHOW_DOCUMENT to invoke ORARRP.
    After printing the Terminate Process 5-1 message appears and Adobe is left running. If the first step is missed out then printing occurs without error and Adobe closes automatically.
    Please could you give more information on how you solved the problem. I am using Windows XP and Adobe 7.
    Thanks,
    Pete

  • How to create a report with survey data

    Hi All,
    I need to create a report with survey data in below format. Can anyone help me how to display the summary in this format.
    Swapna

    Hi Swapna,
    According to your description, you want to create a report with survey data and display the summary.
    Reporting Services is used for rendering the report with data retrieved from datasource. In Reporting Services, we can retrieve data from the datasource then design a report, after the report processed, data is fixed on the report. So it’s not supported
    to have the end users selection and do summary. For your requirement, it’s can’t be achieved currently.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra positi

    While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra position and also pdf generated from this word file also contains the same.

  • Billing report with due date field

    Dear Friends,
    Can you please tell the logic of Billing report with due date field.
    Input.  billing document no, date range, sales organisation
    Output : billing document no, sales organisation, Amount. Due date.
    If any clarification required, Please let me know.
    Thanks in advance
    Ranjan

    Is it VF05 is suffiant for your purpose?
    use further selection criteria tab.
    Amit.

  • How to call PDF Report with parameters in jdeveloper 10.1.3

    Hi all,
    how to call PDF Report with parameters in jdeveloper 10.1.3
    for example I have Report name is repdept.pdf with parameter as deptno
    and I want call this Report from JSP page ?
    thanks
    frank

    Hi all,
    how to call PDF Report with parameters in jdeveloper 10.1.3
    for example I have Report name is repdept.pdf with parameter as deptno
    and I want call this Report from JSP page ?
    thanks
    frank

Maybe you are looking for