Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to make cross-tables HTML smaller(How to get rid of autogenbookmarks, inline styles and iid in cross-tables)
How to make cross-tables HTML smaller [message #902573] Sat, 18 August 2012 14:28 Go to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Hi,

I use the Report Engine API 4.2 to generate my reports. For standard BIRT tables it is fine, but for cross-tables here is the kind of html that is generated for every datacell:

<td class="style_3" style=" border-top: 1pt solid rgb(204, 204, 204); border-right: 1pt solid rgb(204, 204, 204); border-bottom: 1pt solid rgb(204, 204, 204); border-left: 1pt solid rgb(204, 204, 204);" id="AUTOGENBOOKMARK_49_6822103d-d697-41bf-ac65-11c703c87968" iid="/0.3486/0.3488/0.3489/0.3565/2.-1(QuRs3:::11::1)/0.-1/0.-1/13.3607(QuRs3:::11::1)" element_type="AggregationCell">
<div class="birt-data-design style_7" id="__TOC_0_29">40</div>
</td>

when in the BIRT viewer, with the same report by running "view as html" option, i get data cells with only someting like:
<td class="style_3" align="center">
<div class="style_7">
<div>40</div>
</div>
</td>


It results in large html outputs (an average size of 500 bytes per cell), im trying to reduce this to improve performances. For a concrete exemple, the html markup size of a standard BIRT table with 1000 rows and 13 columns is about 1Mb, when with a crosstable and the same data it is about 7Mb. In my context it is critical because i sometimes need to get tables and crosstables with a page break interval set to 0.

I can't find out how the birt viewer avoids to generate all this stuff:

  • "AUTOGENBOOKMARK*...etc." IDs
  • Inline styles for some items, in addition to other styles items managed properly. In this example i can't understand why all styles are not included in 'style_3" and "style_7"? It seems these inline styles only concern cells borders, whereas i did not change these properties in the BIRT designer.
  • "iid=" informations (i wonder what is it for?)
  • TOC id


I tried many RenderOptions combinations to get rid of this, currently nothing worked.
Now my html render options look like this, i currently removed "setEnableCompactMode" for testing:
        outputOptions.setOutputFormat("html");
        outputOptions.setImageHandler(new HTMLServerImageHandler());
        outputOptions.setBaseImageURL(myBaseImageURL);
        outputOptions.setImageDirectory(myRenderFolder);
        outputOptions.setUrlEncoding("UTF-8");
        outputOptions.setOutputFileName("myOutputHTML.html"); 
        outputOptions.setMasterPageContent(true);
        outputOptions.setOutputMasterPageMargins(true);
        outputOptions.setPageFooterFloatFlag(true);   
        outputOptions.setEmbeddable(false);
        outputOptions.setEnableMetadata(true);
        outputOptions.setOption("htmlPagination", true);
        outputOptions.setEnableInlineStyle(false);


As i said, it seems only affect cross-tables. There should be a solution, as BIRT designer preview provides a correct HTML output? Or may be it is due to the RunAndRender mode? (i always generate rptdocuments first)


Please help!

[Updated on: Sun, 19 August 2012 12:52]

Report message to a moderator

Re: How to make cross-tables HTML smaller [message #902863 is a reply to message #902573] Mon, 20 August 2012 18:42 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

When you preview in the Webviewer, then in HTML are they the same?
How are you running the report run task followed by a render task or a
runandrender task? BTW you may also want to look at these options as well:
http://www.eclipse.org/birt/phoenix/project/notable3.7.php#jump_8

Jason

On 8/18/2012 10:28 AM, donino donino wrote:
> Hi,
> I use the Report Engine API 4.2 to generate my reports. For standard
> BIRT tables it seems fine, but in cross-tables here is the kind of
> datacell i get:
>
>
> <td class="style_3" style="
> border-top: 1pt solid rgb(204, 204, 204); border-right: 1pt solid
> rgb(204, 204, 204); border-bottom: 1pt solid rgb(204, 204, 204);
> border-left: 1pt solid rgb(204, 204, 204);"
> id="AUTOGENBOOKMARK_49_6822103d-d697-41bf-ac65-11c703c87968"
> iid="/0.3486/0.3488/0.3489/0.3565/2.-1(QuRs3:::11::1)/0.-1/0.-1/13.3607(QuRs3:::11::1)"
> element_type="AggregationCell">
> <div class="birt-data-design style_7" id="__TOC_0_29">40</div>
> </td>
>
> when in the BIRT viewer, with the same report by running "view as html"
> option, i get data cells with only someting like:
> <td class="style_3" align="center"> <div class="style_7"> <div style="visibility:hidden">40</div> </div> </td>
>
> It results in too large html outputs, about three times as large as it
> should be.
>
> I can't find out how the birt viewer avoids to generate all this stuff:
>
> "AUTOGENBOOKMARK*...etc." IDs
> Inline styles for some items, in addition to other styles items managed
> properly. In this example i can't understand why all styles are not
> included in 'style_3" and "style_7"?
> "iid=" informations
> TOC id
>
>
> I tried many RenderOptions combinations to get rid of this, currently
> nothing worked.
> Now my html render options look like this:
>
> outputOptions.setOutputFormat("html");
> outputOptions.setImageHandler(new HTMLServerImageHandler());
> outputOptions.setBaseImageURL(myBaseImageURL);
> outputOptions.setImageDirectory(myRenderFolder);
> outputOptions.setUrlEncoding("UTF-8");
> outputOptions.setOutputFileName("myOutputHTML.html");
> outputOptions.setMasterPageContent(true);
> outputOptions.setOutputMasterPageMargins(true);
> outputOptions.setPageFooterFloatFlag(true);
> outputOptions.setEmbeddable(false);
> outputOptions.setEnableMetadata(true);
> outputOptions.setOption("htmlPagination", true);
> outputOptions.setEnableInlineStyle(false);
>
>
> As i said, it seems only affect cross-tables. There should be a
> solution, as BIRT designer preview provides a correct HTML output?
>
> Please help!
>
Re: How to make cross-tables HTML smaller [message #902934 is a reply to message #902573] Tue, 21 August 2012 09:27 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Hi jason,

Thanks for the reply. I use rptdocuments: a run task and then a render task. I tried in the Eclipse Web Viewer, the html markup generated for cross-tables is simple and correct as well, as it is with "preview as html" in the designer.

I did tons of tests, the only solution i found is to use a mysterious render option:

outputOptions.setEnableAgentStyleEngine(true);


With this option enabled, the html generated is exactly the same as with Web Viewer / Birt designer. All seems fine, however i don't have any idea of this option purpose? Is it linked to "outputOptions.setUserAgent" (i didn't try to set this), and may i encounter some side effects later?

Thanks

Re: How to make cross-tables HTML smaller [message #903032 is a reply to message #902934] Tue, 21 August 2012 17:10 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

From the source:

/**
* Sets the flag indicationg that agentStyleEngine is enabled or not.
* @param enableAgentStyleEngine
* True: means the HTML emitter will output the BIRT styles directly
to the report
* and depends on the browser to implement the style calculation.
* False: means the HTML emitter will use BIRT style engine to
calculate the styles
* and output the result to the report.
*/
public void setEnableAgentStyleEngine( boolean enableAgentStyleEngine )
{
options.put( HTML_ENABLE_AGENTSTYLE_ENGINE, Boolean.valueOf(
enableAgentStyleEngine ) );
}

Jason


On 8/21/2012 5:27 AM, donino donino wrote:
> Hi jason,
> Thanks for the reply. I use rptdocuments: a run task and then a render
> task. I tried in the Eclipse Web Viewer, the html markup generated for
> cross-tables is simple and correct as well, as it is with "preview as
> html" in the designer.
>
> I did tons of tests, the only solution i found is to use a mysterious
> render option:
>
> outputOptions.setEnableAgentStyleEngine(true);
>
> With this option enabled, the html generated is exactly the same as with
> Web Viewer / Birt designer. All seems fine, however i don't have any
> idea of this option purpose? Is it linked to
> "outputOptions.setUserAgent" (i didn't try to set this), and may i
> encounter some side effects later?
> Thanks
>
>
Previous Topic:onFetch local javascript variable
Next Topic:BIRT Runtime
Goto Forum:
  


Current Time: Thu Apr 25 04:18:54 GMT 2024

Powered by FUDForum. Page generated in 0.02514 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top