Search code examples
crystal-reportsjasper-reportsbirt

Can birt support reading html tables from database and displaying them dynamically to a pdf report file?


I have come across a scenario where I have to read html data from database and display it in pdf reports. This html data also contains table structure <table></table> tags and other html element inside it. Previously we used jasper reports for our reporting needs but recently as we came to know that the above functionality is not supported in jasper, I wanted to know which reporting tool can be used so that it can be incorporated with servoy. Does birt provide this functionality?


Solution

  • Yes, BIRT has a text element where we can set the display type to HTML. If the html table is in a dataset field you will just have to include it in the expression of the text using "value-of" tag, something like this:

    <VALUE-OF format="HTML">row["htmlTableField"]</VALUE-OF>
    

    PDF format is taking such html elements into account, including most of simple style settings such background color, text-align, borders etc.

    enter image description here