Jump to content
We've recently updated our Privacy Statement, available here ×

Inserting HTML table


deusamalka

Recommended Posts

Hi, everybody. I've looked for this information in google, in this forum. Unfortunaly, I wasn't able to find it :(

 

I need to put a table dinamically in a JasperReport. This table will probably be written in HTML.

 

Explaing better: each product in has a name, a table and a picture. So, when I select the product to populate a detail in JasperReport, I expect it to show its name, its picture AND its table.

 

No, the table does not need to be in HTML, is there any other objects (beside numbers and string) that could be used?

 

I do not need a Subreport because the table is static, i.e. IT SHOULD NEVER CHANGE to the same product.

 

I would like to have a PDF report. I've seen the HTML tag 'font' is allowed when 'Is Styled Text?' is set to 'true', but HTML tag 'table' didn't work the same way.

 

Is that possible?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Suggest you create a subreport per product sized appropriately with the table layed out in the sub report.

 

If you name the sub report file correctly you can dynamically link in the sub report with the product into your main report.

Use a sub report file name that includes the product name (say there were products fishing_rod, bicycle, etclike fishing_rod_1_table.jrxml then include the sub report in the main report using a report definition like :

$P{SUB_REPORT_PATH} + $F{productName} + "_table.jasper

 

NOTE: This assumes your product name is retrieved from an SQL statement in the main report but this might give you the starting point. You could equally add other fields into the name of the file to uniquely identify the products "table" sub report such as product code etc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...