Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358856 - afterFactory event does not fire
Summary: afterFactory event does not fire
Status: RESOLVED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-26 05:12 EDT by Michael Yoffe CLA
Modified: 2011-09-26 06:02 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Yoffe CLA 2011-09-26 05:12:02 EDT
Build Identifier: 20110615-0604

The report event afterFactory is not fired at all.

Reproducible: Always

Steps to Reproduce:
1. Create a new report
2. Create a report variable afterFactoryFired with default value false
3. Put the following code in afterFactory of the report:
afterFactoryFired = true;
4. Insert a Dynamic Text item into the report with the following text:
vars["afterFactoryFired"]
5. Run the report

Report will show "false".
Should show "true".
Comment 1 Michael Yoffe CLA 2011-09-26 05:14:52 EDT
BIRT version 3.7.0 on Eclipse Indigo
Comment 2 Jun Ouyang CLA 2011-09-26 05:32:38 EDT
afterFactory is invoked after the whole report is finished, It's supposed to be used to release resources.

To verify the invocation, please create a disk file in the callback. Like:
    file = new Packages.java.io.FileOutputStream("d:/testFile");
    file.write(1);
    file.write(2);
    file.close();
Comment 3 Michael Yoffe CLA 2011-09-26 05:55:15 EDT
Thank you, that worked.

So the problem is using report variables in afterFactory event?
This is not at all clear from the documentation 
http://eclipse.org/birt/phoenix/deploy/reportScripting.php
Comment 4 Jun Ouyang CLA 2011-09-26 06:02:56 EDT
You can use report variables in afterFactory, but it just can't be reflected in report execution.