This is a migrated thread and some comments may be shown as answers.

Dynamic Columns

4 Answers 55 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jake
Top achievements
Rank 1
Jake asked on 22 Apr 2014, 09:07 PM
What's the best way of creating a report with a dynamic number of columns?

For an example let's say I need to get the data of a person who has been scored in different subjects and by different scorers.

Subject      Scorer 1 |  Scorer 2 | Scorer 3...
Sub 1              2               3                6
Sub 2              1               4                4
Sub 3              5               3                1
Total                8               10              11
Max score       10            10               12

I do not know at the start how many subjects there will be or how many scorers there will be.  I also need to have each page of the report have a different person's scores on it.

I have tried using a crosstab, but I can't get the crosstab to page break between each person.  Which through some research it doesn't look like it's possible to page break within a crosstab.



4 Answers, 1 is accepted

Sort by
0
Jake
Top achievements
Rank 1
answered on 24 Apr 2014, 07:03 PM
In order to fix this problem I created individual reports for each person and put all the reports in a reportBook.
0
Stef
Telerik team
answered on 25 Apr 2014, 11:21 AM
Hello Jake,

With proper data organization, where you can group records by person, you can use a single report and a Crosstab item:
  1. Organize the data, so it can be grouped by person
  2. Create a new report and add new group using a data field that distinguishes a person.
  3. Depending on the data structure, you can:
    1. Place a Crosstab item in the GroupHeader/FooterSection and bind it to the ReportItem.DataObject (this will give you the data records associated with the group);
    2. Place a Crosstab in the Detail section and bind it to the collection property of records for the person e.g. ReportItem.DataObject.SubjectsCollectionProperty;
  4. Report sections have a PageBreak property, which can be set also conditionally as in the Conditional Page Breaks KB article.


Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jake
Top achievements
Rank 1
answered on 25 Apr 2014, 01:34 PM
I had already tried something like this.  The crosstab kept combining every person's scores together even though each page of the report was breaking for each person.  It could very well be the datasource I'm using isn't quite formatted correctly.  Thanks for the info.
0
Stef
Telerik team
answered on 28 Apr 2014, 08:50 AM
Hi Jake,

Double-check if the item gets its data only from the binding and reset the assigned directly DataSource property.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Jake
Top achievements
Rank 1
Answers by
Jake
Top achievements
Rank 1
Stef
Telerik team
Share this question
or