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

HTML contents view in PDF Report


icdlismail

Recommended Posts

Dear All,

I am facing a problem while creating pdf report from html contents. I am using java bean as a datasource. More specifically, My Java bean contains html formated text as String property. After run this report, it will show html code in Jasper Viewer/PDF Viewer.

I am new in Jasper report. I don't know how to parse it as like JEditorpane/ JTextPane do. Please help me in this issue.

Thank you
Ismail
====-

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

Put the HTML content inside a text field that has markup="html". Check the /demo/samples/markup sample provided with the JR project package.

But note we are talking only about formatted text, not about layout or images.

If you want complex HTML, then you would have to write a custom component of your own to achieve this.

 

I hope this helps.

Teodor

 

Link to comment
Share on other sites

Dear Mr. Teodor

Many thanks for your help. I have tried as per your suggesstion. It's works only  for simple HTML Text. But , I am using Table as a html contents. Please help me, how can i  write custom components as you suggested . I am new to Jasper Report.. If you have any resource/ example, please give me so that I can study accordingly .

 

Thank you,

Ismail

=====

Link to comment
Share on other sites

Hi,

 

As I said, the markup text fields only deal with formatted text and not layout. HTML tables are about layout. They have cells, borders, etc.

 

I have created a tracker for this feature here:

http://jasperforge.org/projects/jasperreports/tracker/view.php?id=4256

 

Several people have expressed interest in working on such a new feature, so posting comments on this tracker would help you get in touch and make it happen.

 

Thank you,

Teodor

 

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