To show the multiple table for the multivalue parameter

1 Answer 54 Views
Grouping Report Designer (standalone) Report Viewer - MVC Table
Prabesh
Top achievements
Rank 1
Prabesh asked on 13 Jan 2025, 12:09 PM | edited on 14 Jan 2025, 11:27 AM

Hi Telerik, 

I am having a problem using a multi-value parameter and i m using Standalone Report Designer. I am using a web service data source (2-step API) to show the table according to the ClientID as a parameter.

My requirement: 
Use the multi-value parameter as a ClientID and show the separate table for each selected ClientID on one page or separate pages.
Suppose: 
There are 1-6 ClientIDs, and each ClientID has different data.

For the ClientID 1 
Name       Address    phone   Email
abc            asddad      2123       asdas@abc.com
sdf            asdad          548        sada@abc.com

For the ClientID 2 

Name       Address    phone   Email
qwwe         qwe          222      qww@qwwq.com
zxxc            zxc            5768        vcv@zxc.com

So, if I select ClientID 1 in the filter, then it should show the table data according to ClientID 1, and when I select 2 ClientIDs, i.e., 1 and 2, 
Then the report should show the two tables just like above. But what I faced was 
I am getting all the data in one table like this:
Name       Address    phone   Email
abc            asddad      2123       asdas@abc.com
sdf            asdad          548        sada@abc.com
qwwe         qwe          222      qww@qwwq.com
zxxc            zxc            5768        vcv@zxc.com

 -- I have used grouping as Fields.ClientId and Multi-value for ClientID 
 -- Placed the table inside GroupHeaderSection 

Also tried another setup, but I am still getting data in one table; I need a separate table for the selected ClietID in on one page/separate page.
And when I try to use JsonDataSource, my requirement works, but in Web Service Data Source it doesn't work. Why?

-- Is there any way to fulfill the requirement?

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 14 Jan 2025, 01:40 PM

Hello Prabesh,

I confirm that the recommended approach is to use Report Groups goured by '=Fields.ClientId'. You should filter the Report data by the values of the Multivalue Report Parameter 'ClientID'. Note that the Value of the latter is an array, so you should filter with a Filtering Rule like:

= Fields.ClientId     In     = Parameters.ClientID.Value

The Table DataSource may be set with Bindings to ReportItem.DataObject Global Object to reuse the group instance data.

Does the WebServiceDataSource return the same data with the same schema as the JsonDataSource? If so, I don't see a reason for them to behave differently. The Reporting Engine cares about the data schema and not where it comes from.

If the problem persists you may open a support ticket and send us a runnable report, including data for investigation.

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/.
Prabesh
Top achievements
Rank 1
commented on 15 Jan 2025, 09:13 AM

Hi Todor,

Thank you for replying. I have tried that about the Filtering Rule but still that doesn't work and maybe it depends on data format how API will send.
Let me explain about another report issue that I am designing and:

I have this API:

http://localhost:...../api/Participant/XYZ

If I don't pass the the encClientId (encryptedClientId) in the query string, then it will give me the data for all the encClientId

and If I pass the enClientId like this then it will give me the data for that provided encClientId

http://localhost:...../api/Participant/XYZ?encClientId=_EICc8mvaz_f62OpbNP1pw==

and also this API also handles for multiple encClientId as well like this:

http://localhost:...../api/Participant/XYZ?encClientId=_EICc8mvaz_f62OpbNP1pw==,34sTwA6hW_3DJINxfUa9kA==

 

And suppose I am creating a cross table using this API with the filter as encClientId

Set up::
-- Report parameter – EncClientId – MultiValue -- True

-- Main Report – API – above API – added filters: = Fields.encClientId In = Parameters.encClientId.Value  

-- Added a group – where grouping: Fields.encClientID

   And Filters in Group: = Fields.encClientId In = Parameters.encClientId.Value  

 

When I select _EICc8mvaz_f62OpbNP1pw==

