Trouble with Scripted data source: Java API getting invoked multiple times

View: New views
5 Messages — Rating Filter:   Alert me  

Trouble with Scripted data source: Java API getting invoked multiple times

by John, Abhilash :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Trouble with Scripted data source: Java API getting invoked multiple times

Hi All,
I am using a scripted datasource to talk to the Hibernate layer via a Java API. I noticed that the call from the reportengine to the Java API happens more than once, before the data is displayed completely. This leads to a performance bottleneck for the reports. Can you please guide me what am I doing wrong here?

The following is my environment:
birt-runtime-2_3_0
Hibernate 3.2
And here is my code:

 <method name="open">
 <![CDATA[reportGenerator = new Packages.com.xxx.BirtReportGenerator();
reportData = reportGenerator.getPublishedApprovals(params["AAA"].value, params["BBB"].value,params["CCC"].value);
iter = reportData.iterator();]]></method>

<method name="fetch">
<![CDATA[if(!iter.hasNext()){
        return false
}
else{
        report = iter.next();
        dataSetRow["analystHeader"]=report.getAnalystHeader();
        dataSetRow["securityHeader"]=report.getSecurityHeader();
        dataSetRow["sortHeader"]=report.getSortOrder();
        dataSetRow["genHeader"]=report.getGenerated();

        dataSetRow["expiry"]=report.getPublishedDate();
        dataSetRow["security"]=report.getSecurity();
        if(report.getDetails()!=null){
                detailsIterator = report.getDetails().iterator();
                if(detailsIterator==null||!detailsIterator.hasNext()){
                        return false;
                }else{
                        var detailInfo = detailsIterator.next();
                        dataSetRow["type"] = detailInfo[0];
                        dataSetRow["from"] = detailInfo[1];
                        dataSetRow["to"] = detailInfo[2];
                        dataSetRow["comments"] = detailInfo[3];
                }
        }
        return true;
}]]></method>
<method name="close">
<![CDATA[iter = null;
reportData =null;
reportGenerator =null;]]>
</method>
</script-data-set>


Regards,
Abhilash John


_______________________________________________
birt-report-designer-dev mailing list
birt-report-designer-dev@...
https://dev.eclipse.org/mailman/listinfo/birt-report-designer-dev

RE: Trouble with Scripted data source: JavaAPI getting invoked multiple times

by vivek tiwari :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Trouble with Scripted data source: Java API getting invoked multiple times

You might have used same dataset more than once. So for every appearance of corresponding dataset it is calling this api again and again.

 

With Regards

Vivek Nath Tiwari

0522 4051203


From: birt-report-designer-dev-bounces@... [mailto:birt-report-designer-dev-bounces@...] On Behalf Of John, Abhilash
Sent: Monday, June 16, 2008 2:49 PM
To: birt-report-designer-dev@...; birt-report-engine-dev@...
Subject: [birt-report-designer-dev] Trouble with Scripted data source: JavaAPI getting invoked multiple times

 

Hi All,
I am using a scripted datasource to talk to the Hibernate layer via a Java API. I noticed that the call from the reportengine to the Java API happens more than once, before the data is displayed completely. This leads to a performance bottleneck for the reports. Can you please guide me what am I doing wrong here?

The following is my environment:
birt-runtime-2_3_0
Hibernate 3.2
And here is my code:

 <method name="open">
 <![CDATA[reportGenerator = new Packages.com.xxx.BirtReportGenerator();
reportData = reportGenerator.getPublishedApprovals(params["AAA"].value, params["BBB"].value,params["CCC"].value);
iter = reportData.iterator();]]></method>

