Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Is it possible to create dynamic datasets and how do I do this?
Is it possible to create dynamic datasets and how do I do this? [message #987272] Sun, 25 November 2012 13:50 Go to next message
Sven Lorenz is currently offline Sven LorenzFriend
Messages: 2
Registered: November 2012
Junior Member
Hi,

I've started to work with BIRT a few month ago and created some reports. I guess you can say it was simple stuff, if you know BIRT for years. I'm facing now the following problem:
I'm creating a statistic which just lists the data it gets from a scripted data source. Normally it would be nothing special, even for me. But this statistic shows the factured contracts from customers with nettotal, grosstotal, taxes and discounts. The discounts are variable. There might be no discount and there can be 10 discounts (or even more). I don't know how much discounts there can be and how much I have to show. The reason is that the customer define them in the software my colleagues had programmed. There is no limit with them. The customer can choose on the gui which discounts he want to see and which not. My idea was to get a counter from the system which shows me how many discounts have been choosen. Then before opening the document of the report I'm adding as many rows as the counter shows me in the dataset. Then I'm adding as many columns in my table as there are new rows in the dataset and filling the columns with the rows of the dataset and filling the rows with the data. The question is...is this possible and how do I do this?

I've added a pdf-file with examples how the statistic shall look like and hope that this shows what I want to ask.
Re: Is it possible to create dynamic datasets and how do I do this? [message #987514 is a reply to message #987272] Mon, 26 November 2012 22:46 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

To me this looks like a table with a nested crosstab that filters a cube on customer number. For the example pdf do you have any example data that you could post in a csv file?

Jason
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 Go to previous message
Sven Lorenz is currently offline Sven LorenzFriend
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

Previous Topic:Iterating detail by page
Next Topic:How do I do multi-select parameter?
Goto Forum:
  


Current Time: Thu Mar 28 19:35:48 GMT 2024

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

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

Back to the top