This is the cross table for the EncClientId = _EICc8mvaz_f62OpbNP1pw==

When I select two EncClientId

_EICc8mvaz_f62OpbNP1pw==, 34sTwA6hW_3DJINxfUa9kA==

 It is giving me two table okay but I am getting data of 1st EncClientId in both table and if I put other textbox area then textbox is getting filtered and grouped according to the selected encClientId but the cross table is not filtering and grouping according to the EncClientId

Suppose

I have Total User and Total Participant in the textbox are above the table

In first page:

For EncClientId = _EICc8mvaz_f62OpbNP1pw==

Total User      Total Participant

44                     444


For EncClientId = 34sTwA6hW_3DJINxfUa9kA==

 For second page:

Total User      Total Participant

78                     47

 

 

Here's the docs of the explanation: https://docs.google.com/document/d/1Ap-WGBcaW8qONU-ujk1AOLRhyheazfCw/edit?usp=drive_link&ouid=108669934715523036634&rtpof=true&sd=true

Regards,
Prabesh 

Todor
Telerik team
commented on 20 Jan 2025, 07:20 AM

Hi Prabesh,

Thank you for the detailed descriptions and the screenshots.

If I understood correctly, the report shows the data and the Crosstabs (their count) as expected. The data in the Crosstabs is not correct though, and they always show the data for the first selected ID.

How do you set the DataSource for the Crosstab? Did you use Bindings to ReportItem.DataObject Global Object to reuse the group instance data as suggested? Note that this Binding will guarantee the Crosstab in the corresponding group uses the group data that is already filtered. If you set the Crosstab DataSource to the WebServiceDataSource component, it will always (in each group instance) use the whole data, hence the data may be duplicated as currently observed.

You may also send us a runnable report definition, including sample data for preview purposes for investigation.

Prabesh
Top achievements
Rank 1
commented on 21 Jan 2025, 04:49 AM | edited

Hi Todor, 

Thank you for replying.

I think I have found the issue about getting the duplicated data even after I select multiple encClientId. It is because how the api is handle and how the data is retrieved according to the encClientId.

So, instead of using Get method I have used Post Method and set up like this:

 

Using this method, this will set up will call the API like below for the multiple selected encClientId:
http://localhost:50023/api/Participant/GetSentCountMonths?encClientId=_EICc8mvaz_f62OpbNP1pw==,34sTwA6hW_3DJINxfUa9kA==


I can't share the 2-step authentication screenshot because of confidential key and if you are using multivalue parameter above set up is required, yes? I mean that join part in the body part.

and now I faced another problem here:
Now, when I select two encClientId then I do get the data for selected encClientId but I get table like this: (combined table) now I need to split the table according to the encClientId

This is in the first page and in the second this same table is displayed
Now what I need is 
In first page: I need cross table for one encClientId
In Second Page: another cross table for another encClientId and so on 

and This is my set up while desigining:


And this is the set up for Report Parameter:


Also, that table is inside GroupHeaderSection 

Prabesh
Top achievements
Rank 1
commented on 23 Jan 2025, 05:03 AM

Hi Todor,

Thank you for your understanding and support throughout the process. Your help during the design phase was invaluable, and I truly appreciate how collaborative and engaged you've been in helping me navigate the challenges we faced.

I'm also pleased to inform you that I have found the solution to the issue. I have tried to create a separate report for the crosstab and set a single value parameter for the crosstab. In the main report, I have used a sub-report for the crosstab and set the parameters for the clientId and year. Using this way, the multi-value in the main report and the single value in the other report work as my requirement.  

Thanks to your guidance and support.

Todor
Telerik team
commented on 23 Jan 2025, 02:45 PM

Hello Prabesh,

Thank you for the update and for sharing your solution with us and our community.

Tags
Grouping Report Designer (standalone) Report Viewer - MVC Table
Asked by
Prabesh
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or