<method name="fetch">
<![CDATA[if(!iter.hasNext()){
        return false
}
else{
        report = iter.next();
        dataSetRow["analystHeader"]=report.getAnalystHeader();
        dataSetRow["securityHeader"]=report.getSecurityHeader();
        dataSetRow["sortHeader"]=report.getSortOrder();
        dataSetRow["genHeader"]=report.getGenerated();

        dataSetRow["expiry"]=report.getPublishedDate();
        dataSetRow["security"]=report.getSecurity();
        if(report.getDetails()!=null){
                detailsIterator = report.getDetails().iterator();
                if(detailsIterator==null||!detailsIterator.hasNext()){
                        return false;
                }else{
                        var detailInfo = detailsIterator.next();
                        dataSetRow["type"] = detailInfo[0];
                        dataSetRow["from"] = detailInfo[1];
                        dataSetRow["to"] = detailInfo[2];
                        dataSetRow["comments"] = detailInfo[3];
                }
        }
        return true;
}]]></method>
<method name="close">
<![CDATA[iter = null;
reportData =null;
reportGenerator =null;]]>
</method>
</script-data-set>

 

Regards,
Abhilash John


_______________________________________________
birt-report-designer-dev mailing list
birt-report-designer-dev@...
https://dev.eclipse.org/mailman/listinfo/birt-report-designer-dev

RE: Trouble with Scripted data source:JavaAPI getting invoked multiple times

by John, Abhilash :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Trouble with Scripted data source: Java API getting invoked multiple times
Thanks for the quick response!
I guess you are right....
I have
            <property name="dataSet">Data Set</property>
in multiple places. That's what you meant right?
Is there any way I can define the dataset at one place, and access the same in 3-4 tables/ data columns? Please advice
 

Regards,
Abhilash John

 


From: birt-report-designer-dev-bounces@... [mailto:birt-report-designer-dev-bounces@...] On Behalf Of Tiwari_Vivek@...
Sent: Monday, June 16, 2008 3:00 PM
To: birt-report-designer-dev@...
Subject: RE: [birt-report-designer-dev] Trouble with Scripted data source:JavaAPI getting invoked multiple times

You might have used same dataset more than once. So for every appearance of corresponding dataset it is calling this api again and again.

 

With Regards

Vivek Nath Tiwari

0522 4051203


From: birt-report-designer-dev-bounces@... [mailto:birt-report-designer-dev-bounces@...] On Behalf Of John, Abhilash
Sent: Monday, June 16, 2008 2:49 PM
To: birt-report-designer-dev@...; birt-report-engine-dev@...
Subject: [birt-report-designer-dev] Trouble with Scripted data source: JavaAPI getting invoked multiple times

 

Hi All,
I am using a scripted datasource to talk to the Hibernate layer via a Java API. I noticed that the call from the reportengine to the Java API happens more than once, before the data is displayed completely. This leads to a performance bottleneck for the reports. Can you please guide me what am I doing wrong here?

The following is my environment:
birt-runtime-2_3_0
Hibernate 3.2
And here is my code:

 <method name="open">
 <![CDATA[reportGenerator = new Packages.com.xxx.BirtReportGenerator();
reportData = reportGenerator.getPublishedApprovals(params["AAA"].value, params["BBB"].value,params["CCC"].value);
iter = reportData.iterator();]]></method>

<method name="fetch">
<![CDATA[if(!iter.hasNext()){
        return false
}
else{
        report = iter.next();
        dataSetRow["analystHeader"]=report.getAnalystHeader();
        dataSetRow["securityHeader"]=report.getSecurityHeader();
        dataSetRow["sortHeader"]=report.getSortOrder();
        dataSetRow["genHeader"]=report.getGenerated();

        dataSetRow["expiry"]=report.getPublishedDate();
        dataSetRow["security"]=report.getSecurity();
        if(report.getDetails()!=null){
                detailsIterator = report.getDetails().iterator();
                if(detailsIterator==null||!detailsIterator.hasNext()){
                        return false;
                }else{
                        var detailInfo = detailsIterator.next();
                        dataSetRow["type"] = detailInfo[0];
                        dataSetRow["from"] = detailInfo[1];
                        dataSetRow["to"] = detailInfo[2];
                        dataSetRow["comments"] = detailInfo[3];
                }
        }
        return true;
}]]></method>
<method name="close">
<![CDATA[iter = null;
reportData =null;
reportGenerator =null;]]>
</method>
</script-data-set>

 

