beforeFactory, findElement("XXX").drop() [message #689683] |
Tue, 28 June 2011 07:26 |
Missing name Mising name Messages: 81 Registered: April 2011 |
Member |
|
|
I find that in event beforeFactory, there is some code like
if(params["OSType"].value != "linux")
{
if( reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Linux Section") != null)
reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Linux Section").drop();
}
if(params["OSType"].value != "windows")
{
if( reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Windows Section") != null)
reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Windows Section").drop();
}
if(params["OSType"].value != "unix")
{
if( reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Unix Section") != null)
reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Unix Section").drop();
}
the problem is if the user select paramter "windows" first, then close the report, then rerun the report and select parameter other than "windows", no output because the other OS section is drop!!
1) Is there any method to re-add the section after it is dropped in first run of beforeFactory?
2) Also, is beforeFactory run everytime the report is run?
3) I tried to change the visibility property of the section instead of drop element, but I found that even I invisible that section, the table inside the section, and so the related dataset, sql statement is still run!!
|
|
|
Re: beforeFactory, findElement("XXX").drop() [message #689927 is a reply to message #689683] |
Tue, 28 June 2011 15:30 |
|
The beforeFactory runs every time you run the report. This code should
work. What version of BIRT are you using and can you post the report?
If you are using 2.3.2 or later use:
reportContext.getDesignHandle().findElement("LinuxSection").drop();
You may also want to drop in something like the following for testing:
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/test/beforeevents.txt", true ) );
out.println( "beforeFactory " + params["OSType"].value);
out.close();
and see what is printed in the beforeevents.txt file.
Jason
On 6/28/2011 3:26 AM, forums-noreply@eclipse.org wrote:
> I find that in event beforeFactory, there is some code like
>
> if(params["OSType"].value != "linux")
> {
> if(
> reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Linux
> Section") != null)
> reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Linux
> Section").drop();
>
> }
> if(params["OSType"].value != "windows")
> {
> if(
> reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Windows
> Section") != null)
> reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Windows
> Section").drop();
>
> }
> if(params["OSType"].value != "unix")
> {
> if(
> reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Unix
> Section") != null)
> reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Unix
> Section").drop();
>
> }
>
> the problem is if the user select paramter "windows" first, then close
> the report, then rerun the report and select parameter other than
> "windows", no output because the other OS section is drop!!
> 1) Is there any method to re-add the section after it is dropped in
> first run of beforeFactory?
> 2) Also, is beforeFactory run everytime the report is run?
> 3) I tried to change the visibility property of the section instead of
> drop element, but I found that even I invisible that section, the table
> inside the section, and so the related dataset, sql statement is still
> run!!
>
|
|
|
Powered by
FUDForum. Page generated in 0.04281 seconds