Jump to content
Changes to the Jaspersoft community edition download ×

Html Title Problem


Recommended Posts

By: Adeel - revenger55

Html Title Problem

2006-05-10 04:43

i have generated report through ireport in html format but it displays nothing. when i view its source file the <title> tag is displayed as <title/> which is wrong and it has not starting tag or ending tag. when i edit the source and correct the <title> tag according to html syntax it displays the report correctly. can anyone guide me about this problem how to solve it thanx in advance

 

 

 

 

By: Lucian Chirita - lucianc

RE: Html Title Problem

2006-05-10 04:59

There are a couple of threads regarding this issue on the forum/mailing list. See the following posts:

https://sourceforge.net/forum/message.php?msg_id=3711741

https://sourceforge.net/mailarchive/forum.php?thread_id=10296366&forum_id=7912

 

Regards,

Lucian

 

 

 

 

By: karibouxe - karibouxe

RE: Html Title Problem

2006-05-11 06:12

Sorry, i didn't find the good topic.

Thank a lot Lucian

Link to comment
Share on other sites

  • 1 year later...
  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

I am running into this issue as well, and the links provided did not include information on how to resolve.

 

Any tips on how to set the JasperReport jrxml file to input some text into the title tag, when the report is exported to html format?

 

Such that the html source would have a section like this:

 

<title>My Report Name</title>

 

Thanks in advance!

Link to comment
Share on other sites

Thanks for your reply!

 

I have tried setting the html_header parameter and found that it adds the text into the header of the report, which is close, but not exactly what I'm searching for.

 

I'm looking for a feature that will populate the <title> tag, which would result in the text showing at the top of the browser window, much like this text: "JasperForge - Re:Html Title Problem - JasperForge.org Forum", shows for this forum topic.

Link to comment
Share on other sites

Try this:

Code:

String title = "My HTML title";
StringWriter headerWriter = new StringWriter();
headerWriter.write("<html>n"«»);
headerWriter.write("<head>n"«»);
headerWriter.write(" <title>" + title + "</title>n"«»);
headerWriter.write(" <meta http-equiv="Content-Type" content="text/html; charset=" + encoding + ""/>n"«»);
headerWriter.write(" <style type="text/css">n"«»);
headerWriter.write(" a {text-decoration: none}n"«»);
headerWriter.write(" </style>n"«»);
headerWriter.write("</head>n"«»);
headerWriter.write("<body text="#000000" link="#000000" alink="#000000" vlink="#000000">n"«»);
headerWriter.write("<table width="100%" cellpadding="0" cellspacing="0" border="0">n"«»);
headerWriter.write("<tr><td width="50%"> </td><td align="center">n"«»);
headerWriter.write("n"«»);

htmlExporter.setParameter(JRHtmlExporterParameter.HTML_HEADER, headerWriter.toString());

 

HTH,

Lucian

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