How to make a merge cell in dynamic table/Crosstab? (Multi Column)

2 Answers 93 Views
CrossTab General Discussions Table
Siriwat
Top achievements
Rank 1
Iron
Siriwat asked on 26 Dec 2023, 03:41 AM

Hello.

I need you help please. I make report by Telerik Report Designer. i can make report is normal table but i need merge cell multiple column follow "Case_Problem.png". i need result follow "Nedd_Result.png".

I have Report.trdx in Report.zip, inside report have mock data source.

2 Answers, 1 is accepted

Sort by
1
Accepted
Todor
Telerik team
answered on 26 Dec 2023, 12:57 PM

Hello Siriwat,

I confirm that the desired layout is achievable with Telerik Reporting. I have attached your report modified to display the table based on the image 'Need-Result.png'.

You may use Table Row Groups for the grouping in the left part of the table. I added a Crosstab with grouping on 'questName', 'questDetail', and 'risk' as the Crosstab Wizard creates the corresponding groups automatically.

The rest of the groupings are mimicked through table borders and proper Expressions for the values, so there are no duplications. The idea is to set all Bottom borders to 'None' initially and set conditionally the Top border of a repeated value to 'None' and the border of a new value to 'Solid'. A similar expression is used also to set the cell Value to an empty string for a repeated value and to the corresponding fields for a new value. Here are the two expressions for the last column 'responsibility Agency':

Style > Border > Top
= If(Previous(Fields.responsibilityAgency) is Not Null, (Fields.responsibilityAgency = Previous(Fields.responsibilityAgency)) ? 'None' : 'Solid',
	If(Previous('risk', Fields.responsibilityAgency) is Not Null, (Fields.responsibilityAgency = Previous('risk', Last(Fields.responsibilityAgency))) ? 'None' : 'Solid',
	If(Previous('questDetail', Fields.responsibilityAgency) is Not Null, (Fields.responsibilityAgency = Previous('questDetail', Last(Fields.responsibilityAgency))) ? 'None' : 'Solid', 'Solid')))

Value
= If(Previous(Fields.responsibilityAgency) is Not Null, (Fields.responsibilityAgency = Previous(Fields.responsibilityAgency)) ? '' : Fields.responsibilityAgency,
	If(Previous('risk', Fields.responsibilityAgency) is Not Null, (Fields.responsibilityAgency = Previous('risk', Last(Fields.responsibilityAgency))) ? '' : Fields.responsibilityAgency,
	If(Previous('questDetail', Fields.responsibilityAgency) is Not Null, (Fields.responsibilityAgency = Previous('questDetail', Last(Fields.responsibilityAgency))) ? '' : Fields.responsibilityAgency, Fields.responsibilityAgency)))

For the other columns, you need to change only the name of the field.

I used the Previous Data Function to check whether the value repeats with the previous one. Note that when the value is the first for the current group, it has to be compared with the last one from the previous group in the parent scope.

Here is how the Crosstab looks locally when rendered with the Standalone Report Designer:

The columns with the background color indicate the autogenerated table row groups.

Regards,
Todor
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
0
Siriwat
Top achievements
Rank 1
Iron
answered on 27 Dec 2023, 09:20 AM

Hello Todor,

Great! This solution is very work for me.
Thank you.
Tags
CrossTab General Discussions Table
Asked by
Siriwat
Top achievements
Rank 1
Iron
Answers by
Todor
Telerik team
Siriwat
Top achievements
Rank 1
Iron
Share this question
or