This is an archive of the Maximo Yahoo Community. The content of this pages may be a sometimes obsolete so please check post dates.
Thanks to the community owner Christopher Wanko for providing the content.
Dear Maximo Birt Experts,
I created a custom report that updating the database,
When I run the report from Maximo, the report updates the database successfully in HTML Preview.
But when I download the report to PDF, Word, PPT, etc, the database update happens twice.
The problem is, maximo re-render it again if we click "print report" or "export report" on the toolbar. I think this should not gonna happen if maximo just render the report as previewed as in HTML page.
If anyone here has any solution regarding this matter, please let me know.
Thank you so much
Best Regards,
Tommy
Hello Tommy,
"> But when I download the report to PDF, Word, PPT, etc, the database update happens twice.
>
"
You need to add a condition like this:
if ( reportContext.getOutputFormat() == "pdf" )
and put your update within that condition.
That way it will only work when that output format is used.
In your case it will need to be html
Regards,
robbinma4
Hi Robbin,
Thank you for your suggestion.
As far as I know, reportContext.getOutputFormat() only works in outline methods (initital, beforerender, afterrender).
It cannot works in dataset method(fetching, afterclose, etc), nor otherwise.
Please correct me if I'm wrong. I just thought maybe it could use Session to run the update query. but I still have not managed to try it
--- In MAXIMO@yahoogroups.com, "robbinma4" <mark_robbins1@...> wrote:
>
>
>
> Hello Tommy,
>
> "> But when I download the report to PDF, Word, PPT, etc, the database update happens twice.
> >
> "
> You need to add a condition like this:
> if ( reportContext.getOutputFormat() == "pdf" )
>
> and put your update within that condition.
> That way it will only work when that output format is used.
>
> In your case it will need to be html
>
> Regards,
>
> robbinma4
>