Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to set row prefetch size with BIRT API
urabirt
<p>Hi,</p>
<p> </p>
<p>I am using BIRT 4.4.2. I'm generating a report using DE API. My report uses a OdaDataSourceHandle object to retrieve data from an Oracle database. My query returns only one row, but has many columns, so when I run my report, I get the following error:</p>
<p>SEVERE: <strong>There is insufficient memory to execute this report</strong>.</p>
<p> </p>
<p>I googled a lot, and found that in the Eclipse Designer, there is a property binding to set on the dataSet, named "row fetch size", that can solve this memory issue. But as I said, I'm not using the eclipse designer, but instead I'm coding my report in full java.</p>
<p> </p>
<p>I couldn't find how to set row fetch size property in full Java. Can someone give me the piece of code to set the row fetch size property on a dataSet with Design Engine API?</p>
<p> </p>
<p>Here is how I initialize my dataSource:</p>
<p> </p>
<p><b>final</b> OdaDataSourceHandle dsHandle = factory.newOdaDataSource(databaseName, "org.eclipse.birt.report.data.oda.jdbc");</p>
<p> </p>
<p>dsHandle.setProperty("odaDriverClass", driverName);</p>
<p>dsHandle.setProperty("odaURL", url);</p>
<p>dsHandle.setProperty("odaUser", user);</p>
<p>dsHandle.setProperty("odaPassword", password);</p>
<p> </p>
<p>I also use this:</p>
<p> </p>
<p><b>final</b> DataEngine dataEngine = DataEngine.<i>newDataEngine</i>(config, <b>null</b>);</p>
<p><b>final</b> OdaDataSourceDesign odaDataSource = <b>new</b> OdaDataSourceDesign(DATASET_NAME);</p>
<p><b>final</b> OdaDataSetDesign odaDataSet = <b>new</b> OdaDataSetDesign(DATASET_NAME);</p>
<p> </p>
<p>odaDataSource.setExtensionID("org.eclipse.birt.report.data.oda.jdbc");</p>
<p>odaDataSource.addPublicProperty("odaURL", url);</p>
<p>odaDataSource.addPublicProperty("odaDriverClass", driverName);</p>
<p>odaDataSource.addPublicProperty("odaUser", user);</p>
<p>odaDataSource.addPublicProperty("odaPassword", password);</p>
<p> </p>
<p> </p>
<p>Thanks a lot for your support</p>
<p> </p>
Find more posts tagged with
Comments
JFreeman
<p>You can set the row fetch size using the method setPropertyBinding("rowFetchSize", "myExpression") on your DataSetHandle.</p>
<p>For example:</p>
<pre class="_prettyXprint _lang-js">
reportDesignHandle.getDataSets().get(0).setPropertyBinding("rowFetchSize", "myRowFetchSizeExpression");
</pre>
Venkat Royyuru
<p>Hi,</p>
<p> </p>
<p>I'm new to BIRT, can you please share the code base to generate a BIRT report using Java. I need to generate a PDF file.</p>
<p> </p>
<p>Thanks in advance.</p>