Overflow not working in BIRT runtime engine [message #658309] |
Mon, 07 March 2011 14:43  |
Eclipse User |
|
|
|
In BIRT 2.6.2 I'm having problems getting the overflow=visible property for table cells to work properly. In the report designer, I set the cell properties whiteSpace=nowrap and overflow=visibile. The XML in the report design for my test table header row is:
<header>
<row id="8">
<cell id="9">
<property name="whiteSpace">nowrap</property>
<property name="overflow">visible</property>
<label id="23">
<property name="display">block</property>
<text-property name="text">Now is the time for all good men to come to the aid of their party.</text-property>
</label>
</cell>
<cell id="10"/>
<cell id="11"/>
</row>
</header>
My test table has three columns. In the header row, column 1 contains a long string and columns 2 and 3 are empty. I want the long string to overflow the right margin of column 1 into columns 2 and 3.
In the report designer, the string overflows properly in "View Report in Web Viewer" and "View Report as HTML". In "View Report as PDF" the string is truncated at the right margin of column 1.
When this report design is used in my web server with the BIRT runtime engine, the string is truncated with both the HTML and PDF output formats. With the HTML output format the following HTML is generated for the header row:
<tr valign="top" align="left">
<th class="style_1" style=" overflow:hidden;font-weight: normal;">
<div id="AUTOGENBOOKMARK_1">Now is the time for all good men to come to the aid of their party.</div>
</th>
<th style=" overflow:hidden;font-weight: normal;"></th>
<th style=" overflow:hidden;font-weight: normal;"></th>
</tr>
Note that the runtime engine has generated the style "overflow:hidden" for the first 'th' element, when I wanted it to generate "overflow:visible".
For now, in my web app, I have fixed the problem with the HTML by doing a global replace of "overflow:hidden" by "overflow:visibible" in the HTML returned by the BIRT engine. This is a hack, and I don't have an equivalent one for PDF output.
Is this a bug in BIRT, or have I overlooked something? Has anyone else noticed this problem?
John Norstad
|
|
|
|
|
Re: Overflow not working in BIRT runtime engine [message #658744 is a reply to message #658620] |
Wed, 09 March 2011 11:17   |
Eclipse User |
|
|
|
John,
Please try adding options.setEnableAgentStyleEngine(true); for the HTML
option.
Jason
On 3/9/2011 4:58 AM, John Norstad wrote:
> Jason asked:
>
> Quote:
>> Can you post what options you are setting for the HTMLRenderOption
>> instance? Are you setting renderOption.setEnableAgentStyleEngine(false);
>
>
> No, I'm not calling renderOption.setEnableAgentStyleEngine.
>
> Here's the method I wrote to run BIRT reports in my server. It's pretty
> simple.
>
> /** Runs a report.
> *
> * @param format Report format = "html", "pdf", or "xls".
> *
> * @param params A hasmap mapping parameter names to parameter values.
> *
> * @param request Http request.
> *
> * @return The report in a byte array.
> *
> * @throws Exception
> */
> public static byte[] runReport (String format, HashMap<String, String>
> params,
> HttpServletRequest request)
> throws Exception
> {
> String reportName = params.get("Report name");
> ReportInfo reportInfo = ReportInfo.getInfo(reportName);
> String reportPath = reportsDirPath + "/" + reportName + ".rptdesign";
> IReportRunnable design = engine.openReportDesign(reportPath);
> IRunAndRenderTask task = engine.createRunAndRenderTask(design);
> RenderOption options = null;
> if (format.equals("html")) {
> HTMLRenderOption htmlOptions = new HTMLRenderOption();
> htmlOptions.setImageHandler(new HTMLServerImageHandler());
> htmlOptions.setEmbeddable(true);
> htmlOptions.setBaseImageURL(request.getContextPath() + "/birt-images");
> htmlOptions.setImageDirectory(imagesDirPath);
> options = htmlOptions;
> } else if (format.equals("pdf")) {
> PDFRenderOption pdfOptions = new PDFRenderOption();
> if (reportInfo.singlePage)
> pdfOptions.setOption(PDFRenderOption.PAGE_OVERFLOW,
> PDFRenderOption.FIT_TO_PAGE_SIZE);
> options = pdfOptions;
> } else {
> EXCELRenderOption xlsOptions = new EXCELRenderOption();
> options = xlsOptions;
> }
> options.setOutputFormat(format);
> ByteArrayOutputStream stream = new ByteArrayOutputStream();
> options.setOutputStream(stream);
> task.setRenderOption(options);
> task.setParameterValues(params);
> task.run();
> task.close();
> return stream.toByteArray();
> }
>
>
> John Norstad
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06472 seconds