Regards,
Abhilash John


_______________________________________________
birt-report-designer-dev mailing list
birt-report-designer-dev@...
https://dev.eclipse.org/mailman/listinfo/birt-report-designer-dev

RE: Trouble with Scripted data source:JavaAPI getting invoked multiple times

by John, Abhilash :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Trouble with Scripted data source: Java API getting invoked multiple times
For now, I am doing the following work around:
Instead of using multiple data columns, I am merging everything to a table and it seems to do the trick!
Thanks again for your suggestion!
 

Regards,
Abhilash John

 


From: John, Abhilash
Sent: Monday, June 16, 2008 3:16 PM
To: 'For developers on the BIRT Report Designer project'
Subject: RE: [birt-report-designer-dev] Trouble with Scripted data source:JavaAPI getting invoked multiple times

Thanks for the quick response!
I guess you are right....
I have
            <property name="dataSet">Data Set</property>
in multiple places. That's what you meant right?
Is there any way I can define the dataset at one place, and access the same in 3-4 tables/ data columns? Please advice
 

Regards,
Abhilash John

 


From: birt-report-designer-dev-bounces@... [mailto:birt-report-designer-dev-bounces@...] On Behalf Of Tiwari_Vivek@...
Sent: Monday, June 16, 2008 3:00 PM
To: birt-report-designer-dev@...
Subject: RE: [birt-report-designer-dev] Trouble with Scripted data source:JavaAPI getting invoked multiple times

You might have used same dataset more than once. So for every appearance of corresponding dataset it is calling this api again and again.

 

With Regards

Vivek Nath Tiwari

0522 4051203


From: birt-report-designer-dev-bounces@... [mailto:birt-report-designer-dev-bounces@...] On Behalf Of John, Abhilash
Sent: Monday, June 16, 2008 2:49 PM
To: birt-report-designer-dev@...; birt-report-engine-dev@...
Subject: [birt-report-designer-dev] Trouble with Scripted data source: JavaAPI getting invoked multiple times

 

Hi All,
I am using a scripted datasource to talk to the Hibernate layer via a Java API. I noticed that the call from the reportengine to the Java API happens more than once, before the data is displayed completely. This leads to a performance bottleneck for the reports. Can you please guide me what am I doing wrong here?

The following is my environment:
birt-runtime-2_3_0
Hibernate 3.2
And here is my code:

 <method name="open">
 <![CDATA[reportGenerator = new Packages.com.xxx.BirtReportGenerator();
reportData = reportGenerator.getPublishedApprovals(params["AAA"].value, params["BBB"].value,params["CCC"].value);
iter = reportData.iterator();]]></method>

<method name="fetch">
<![CDATA[if(!iter.hasNext()){
        return false
}
else{
        report = iter.next();
        dataSetRow["analystHeader"]=report.getAnalystHeader();
        dataSetRow["securityHeader"]=report.getSecurityHeader();
        dataSetRow["sortHeader"]=report.getSortOrder();
        dataSetRow["genHeader"]=report.getGenerated();

        dataSetRow["expiry"]=report.getPublishedDate();
        dataSetRow["security"]=report.getSecurity();
        if(report.getDetails()!=null){
                detailsIterator = report.getDetails().iterator();
                if(detailsIterator==null||!detailsIterator.hasNext()){
                        return false;
                }else{
                        var detailInfo = detailsIterator.next();
                        dataSetRow["type"] = detailInfo[0];
                        dataSetRow["from"] = detailInfo[1];
                        dataSetRow["to"] = detailInfo[2];
                        dataSetRow["comments"] = detailInfo[3];
                }
        }
        return true;
}]]></method>
<method name="close">
<![CDATA[iter = null;
reportData =null;
reportGenerator =null;]]>
</method>
</script-data-set>

 

Regards,
Abhilash John


