Shared DataSources/DataSets in the Web Designer

Posted by: jrector on 18 May 2022, 1:31 pm EST

    • Post Options:
    • Link

    Posted 18 May 2022, 1:31 pm EST

    Is there a way to create shared JSON DataSources/DataSets in the web designer so we can use them in multiple reports with out having to add them manually to each report?

  • Posted 19 May 2022, 7:09 am EST

    Hello Jeffery,

    Yes, you can add shared datasets in your web designer application. For this please follow the following steps:

    1. First, Create a Shared Data Source(RDSX). Please refer to the To create a shared data source section of the Work with Local Shared Data Sources page of our documentation. https://www.grapecity.com/activereportsnet/docs/latest/online/work-with-local-shared-datasource.html

    2. Instead of setting the DataSource.ConnectionProperties property in the dataset json file in your Web Designer Application, you need to set DataSource.DataSourceReference to the path of the shared data source file(.rdsx) created in the first step as below:

     "DataSource":  
     {
     "Name": "NorthwindCategories",
         "DataSourceReference": "../../datasets/NWind.rdsx"
    }
    
    

    Please to the following sample application:

    https://drive.grapecity.com/?path=ExternalShare/CE/ForumShared%20DataSources-DataSets%20in%20the%20Web%20Designer

  • Posted 19 May 2022, 11:08 am EST

    Either I’m not understanding your response or I didn’t ask my question plainly enough.

    We are using multiple remote API services that return JSON data. In the Angular Report designer you can add those endpoints as JSON data sources. We want to be able to add those end points once and have them show up in the report designer instead of having to add the JSON data source every time.

    We do NOT want the JSON data to be a local file. We want to reach out to the API service each time the report is run to get the JSON data.

  • Posted 26 May 2022, 7:09 am EST

    Hello Jeffrey!

    It seems I might have confused your request of have a DataSet preset with our Shared Data Source feature. Shared data source adds a layer between the report and the actual data source to hide the connection details.

    If you want to add data sets to the designer that can be used by multiple reports then you need have to create a class for IDataSetsService and add the DataSet service to Designer Services using the method ConfigureServices() in the Startup.cs

    Please refer to our WebDesigner_Angular_Core Sample: https://github.com/activereports/WebSamples16/tree/main/WebDesignerSamples/WebDesigner_Angular_Core

    In the above sample see the script FileSystemDataSets.cs, class FileSystemDataSets is used to get DataSets’ presets from the datasets folder in the project.

    The Json files in datasets folder contains dataset proeprties such as DataSource name, CommandText, Schema, Provider and Connection String which is used to get the data.

    Also instead of saving DataSet Presets in files you can also create and a different IDataSetsService Class to get dataSet presets from your database. I have created a sample application demonstrating this approach. In the attached sample I am getting the preset from a GitHub repository.

    Also Please note the connectionString in the DataSet is “jsondoc=URL” to get the dataSet from the selected URL. You can use a similar connection string in your DataSets to get data from your API.

    Let us know if I have still not resolved your issue.WebDesigner_Angular_Core ApiDataSet.zip

  • Posted 26 May 2022, 9:45 am EST - Updated 30 September 2022, 4:25 pm EST

    I think I’m still confused. What we are currently having to do is on every report that uses, lets say the invoice api, which takes in parameters for a date range, we have to add it to the report like below:

    What we want is for that datasource (and others) to be prepopulated in the Datasource list when ever we open the designer to create a report.

  • Posted 31 May 2022, 7:26 am EST

    Hi Jeffrey,

    The above reply I have given is for adding dataset presets which would provide the user option to add pre-defined datasets in the report with few clicks.

    If you want to add data sets/data sources to the report automatically on report load. You would have to use a custom resources service for ActiveReports Web Designer.

    To learn more on this please refer to the following page of our documentation.

    https://www.grapecity.com/activereportsnet/docs/latest/online/webdesigner_customstore.html

    I have edited our WebDesigner_CustomStore sample such that every time a report is loaded a DataSource, DataSet and a Parameter is added in the report. I have attached the edited sample along with. In the attached sample please refer to the GetReports() method in …Implementation\CustomStore\Reports\CustomStoreReports.cs script.

    If you want to change the designer option of Blank RDL Report, Blank Page Report then the suggest way of doing this is to disable the default file menu, so the blank templates won’t be available and add the custom new report button if it is required.

    Please refer to the following line of code to disable the fileView:

    designerOptions.fileView.visible = false;

    Original Sample: https://github.com/activereports/WebSamples16/tree/main/WebDesignerSamples/WebDesigner_CustomStore

    Regards,

    AkshayWebDesigner_CustomStore.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels