Jump to content
JasperReports Library 7.0 is now available ×

How do you set the title for an HTML report?


toltsch

Recommended Posts

Hi All,

 

I think this should be an easy question. But I cannot find how to set the title for an HTML report.

 

I'm using JRHtmlExporter to render the report. My report does not have a title which causes a problem in IE and the report is not displayed.

 

Here is my code:

 

...

inputType = ((String) objParms[0]).trim();

reportFileName = ((String) objParms[1]).trim();

xmlDocument = (Document) objParms[2];

HashMap formParms = (HashMap) objParms[3];

 

 

reportFileName = FormTypeMappingCache.getInstance().getMapping(reportFileName,formParms);

formParms.put("JASPER_FILE_PATH",JASPER_REPORTS_FOLDER);

 

if (inputType.equalsIgnoreCase("xml"))

{

recordPath = RecordPathMappingCache.getInstance().getMapping(reportFileName);

CWXmlDataSource jrxmlds = new CWXmlDataSource(xmlDocument,recordPath);

 

 

print = JasperFillManager.fillReport(

JASPER_REPORTS_FOLDER+reportFileName+".jasper",

formParms,

jrxmlds);

 

}

 

JRHtmlExporter exporter = new JRHtmlExporter();

 

exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);

exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);

 

exporter.exportReport();

...

 

Here is my HTML output:

 

<html>

<head>

<title/>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<style type="text/css">

a {text-decoration: none}

</style>

</head>

<body text="#000000" link="#000000" alink="#000000" vlink="#000000">

<table width="100%" cellpadding="0" cellspacing="0" border="0">

<tr><td width="50%"> </td><td align="center">

 

<a name="JR_PAGE_ANCHOR_0_1"/>

<table style="width: 792px" cellpadding="0" cellspacing="0" border="0" bgcolor="white">

<tr>

<td><img src="nullpx" style="width: 37px; height: 1px"/></td>

<td><img src="nullpx" style="width: 122px; height: 1px"/></td>

<td><img src="nullpx" style="width: 52px; height: 1px"/></td>

<td><img src="nullpx" style="width: 581px; height: 1px"/></td>

</tr>

<tr valign="top">

<td colspan="4"><img src="nullpx" style="width: 792px; height: 25px"/></td>

</tr>

<tr valign="top">

<td><img src="nullpx" style="width: 37px; height: 16px"/></td>

<td><span style="font-family: sansserif; font-size: 10.0px;">PO Number:</span></td>

<td colspan="2"><img src="nullpx" style="width: 633px; height: 16px"/></td>

</tr>

<tr valign="top">

<td colspan="4"><img src="nullpx" style="width: 792px; height: 9px"/></td>

</tr>

<tr valign="top">

<td><img src="nullpx" style="width: 37px; height: 18px"/></td>

<td colspan="2"><span style="font-family: sansserif; font-size: 10.0px;">0001706</span></td>

<td><img src="nullpx" style="width: 581px; height: 18px"/></td>

</tr>

<tr valign="top">

<td colspan="4"><img src="nullpx" style="width: 792px; height: 544px"/></td>

</tr>

</table>

 

</td><td width="50%"> </td></tr>

</table>

</body>

</html>

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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