_______________________________________________
birt-report-designer-dev mailing list
birt-report-designer-dev@...
https://dev.eclipse.org/mailman/listinfo/birt-report-designer-dev

RE: Trouble with Scripted datasource:JavaAPI getting invoked multiple times

by portal on behalf of Lin Zhu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Trouble with Scripted data source: Java API getting invoked multiple times

Hi,

 

What is your BIRT runtime version? Starting from BIRT 2.3.0 RC builds the execution of a script data set which shared by multi tables should result with only one script execution.

 

Thanks.

Lin

 


From: birt-report-designer-dev-bounces@... [mailto:birt-report-designer-dev-bounces@...] On Behalf Of John, Abhilash
Sent: 2008
616 17:46
To: For developers on the BIRT Report Designer project
Subject: RE: [birt-report-designer-dev] Trouble with Scripted datasource:JavaAPI getting invoked multiple times

 

Thanks for the quick response!

I guess you are right....

I have

            <property name="dataSet">Data Set</property>
in multiple places. That's what you meant right?

Is there any way I can define the dataset at one place, and access the same in 3-4 tables/ data columns? Please advice

 

Regards,
Abhilash John

 

 


From: birt-report-designer-dev-bounces@... [mailto:birt-report-designer-dev-bounces@...] On Behalf Of Tiwari_Vivek@...
Sent: Monday, June 16, 2008 3:00 PM
To: birt-report-designer-dev@...
Subject: RE: [birt-report-designer-dev] Trouble with Scripted data source:JavaAPI getting invoked multiple times

You might have used same dataset more than once. So for every appearance of corresponding dataset it is calling this api again and again.

 

With Regards

Vivek Nath Tiwari

0522 4051203


From: birt-report-designer-dev-bounces@... [mailto:birt-report-designer-dev-bounces@...] On Behalf Of John, Abhilash
Sent: Monday, June 16, 2008 2:49 PM
To: birt-report-designer-dev@...; birt-report-engine-dev@...
Subject: [birt-report-designer-dev] Trouble with Scripted data source: JavaAPI getting invoked multiple times

 

Hi All,
I am using a scripted datasource to talk to the Hibernate layer via a Java API. I noticed that the call from the reportengine to the Java API happens more than once, before the data is displayed completely. This leads to a performance bottleneck for the reports. Can you please guide me what am I doing wrong here?

The following is my environment:
birt-runtime-2_3_0
Hibernate 3.2
And here is my code:

 <method name="open">
 <![CDATA[reportGenerator = new Packages.com.xxx.BirtReportGenerator();
reportData = reportGenerator.getPublishedApprovals(params["AAA"].value, params["BBB"].value,params["CCC"].value);
iter = reportData.iterator();]]></method>

<method name="fetch">
<![CDATA[if(!iter.hasNext()){
        return false
}
else{
        report = iter.next();
        dataSetRow["analystHeader"]=report.getAnalystHeader();
        dataSetRow["securityHeader"]=report.getSecurityHeader();
        dataSetRow["sortHeader"]=report.getSortOrder();
        dataSetRow["genHeader"]=report.getGenerated();

        dataSetRow["expiry"]=report.getPublishedDate();
        dataSetRow["security"]=report.getSecurity();
        if(report.getDetails()!=null){
                detailsIterator = report.getDetails().iterator();
                if(detailsIterator==null||!detailsIterator.hasNext()){
                        return false;
                }else{
                        var detailInfo = detailsIterator.next();
                        dataSetRow["type"] = detailInfo[0];
                        dataSetRow["from"] = detailInfo[1];
                        dataSetRow["to"] = detailInfo[2];
                        dataSetRow["comments"] = detailInfo[3];
                }
        }
        return true;
}]]></method>
<method name="close">
<![CDATA[iter = null;
reportData =null;
reportGenerator =null;]]>
</method>
</script-data-set>

 

Regards,
Abhilash John


_______________________________________________
birt-report-designer-dev mailing list
birt-report-designer-dev@...
https://dev.eclipse.org/mailman/listinfo/birt-report-designer-dev