Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Scripted dataset with Birt 3.7.0
Scripted dataset with Birt 3.7.0 [message #694285] Fri, 08 July 2011 09:18 Go to next message
Stephane Coquard is currently offline Stephane Coquard
Messages: 8
Registered: February 2011
Junior Member
Hi,

I upgraded the birt engine on my application from 2.6.2 to 3.7.0.
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.
Here is the code for the different event handlers.
open():
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


fetch():
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;


close():
details = null;
retriever = null;
iterator = null;



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?
EDIT : It's actually not working either with datasets connected to JDBC data sources, so most probably with no kind of dataset.

I read that reports designed under 2.6.2 version would still work under the 3.7.0 version. What am I missing?
Thanks for your help.

[Updated on: Fri, 08 July 2011 10:21]

Report message to a moderator

Re: Scripted dataset with Birt 3.7.0 [message #694515 is a reply to message #694285] Fri, 08 July 2011 18:24 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

My guess would be a classpath issue. Where do you have this class? You
may just want to put it in web-inf/lib if it is in a jar.

The above was for the deployed viewer. If you are in the designer check
the project classpath in windows->preferences->report design->classpath

Jason

On 7/8/2011 5:18 AM, forums-noreply@eclipse.org wrote:
> Hi,
>
> I upgraded the birt engine on my application from 2.6.2 to 3.7.0.
> 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.
> Here is the code for the different event handlers.
> open():
> 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
>
> fetch():
> 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;
>
> close():
> details = null;
> retriever = null;
> iterator = null;
>
>
> 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?
>
> I read that reports designed under 2.6.2 version would still work under
> the 3.7.0 version. What am I missing?
> Thanks for your help.
Re: Scripted dataset with Birt 3.7.0 [message #695315 is a reply to message #694515] Mon, 11 July 2011 13:37 Go to previous message
Stephane Coquard is currently offline Stephane Coquard
Messages: 8
Registered: February 2011
Junior Member
Thanks. It was due to a conflict between the js.jar in the birt suite and a jar with kind of similar functionalities already present in my application. I fixed it now.
Thanks for your help!
Previous Topic:Customize the pop-up message in BIRT viewer
Next Topic:Implementing an ODA
Goto Forum:
  


Current Time: Sat Oct 25 20:50:25 GMT 2014

Powered by FUDForum. Page generated in 0.02925 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software