Bug 125678 - The original chart instance in report design handle is not modified after running the report.
Summary: The original chart instance in report design handle is not modified after run...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 2.1.0 M5   Edit
Assignee: David Michonneau CLA
QA Contact:
URL: http://www.eclipse.org/newsportal/art...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-30 04:52 EST by Bharat Panchal CLA
Modified: 2006-02-14 11:59 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bharat Panchal CLA 2006-01-30 04:52:32 EST
The original chart instance in report design handle is not modified after
running the report.
In my application, I get the design time instance of chart, and then I
call method which runs the report.
I expect chart bound with data after running the report.
The same functionality was working fine (I mean: BIRT was returning chart
bound with data after running report)
till BIRT2.0M3. It's not working as expected in BIRT RC and 2.0 version.
Comment 1 David Michonneau CLA 2006-01-30 10:07:14 EST
This looks as a regression, and is caused by the new architecture of report document. Due to the two steps generation process, the deserialize method is being called after the chart model is set in IReportItemPresentation, thus the actual instance of the chart of the ReportDesignHandle is never used by the Chart Engine. The one used is a floating instance that comes from the deserialize call. We need to discuss this with the engine team to decide if this should be fixed in report engine or chart engine.
Comment 2 Bharat Panchal CLA 2006-02-01 01:57:09 EST
Can I know what is the plan to fix this bug as our application release is pending?

Comment 3 Wenfeng Li CLA 2006-02-02 21:39:16 EST
Not quite understand the issue.  Is this scripting that change the chart design during report execution?  Is it script in onPrepare()? 

Can you attach your code to show the usage and expected behavior?

Thanks
Comment 4 Bharat Panchal CLA 2006-02-03 03:43:28 EST
Hi,
I haven't use onPrepare() script.
I have used open and fetch method of data set.

Please visit http://www.eclipse.org/newsportal/article.php?id=5214&group=eclipse.birt#5214 .
This will give the whole idea. 
It's not possible for me to send the source code since it's an integrated system.


Please let me know if you still don't understand the issue.

Thanks.
Bharat Panchal
Comment 5 David Michonneau CLA 2006-02-03 04:34:18 EST
What happens is that the report is run to populate the chart with data. Then the user tries to extract the chart from the report and render it. The problem is that when the chart is extracted from the report, it is not bound to data, because it was not serialized/deserialized during generation (so another instance was bound to data).
Comment 6 Wenfeng Li CLA 2006-02-05 02:58:54 EST
Could this usage be addressed when BIRT supports reportlet, where a component of the report can be retreieved to render? In this case, the desired chart output (in image file or SVG format) can be retrieved from a BIRT report document via a BIRT engine API. 

If the app needs to get hold of the chart instance handle in stead of a chart output, can user use the chart engine directly and bind data to it?
Comment 7 David Michonneau CLA 2006-02-05 13:53:09 EST
If there is such a reportlet feature, yes, that's possible. However I think this is still a bug, the report design handle should be able to retrieve the chart instance which was used for rendering. There are different ways to fix it, depending how the engine wants to handle those case for report items in general.

Yes, the user can bind data to the chart directly, this is even encouraged rather than running a report for this sole purpose. The Chart API provides all what is needed. Note however that in this case, the user must deal with the data directly, instead of having the report engine take care of retrieving it.
Comment 8 Bharat Panchal CLA 2006-02-06 03:57:47 EST
Report design handle should be able to retrieve the chart instance which was used for rendering and report generation.

I think chart dialog uses the chart instance of report design handle. Please correct me if I am wrong.

Here is brief description about my application.

By default, the application generates Bar chart using SWT table data and renders it on canvas.
I have used scripted data source and used "open" and "fetch" data set methods.
The application provides the facility to customize the chart using chart dialog.
So, user can open the chart dialog (run time), select the chart type, customize the series and other chart properties.
Then application renders the customized chart.

In order to provide above functionality, I think report design handle should return the chart instance which was used for report generation, so that it can be used for rendering later on.

If you have some other solution which can resolve this issue then please let me know as it may affect our application release plan which uses BIRT.

Thanks.
Comment 9 Wenfeng Li CLA 2006-02-06 15:13:24 EST
Bharat,  which BIRT API and method on that API do you use to get the "report design handle"?

thanks
Comment 10 Bharat Panchal CLA 2006-02-06 22:45:24 EST
I use following code to get report design handle and store it to one static variable for later use.

try {
        // Intialize ReportDesign
        SessionHandleAdapter sessionHandleAdapter = SessionHandleAdapter
                        .getInstance();
        FileInputStream fin = (FileInputStream) GraphsPlugin
                        .getDefault()
                        .openStream(new Path("Empty.rptdesign"));
        sessionHandleAdapter.init("", fin);

        ReportDesignHandle reportDesignHandle = (ReportDesignHandle) sessionHandleAdapter
                        .getReportDesignHandle();
        reportDesignHandle.setProperty("units","in");
        // Intialize DataSetManager
        DataSetManager.setCurrentInstance(DataSetManager.newInstance());

} catch (Exception e) {
        
}


Empty.rptdesign
---------------
<?xml version="1.0" encoding="UTF-8"?>
<!-- Written by Eclipse BIRT 2.0 -->
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3" id="1">
    <property name="createdBy">Eclipse BIRT Designer Version 2.0.0 Build &lt;20060123-1141></property>
    <property name="units">in</property>
    <page-setup>
        <simple-master-page name="Simple MasterPage" id="2">
            <page-footer>
                <text id="3">
                    <property name="contentType">html</property>
                    <text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
                </text>
            </page-footer>
        </simple-master-page>
    </page-setup>
</report>
Comment 11 David Michonneau CLA 2006-02-14 11:59:39 EST
Due to the new deserialize call at presentation time, the reportdesign handle 
did not contain the chart used for presentation anymore. This is now fixed by 
setting it back in the extendeditemhandle after deserialization, as agreed with 
the report engine team.

 

The user scenario was: run a report, extract the chart model from the 
reportdesignhandle, render the chart. Since the chart from the designhandle was 
not bound to data, it didn?t work, this fixes the problem.