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

Is it possible to import styled html in report


landin

Recommended Posts

Hi
I'm building a report that retrieves html data from Database, the report is filled succesfully, but there are a lot of html tags that can not be rendered properly.

I followed example for markup=html, but i want to know if this feature is possible or what kind of constraints or tags are not supported when an embedded html data is being attached to a jasper report?

There is an attached html sample that I'm using

Regards
Post edited by: landin, at: 2008/04/24 20:03

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

I am not sure I understand what you are trying to do. However the only time I have used HTML in a JasperReport I have used it in a static text field with the "Is Styled Text" flag set.

 

In the sample reports that ship with JR I found a report that lists the supported tags. This is as of 2.0.1, not sure if the list of tags has increased:

<font size="12"><font size="12"></font>

<font color="red"><font color="red"></font>

<font face="Comic Sans MS"><font face="Comic Sans MS"></font>

<b>bold <b></b> <i>italic <i></i> <u>underlined <u></u>

an empty line follows (<br/>):

<br/>

<sup><sup></sup> and <sub><sub></sub>

<br/>

A bulleted list:

<li>item 1 <li></li>

Link to comment
Share on other sites

Hi,

 

A text field with HTML markup will render only formatted characters. All tags that represent layout will not work. So it is only about font, color, font style, or anything else that has to do with formatted text. But nothing such as tables or divs or whatever that represent layout will work.

You should understand that we are talking about a "text field" displaying styled text, not about a HTML browser component that allows you to embed complex HTML into the report.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • 10 months later...

I'm using version 3.1.3 and cannot find the proper setting to display tags properly.

We have a large text field where users will enter paragraphs of text. They would also like to do bold, underline, etc.

For instance a sample follows:

 

This is paragraph one. It is quite short.

This is paragraph two. it is much longer and will wrap if the display box is long enough. This is just more more more more more stuff to make it break lines on my browser. this next part is bold

 

I'm sure you get the idea. When I display this as a text field, i get a
tag displaying between the first and second paragraphs and the bold tags just show as text. I saw some references to a 'styled text' attribute in postings from a few years ago, but i don't see anything like that now. How do i make this work? the field definition is below in the code block

The isPdfEmbedded tag is leftover from experimenting with this value. Either way, i still get instead of bold text and
tags for new lines.

Code:
Link to comment
Share on other sites

  • 1 month later...

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...