Scripted dataset with Birt 3.7.0

Options
Mad1s0n
edited February 11, 2022 in Analytics #1
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.

Comments

  • mwilliams
    edited December 31, 1969 #2
    Options
    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.
    Warning No formatter is installed for the format ipb
  • Mad1s0n
    edited December 31, 1969 #3
    Options
    <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.
  • mwilliams
    edited December 31, 1969 #4
    Options
    Great to hear. Let us know whenever you have questions! :)
    Warning No formatter is installed for the format ipb