I have an ASP.NET WebForms project that uses .NET Framework 4.0 in VS 2013. I'm using Infragistics 14.1.
I've added an Infragistics Report and Report Service. I've also added a data source to the report (via the designer), which queries a view in SQL Server. I followed this tutorial: http://help.infragistics.com/Help/Doc/Reporting/2012.2/CLR4.0/HTML/How%20to%20Bind%20Parameters%20Through%20the%20HTML5%20Report%20Viewer.html So far, so good.
I have dynamic parameters, but at the moment they do nothing and don't affect the query. I want to be able to set the parameters at runtime (to filter the query). I think I could change the Javascript in my .aspx page to pull parameters from the code behind, but I don't want users to be able to generate new reports by changing the Javascript. The report is based on the logged-in user's data and should be generated completely server-side.
I added a Report Data Source Provider (http://help.infragistics.com/Help/Doc/Reporting/2012.2/CLR4.0/HTML/How_to_Change_the_Data_Sources_at_Run_Time_Using_IReportDataSourceProvider.html), but the XML throws errors in my web.config.
Is this even the correct approach? How can I dynamically modify the query in the code behind?
Hello Mark ,
Thank you for posting in our forum.
Thank you for sharing your solution.
Changing the data source at runtime based on some condition can be achieved by adding a Report Data Source Provider to the page and the steps are indeed described in the following link from the documentation :
http://help.infragistics.com/doc/reporting/2014.1/CLR4.0?page=How_to_Change_the_Data_Sources_at_Run_Time_Using_IReportDataSourceProvider.html
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://ko.infragistics.com/support
I created an IEnumerable function that returns data filtered on the user's attributes. I was then able to add it as a Data Source to the report.