|
|
Re: Is it possible to create dynamic datasets and how do I do this? [message #989445 is a reply to message #987272] |
Thu, 06 December 2012 09:22  |
Sven Lorenz Messages: 2 Registered: November 2012 |
Junior Member |
|
|
Hi Jason,
first thanks for your answer and sorry for the late reply.
We've managed to go another way which solved the problem with the discounts. Well it is a very "dirty" way I'd say. We've added more detail rows and putted the discounts there. The amount of the discounts is at the moment fix so you can show at least 30 discounts with this. So the dataset columns are fix, too. I think that you can change this to make this variable, but we've got not much time left and would change this later when it's necessary. I post the code of the part which does the trick. Maybe you can see any way to modify it.
lstDiscount = lstStatistic.get(count).getListDiscountPrintAdapter();
if (lstDiscount != null) {
for (discount=0; discount < lstDiscount.size(); discount++) {
if ( discount >= 30) {
break;
}
row["columnDiscount"+discount] = lstDiscount.get(discount).getFinalDiscountAbsolute();
row["columnDiscName"+discount] = lstDiscount.get(discount).getName();
}
}
Oh and a very dumb question from myside...you can see the discounts on the pdf file. These are different dataset columns. How can I sum up them and display the sum in another column? I tried some ways and well they failed...like these:
row["columnSumDiscount"] = row["columnDiscount1"] + row["columnDiscount2"];
row["columnSumDiscount"] = row["columnSumDiscount"] + lstDiscount.get(discount).getFinalDiscountAbsolute();
row["columnSumDiscount"] = sum(row["columnSumDiscount"] + lstDiscount.get(discount).getFinalDiscountAbsolute());
[Updated on: Thu, 06 December 2012 09:26] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01974 seconds