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

How can I design a repeating crosstab report

2 Answers 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 27 May 2010, 04:32 PM
Hello community,

I have a question about creating a crosstab report and wanted to get the community's thoughts before submitting a request ticket.  First off, the data is structured in the following format:

Category    Subcategory    Item        Value
January        1                       Apple       100
January        1                       Orange    50
January        2                       Apple       300
January        2                       Orange    75
February      1                       Apple       95
February      1                       Orange    60
...

The report needs to look like this:
January    Sub 1    Sub 2
Apple         100        300
Orange      50          75
February  Sub 1    Sub 2
Apple         95          ...
Orange      60          ...
...

The biggest restriction to this report is that the data is retrieved from a web service in this format, all at once.  Each category to me looks like a crosstab of Subcategory, Item, and Value, such as:
[=Category?]            [="Sub " + Fields.Subcategory]
[=Fields.Item]           [=Avg(Fields.Value)]

Though, I'm unsure how to repeat this cross tab for each category using the same data.  Assigning the corner [=Fields.Category] doesn't work (which makes sense but I'm not sure how to make it work.  Any help would be greatly appreciated.

2 Answers, 1 is accepted

Sort by
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 28 May 2010, 02:38 PM
This looks quite like the crosstab demo from the online examples: http://demos.telerik.com/reporting/product-sales/demo.aspx
where Catagory is ProductCategory, Item is ProductSubCategory, Subcategory values are the year quarters. I'm not sure what repetition you talk about - all the categories along with their sub items would be dynamically listed from your first database row to the last.

Cheers!
0
Aaron
Top achievements
Rank 1
answered on 28 May 2010, 04:24 PM
Hey Massimiliano Bassili,

Thanks for you reply!  It is very similar to the Example ProductList report, with one small difference in which the Category is the actual header for the subcategory, instead of a separate column in itself.

I was hoping maybe this could be achieved using a list, but I find it's easier to just create a subreport for each category programmatically, where the subreport contains the crosstab for the subcategory data and have the corner be a label of the Category.

Unfortunately we don't obtain the webservice data until the report is requested, so the report has to be built programmatically on "NeedDataSource".  I'm not sure if this the most optimal way to go about it, but it works.

If you have any other ideas, please feel free to share! :)
Tags
General Discussions
Asked by
Aaron
Top achievements
Rank 1
Answers by
Massimiliano Bassili
Top achievements
Rank 1
Aaron
Top achievements
Rank 1
Share this question
or