Last post Aug 26, 2012 05:30 AM by chandana
Aug 12, 2012 02:57 AM|chandana|LINK
I have created a crystal report & need to find a solution for this problem. Here, company can be dynamically added to database and it should display in the report. But products are standard to report and those are not changed.
Here is the data set
company product price
A A1 10
B C1 5
A C1 12
A B1 3
B B1 2
B D1 3
C A1 4
Then I need to display it in report as following.
company A1 B1 C1 D1 TOTAL
A 10 3 12 0 25
B 0 2 5 3 10
C 4 0 0 0 4
So how can I slove this?
Aug 14, 2012 06:28 AM|Ajay2707|LINK
It is better and simple to make sp in db and make query by PIVOT function which give the result same as you want.
Nothing to be done in crystal report.
Aug 26, 2012 05:30 AM|chandana|LINK
Thanks for idea but I want to create it frontend because if it need to change the DB it cannot do because all the DB not support it. Hovever I did this using a function that convert the dataset data table to mentioned format so the step was
1. create two datatable (static) one consist original table(fill using data adapter) and other just table
2. second table fill using the function at runtime
3. use it in crystal report