Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
creating dynamic colomns in cross tab
ani125
Hi All,
I am new to birt. I will like to create a report which will have a mix of static and dynamic fields as shown below:-
Subj(st.field) ScrinUnittst1 ScrinUnittst2 Student1 Student 2 Student3 ....
Now depending on the student the subject name and score will apprear in the report.
In the main report all the Students name will appear as columns as shown above(the students' names will be retrieved from database) and in the sub report only one students name will appear as the column
So,the report of Student 2 will look like ths:-
Subj(st.field) ScrinUnittst1 ScrinUnittst2 Student 2
I am using dyanmic cross tab to get the main report.However i am not able to get the individual report for a single student.
Anybody having any idea please help.If you can suggest any other approach it will also be helpful.
Thanks,
Aniruddha
Find more posts tagged with
Comments
mwilliams
Hi Aniruddha,
So you are able to get the main report to work already with the setup of:
Subj(st.field) ScrinUnittst1 ScrinUnittst2 Student1 Student 2 Student3 ....
What are the row dimensions and what are the column dimensions? Also, what are the fields ScrinUnittst1 and ScrinUnittst2? Just trying to get an idea of how things are setup and what each thing is to help me suggest the best solution. A screenshot of the main report could also be helpful. Thanks.
ani125
Hi Michael,
Thanks for replying. There are multiple column dimension as in the illustration above namely ScrinUnittst1 (the credit point in unit test 1 ) and ScrinUnittst2( the credit point in unit test 2) and the students name in the main report. The row dimension is the subject associated with each student (not all student have the same subjects) and the marks obtained by them in the respective subjects.
A probable table with data might look like as below(sry not able to provide the screenshots at the moment) :-
ScrinUnittst1 ScrinUnittst2 Student1 Student 2 Student3
Subj(st.field) Grade Grade Grade
Physics 4 3 A Blank B
Chemistry 3 4 B Blank C
History 3 3 Blank A Blank
Geography 4 4 Blank A Blank
...............
Now the sub report of the above main report for Student 1 will look like this:-
ScrinUnittst1 ScrinUnittst2 Student1
Subj(st.field) Grade
Physics 4 3 A
Chemistry 3 4 B
Please look into this and suggest a way out. Also tell me if doing this with a cross tab approach is better or a table appraoach is better.
Click on quote to view the tables properly.
Thanks in advance,
mwilliams
Aniruddha,
Ok. I think I've got an understanding of what you're looking for. I created a quick example using your data, plus an extra student, in a flat file database. The screenshot is attached. Is this what you're wanting? If so, to use a crosstab like this, you'll have to create a computed column in your dataSet that assigns a numeric value to the Grade because the crosstab doesn't understand strings. Then, you write a short bit of script to change it back after the crosstab is created.
For the individual student report, you could create a second report that looks exactly the same only with a parameter that limits the data to just the student you're wanting data on. Or you could do a nicer looking table setup for each individual student report. Either way, you could have the individual reports be drill-throughs of the main report by using the hyperlink feature on the Student field.
Let me know if you have any questions or if my screenshot doesn't quite look like what you're wanting.
ani125
Thanks a lot Micheal for the suggestion.The screenshot that you have provided is exactly what i am looking at my report.This has definitely cleared my doubts.
ani125
I am facing a strange problem. If I add an extra student in the DB(in this case a flat csv file) the extra student name is not getting reflected in the Students columns in the cross tabs. Although the dynamic parameter that i have created and populated with student name from DB is getting updated with the student name list. So when I am selecting the New student name from the parameter window i am getting no records returns for the sub report.Also the detailled report is not adding an extra coloumn for the extra student.Please let me know if cross tabs gets updated with an update in the DB.
mwilliams
Aniruddha,
I added another student to my flat file and it updated just fine in the crosstab. How is your data set up in your .csv file? Also, what version of BIRT are you using? I'm using BIRT 2.3.1.
ani125
Hi Micheal,
I am using Birt 2.2.2 in Eclipse Europa.I have a constrain to use Eclipse Europa.I cannot use Eclipse Ganymede. I have created multiple csv files and have obtained the final dataset (primary dataset for Data cube) after joining all the related datasets. Here is what my flat files Schema looks like
Student file(student_name,studentid),
StudentSubmap(studentid,subjectid,marks),
Subject(subjectid,subject_name),
SubjectCreditmap(subjectid,creditid),
credit_details(creditid,credit_inUT1,credit_inUT2).
The dataset that i am using as the primary dataset for the datacube is also the dataset for populating the dynamic report parameter values.But while the parameter values are getting populated alright the crosstab datacube values are not gettin populated at all with the changes.
Please let me know if this is a problem with the version i am using or i need t make any changes to my schema.Any idea where i am making any mistakes.
Thanks a lot for all the help.
mwilliams
Aniruddha,
I'm just using 1 flat file with all the information already joined. So, my 1 dataSet should look just about like your final dataSet. I'll just have to go back and try to create the same report in 2.2.2 and see if I see what you're seeing. I'll let you know what I find.
ani125
That will be quite helpful.Do let me know what your observations are with birt 2.2.2. Appreciate your help.
Thanks,
Aniruddha
mwilliams
Aniruddha,
In 2.2.2, my report updates as expected in the main report. New students are added correctly and changes in grades are displayed correctly as well. However, the method I used to change the numeric grade back to a letter grade is not available in 2.2.2 it doesn't seem.
I'd have to set up a bunch of flat file dataSets like yours or you'd have to attach all yours and your report design for me to be able to test this exactly how you have it, but like I said, mine updated just fine. Are you running this in the designer? Or are you using the deployed viewer?
ani125
Micheal,
I am able to see the changes now. I had to close the eclipse instance and then re-ran eclipse and then the report to see the changes take effect. Earlier I had ran the report in both preview mode and birt viewer.
However i was not able to get the Grades work so i replaced the Grades with Marks obtained.Do let me know if you find any workaround for this.
Thanks for all the help !!!!
Aniruddha
mwilliams
Aniruddha,
No problem. I'll let you know if I find a way to change the values in the crosstab in 2.2.2. There were several upgrades to crosstabs in 2.3, so the ability to change values in the crosstab is probably only available in the newer releases.