|
Re: Report row count [message #516057 is a reply to message #516000] |
Mon, 22 February 2010 10:52 |
|
Do you want the report to not run or not render when you have to many
rows? By the time BIRT knows how many rows are returned your db will
already be hit. You can set the max number of rows to return if you
want to. Also if you do not mind generating it you could always check
the table data after the run and just not render it.
Jason
Mut Antu wrote:
> Hello,
> Before generating programmatically a report, I need to know the row
> count for the report and avoid generating it if I have too many rows.
> This row count checking must be resonable fast.
> Portions of my code:
>
> IReportEngine engine;
> ..
> IReportRunnable design = engine.openReportDesign(stream);
> IRunTask runTask = engine.createRunTask(design);
> /* Parameters */
> if (parameters != null)
> {
> for (String clef : parameters.keySet())
> {
> runTask.setParameterValue(clef, parameters.get(clef));
> }
> }
> runTask.run("***path to the doc****");
>
> IReportDocument doc = engine.openReportDocument(rptDocument);
> IRenderTask renderTask = engine.createRenderTask(doc);
> IRenderOption option = new RenderOption();
> option.setOutputFileName(outputFile);
> option.setOutputFormat(format);
>
> renderTask.setRenderOption(option);
> renderTask.render();
>
> What is the best way to do row count checking in this case?
> Thanks
>
|
|
|
|
Re: Report row count [message #516340 is a reply to message #516203] |
Tue, 23 February 2010 16:00 |
|
I do not think so. Let us know what you find in your testing.
Jason
Mut Antu wrote:
> Jason Weathersby wrote on Mon, 22 February 2010 05:52
>> Do you want the report to not run or not render when you have to many
>> rows? By the time BIRT knows how many rows are returned your db will
>> already be hit. You can set the max number of rows to return if you
>> want to. Also if you do not mind generating it you could always check
>> the table data after the run and just not render it.
>>
>> Jason
>> >
>
>
> For now I found two methods:
> - use a progress monitor in the run to count for FETCH_ROWS event
> - let the run go without monitor and use a data extraction task to
> count the data
> I will do some tests on each one to see which are faster.
>
> If I set the max number of rows, there is a way to see if this number is
> reached or not after a run?
> Thanks
|
|
|
Re: Report row count [message #516342 is a reply to message #516340] |
Tue, 23 February 2010 16:04 |
|
BTW I did not think to use the progress monitor. Your best approach may
be to use it with a cancel task if the limit is reached.
Jason
Jason Weathersby wrote:
> I do not think so. Let us know what you find in your testing.
>
> Jason
>
> Mut Antu wrote:
>> Jason Weathersby wrote on Mon, 22 February 2010 05:52
>>> Do you want the report to not run or not render when you have to many
>>> rows? By the time BIRT knows how many rows are returned your db will
>>> already be hit. You can set the max number of rows to return if you
>>> want to. Also if you do not mind generating it you could always
>>> check the table data after the run and just not render it.
>>>
>>> Jason
>>> >
>>
>>
>> For now I found two methods:
>> - use a progress monitor in the run to count for FETCH_ROWS event
>> - let the run go without monitor and use a data extraction task to
>> count the data
>> I will do some tests on each one to see which are faster.
>>
>> If I set the max number of rows, there is a way to see if this number
>> is reached or not after a run?
>> Thanks
|
|
|
|
Powered by
FUDForum. Page generated in 0.03227 seconds