If you became a customer of the Syncfusion� Reporting Platform or the Report Viewer, Report Designer, or Report Writer components before October 2019 and have questions related to those products, you can request support through our forum system. However, please note that this support system is only for existing customers who are still using the Syncfusion� Reporting Platform or its components and not for new customers looking for reporting products from Syncfusion�.

For new customers or those with general reporting questions, we recommend contacting our support team at https://support.boldreports.com/, which is a separate brand created by Syncfusion� for its reporting solutions. Our team will be happy to assist you with any questions you may have.

Thank you for choosing Syncfusion� for your reporting needs.

Access restriction to a part of a dataset

Hello All, 

I am working in a school application, where each teacher : 

- can design his own reports using the data of it's students.
- can render reports that shows only the data of it's students.

Do i need to creat separate datasources ?, or can i manage this, the smart way, by editing the query using my code. Or getting ride of the report server and use directly my own db with my own querries.

Happy new year and let the force be with you

5 Replies

YD Yuvaraj Devarajan Syncfusion Team January 2, 2018 03:33 PM UTC

Hi Namec, 

Thanks for contacting Syncfusion support. 

We can achieve your requirement by using query parameter to filter the student record based on teacher name/id with single datasource and we don’t have to create a separate a datasource for each teacher. We can filter the dataset query based on report parameter value (teacher name/id) in dataset property as shown in below screenshot. 
  
 

We have created a Report with our local datasource value and it can be downloaded from below location, 

Please refer to the below MSDN document link for more detail, 

Regards, 
Yuvaraj D. 



NA Namec January 4, 2018 11:15 PM UTC

Thank you for the support, i think that this will do the job.

A last thing to ask :

Can i set up this query parametre programaticly, using my app to pass the ID of the current loged teacher to filter the dataset.

Last but not the least,

Can i also programaticly use my code filter a shared dataset or datasource, to make the report designer also shows filtred data.


VS Vinoth Srinivasan Syncfusion Team January 5, 2018 01:35 PM UTC

Hi Namec, 

Can i set up this query parametre programaticly, using my app to pass the ID of the current loged teacher to filter the dataset. 
We can set/pass the default ID value of the parameter in the control render viewer page (Client side)/ WebAPI (Server side)  as shown in below code example, 

JS: 
    <script type="text/javascript"> 
        $(function () { 
            $("#container").ejReportViewer( 
                { 
                    reportServiceUrl: '/api/ReportApi',                 
                    processingMode: ej.ReportViewer.ProcessingMode.Remote, 
                    reportPath: '~/App_Data/Dependent.rdl', 
                    parameters: [{ 
                        name: 'ReportParameter1', 
                        labels: ['Bikes','Components'], 
                        values: [1,2],                        
                    }], 
                }); 
        }); 
        
    </script> 

WebAPI (Server Side): 
        public void OnInitReportOptions(ReportViewerOptions reportOption) 
        { 
            List<ReportParameter> parameters = new List<ReportParameter>(); 
            parameters.Add(new ReportParameter() { Name = " ReportParameter1", Labels = new List<string>() { "Bikes" }, Values = new List<string>() { "1" } }); 
            reportOption.ReportModel.Parameters = parameters; 
        } 

We have prepared a sample and it can be downloaded from below location, 

Please refer to the below UG documentation link for more detail, 



Can i also programaticly use my code filter a shared dataset or datasource, to make the report designer also shows filtred data. 
We can dynamically edit the report RDL file in code behind, please find the below KB document for more information, 


Regards, 
Vinoth S.


MI MichaelFindlay replied to Namec May 22, 2020 07:38 AM UTC

Hello All, 

I am working in a school application, where each teacher : 

- can design his own reports using the data of it's students.
- can render reports that shows only the data of it's students.

Do i need to creat separate datasources ?, or can i manage this, the smart way, by editing the query using my code. Or getting ride of the report server and use directly my own db with my own querries.

Happy new year and let the force be with you

I think you have just replied to your question yourself.
You can manage your school application by simply editing the query using your code if you know how to do it.




VS Vinoth Srinivasan Syncfusion Team May 25, 2020 05:45 AM UTC

Hi Michael, 

We are not able to understand your query, so could you please update your query clearly to provide the response to you. 

Regards, 
Vinoth S. 


Loader.
Up arrow icon