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

Designing the Table

1 Answer 140 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
rohan
Top achievements
Rank 1
rohan asked on 05 Jan 2011, 08:52 PM
Hi,

i need some help designing my table.

I have a DB table have 2 columns with same data and 3rd column with a different data.
I have two such rows.

Now when i print my table in the report I need the report to be displayed as one record itself have the first two columns and the third one with the two different rows merged.

Any help with this would be very much appreciated.

DB Table

col1 col2 col3
AA   BB   CC
AA   BB    XX


I need it to be displayed in the report as

col1 col2 col3
AA  BB    CC,XX

Regards,

Ron

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 07 Jan 2011, 05:58 PM
Hi rohan,

You can achieve the desired layout with our Crosstab item. You can go through the Crosstab Wizard and create a Crosstab with Row Group col1 and for Detail values col2 and col3. After you complete the wizard you can inspect the Crosstab's groups with the Group Explorer to:

  1. add col2 as a grouping to the Crosstab's dynamic group
  2. delete the detail's group empty grouping this way it will became static
  3. add to the col3 expression the sum or the included custom Concatenate aggregate that concatenate the strings with commas, if you have other requirements, you will have to implement your own custom/user aggregate.
Check out the attached sample project that illustrates the above approach.

Generally the User Aggregate Functions allow you to apply custom logic when accumulating values over a set of rows from the data source. They are used by the Telerik Reporting engine as all built-in aggregate functions. Check out the attached sample user aggregate that counts distinct values. Note that we have created a Table Group with grouping expression = Fields.Model and that when Custom Aggregates are used in a report, you may not be able to preview the report in Designer Preview. 

Additionally for better understanding of the Custom Aggregates and if you want create custom ones check the Dynamic Sorting of Reporting Crosstabs Using a Custom Aggregate Function blog article. 

Have in mind that custom aggregates are not supported when you preview the report in Visual Studio. To preview the aggregate output, use a ReportViewer control.

Greetings,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
rohan
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or