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

Crosstab by using Web Service data source

2 Answers 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sg
Top achievements
Rank 1
Veteran
sg asked on 14 Aug 2020, 08:54 AM

Hi,

I am using Web Service data source to generate a report with Crosstab. 

Below is my sample data from Web Service:

{
    "totalCount": 3,
    "dataSet": [
        {
            "Department": "Dept1",
            "Type": "Type1",
            "Amount": "10"
        },
        {
            "Department": "Dept1",
            "Type": "Type2",
            "Amount": "50"
        },
        {
            "Department": "Dept2",
            "Type": "Type1",
            "Amount": "15"
        }
    ]
}

It supposed to generate 2 columns and 2 rows in Crosstab, but it shows only first record and in Grand total column, it is showing 2 grand total in same column. (Please refer to my screenshot)

I also attached my datasource binding and fields in Crosstab.

Please help.

Thank you.

 

 

2 Answers, 1 is accepted

Sort by
0
sg
Top achievements
Rank 1
Veteran
answered on 19 Aug 2020, 08:39 AM
Have found the rootcause of the issue. After I added both column and row group in Crosstab, the records display correctly now.
0
Yana
Telerik team
answered on 19 Aug 2020, 09:17 AM

Hello,

A possible approach to handle the scenario is to use JSONPath to filter the received data and set directly the nested array as a data source to the CrossTab. Please find attached a sample report showing exactly what I mean.  I used JSONDataSource for the example with inline json data.

Give it a try and let me know if you have any additional questions on this.

Regards,
Yana
Progress Telerik

Tags
General Discussions
Asked by
sg
Top achievements
Rank 1
Veteran
Answers by
sg
Top achievements
Rank 1
Veteran
Yana
Telerik team
Share this question
or