Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to dynamically create a report in an ASP.NET Web Forms application (with a SQL query as a data source)

$
0
0

Description:
 I need to implement a generic kind of web report viewer to display the result of my SQL query, which accepts some parameters.

Solution:
 This can be done by creating an XRTable control dynamically.

To pass a table name (which is a query parameter), you can use a query string variable. As a result, you can pass the "TableName" parameter as follows:
http://hostname/PassSQLQuery/ReportViewer.aspx?TableName=Customers.

Then, the XtraReport code-behind methods will populate data using the SQL query, which returns all the table rows from the table.
In the final step, an XRTable control is created, and gets bound to the column names of the data table.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>