Scripted dataset with Birt 3.7.0
Options
Hi,<br />
<br />
I upgraded the birt engine on my application from 2.6.2 to 3.7.0.<br />
I designed some reports with scripted datasets that worked fine under the 2.6.2 version. However, now that I have upgraded Birt to 3.7.0, all the fields retrieved through the dataset appear blank on the report.<br />
Here is the code for the different event handlers.<br />
open():<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>importPackage(Packages.com.xxxxxxxxx.yyyy.serverimpl.dao);
retriever = ReportDataRetriever();
details = retriever.getList("from MovementDeliveryDetail mdd where mdd.movement.id = '" + inputParams["deliveryId"] + "'");
iterator = details.iterator();
sum = 0;</pre>
<br />
fetch():<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if(iterator.hasNext() == false) {
return false;
}
var detail = iterator.next();
row["product"] = detail.getProduct().getFullName();
row["expirationDate"] = detail.getExpiryDateString();
row["price"] = detail.getUnitPrice();
var quantityBox = "0"
if (detail.getNbBoxes() != null)
quantityBox = detail.getNbBoxes() + " x " + detail.getNbUnitsPerBox();
row["nbBoxes"] = quantityBox;
row["nbUnits"] = detail.getNbUnits() + " unit(s)";
sum += detail.getNbUnits() * detail.getProduct().getPrice();
row["sum"] = sum + " " + detail.getDelivery().getCenter().getCurrency().getSymbol();
return true;</pre>
<br />
close():<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>details = null;
retriever = null;
iterator = null;</pre>
<br />
When I put breakpoints, in the different getters for example at delivery.getReceiptNumber(), the code stops. Do I need to change the way I bind the fields to a data element or a table?<br />
EDIT : It's actually not working either with datasets connected to JDBC data sources, so most probably with no kind of dataset.<br />
<br />
I read that reports designed under 2.6.2 version would still work under the 3.7.0 version. What am I missing?<br />
Thanks for your help.
<br />
I upgraded the birt engine on my application from 2.6.2 to 3.7.0.<br />
I designed some reports with scripted datasets that worked fine under the 2.6.2 version. However, now that I have upgraded Birt to 3.7.0, all the fields retrieved through the dataset appear blank on the report.<br />
Here is the code for the different event handlers.<br />
open():<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>importPackage(Packages.com.xxxxxxxxx.yyyy.serverimpl.dao);
retriever = ReportDataRetriever();
details = retriever.getList("from MovementDeliveryDetail mdd where mdd.movement.id = '" + inputParams["deliveryId"] + "'");
iterator = details.iterator();
sum = 0;</pre>
<br />
fetch():<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if(iterator.hasNext() == false) {
return false;
}
var detail = iterator.next();
row["product"] = detail.getProduct().getFullName();
row["expirationDate"] = detail.getExpiryDateString();
row["price"] = detail.getUnitPrice();
var quantityBox = "0"
if (detail.getNbBoxes() != null)
quantityBox = detail.getNbBoxes() + " x " + detail.getNbUnitsPerBox();
row["nbBoxes"] = quantityBox;
row["nbUnits"] = detail.getNbUnits() + " unit(s)";
sum += detail.getNbUnits() * detail.getProduct().getPrice();
row["sum"] = sum + " " + detail.getDelivery().getCenter().getCurrency().getSymbol();
return true;</pre>
<br />
close():<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>details = null;
retriever = null;
iterator = null;</pre>
<br />
When I put breakpoints, in the different getters for example at delivery.getReceiptNumber(), the code stops. Do I need to change the way I bind the fields to a data element or a table?<br />
EDIT : It's actually not working either with datasets connected to JDBC data sources, so most probably with no kind of dataset.<br />
<br />
I read that reports designed under 2.6.2 version would still work under the 3.7.0 version. What am I missing?<br />
Thanks for your help.
0
Comments
-
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79839" data-time="1310150831" data-date="08 July 2011 - 11:47 AM"><p>
So, if you create a report in 2.6.2 with the sample database, does it not work if you open it in 3.7.0? You're talking about the designer or deployed? Let me know.<br /></p></blockquote>
<br />
Hi,<br />
thanks for the reply. I was talking about the deploy, but I actually spotted a conflict between the js jar of the birt engine and a jar in my app. I managed to have it working now.<br />
Thanks for your interest.0
Categories
- All Categories
- 109 Developer Announcements
- 49 Articles
- 100 General Questions
- 122 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 122 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management