Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-use web service response across datasets or subreports

I'm using a web service as my XML datasource which returns entities including multiple hierarchical data like below (codes modified for project privacy);

public class UserData {
    // some scalar properties
    public string Id ...
    public string Name ...
    public string Surname ...

    // some navigational properties
    public Address address ...
    public CourseInfo[] courses ...
    public AwardInfo[] awards ...
}

To show all the entity information inside the same report, I can create different datasets in my report to call my web service and filter preferred parts of the returned service response.

To get only UserData properties:

<Query>
    <Method Name="GetUserData" Namespace="UserApp.ReportingServices"/>
    <SoapAction>UserApp.ReportingServices/IReportingService/GetUserData</SoapAction>
    <ElementPath IgnoreNamespaces="true">GetUserDataResponse{}/UserData</ElementPath>
</Query>

To get Address information together with UserData properties:

<Query>
    <Method Name="GetUserData" Namespace="UserApp.ReportingServices"/>
    <SoapAction>UserApp.ReportingServices/IReportingService/GetUserData</SoapAction>
    <ElementPath IgnoreNamespaces="true">GetUserDataResponse{}/UserData/Address</ElementPath>
</Query>

To get course information together with UserData properties:

<Query>
    <Method Name="GetUserData" Namespace="UserApp.ReportingServices"/>
    <SoapAction>UserApp.ReportingServices/IReportingService/GetUserData</SoapAction>
    <ElementPath IgnoreNamespaces="true">GetUserDataResponse{}/UserData/Courses/CourseInfo</ElementPath>
</Query>

My question raises right here: If I use multiple dataset queries like above, my report will make a web service call for every dataset it has though my service always returns the same XML response which includes all the data needed for the three datasets above.

Is there any way to re-use returned XML response of a query for the other datasets? If it would possible, my report would call the web service only one time, and datasets would filter different parts of that XML response without calling the web service again and again.

If this is not possible, than what's the best practice about showing multiple hierarchical data inside the same report? Do I have to create different web services returning different hierarchical parts of the data?

like image 496
Hasan Avatar asked Nov 25 '25 18:11

Hasan


1 Answers

Reporting Services datasets are limited to a simple table of rows and columns - they can't handle data with multiple hierarchies as you have described.

I would redesign your web service to reflect this, probably splitting it into the three sets of data you described. Then there will be three web service calls, but without the duplication of content. They will also be executed in parallel which will probably be more efficient overall than your current design.

like image 64
Mike Honey Avatar answered Nov 28 '25 16:11

Mike Honey