Hi Friends,
I have been using the below code to save my report.
But how to make a report from code behind for a large table.I have referred the following link
http://www.telerik.com/help/reporting/programmatic-control-of-reports.html. Its ok for tables with few columns.I have also seen the code from InitializeComponent() of the designer.cs file.I want everything to work from code behind(Creating report,Assigning SqlDatasource and so on.) Can any one help me.Can any one give a sample code for large table queries. Im not using ReportViewer to see the report.I just want to save my report as file.
Telerik.Reporting.Report report = new Telerik.Reporting.Report();
Telerik.Reporting.SqlDataSource dataSource = new Telerik.Reporting.SqlDataSource();
dataSource.ProviderName = "System.Data.SqlClient";
dataSource.ConnectionString = @"Data Source =(local)\SQLEXPRESS2008;
Initial Catalog=TestDb;Integrated Security=True;Pooling=False";
dataSource.SelectCommand = @"SELECT * FROM [TestTable]";
report.DataSource = dataSource;
Wat to do after this if my 'TestTable from Db 'has more than 20 columns and more rows..Can i use Telerik.Reporting.Table for this??
Regards and Thanks
Titti.S
I have been using the below code to save my report.
void SaveReport(Telerik.Reporting.Report report, string fileName) |
{ |
ReportProcessor reportProcessor = new ReportProcessor(); |
RenderingResult result = reportProcessor.RenderReport("PDF", report, null); |
using (FileStream fs = new FileStream(fileName, FileMode.Create)) |
{ |
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length); |
} |
} |
But how to make a report from code behind for a large table.I have referred the following link
http://www.telerik.com/help/reporting/programmatic-control-of-reports.html. Its ok for tables with few columns.I have also seen the code from InitializeComponent() of the designer.cs file.I want everything to work from code behind(Creating report,Assigning SqlDatasource and so on.) Can any one help me.Can any one give a sample code for large table queries. Im not using ReportViewer to see the report.I just want to save my report as file.
Telerik.Reporting.Report report = new Telerik.Reporting.Report();
Telerik.Reporting.SqlDataSource dataSource = new Telerik.Reporting.SqlDataSource();
dataSource.ProviderName = "System.Data.SqlClient";
dataSource.ConnectionString = @"Data Source =(local)\SQLEXPRESS2008;
Initial Catalog=TestDb;Integrated Security=True;Pooling=False";
dataSource.SelectCommand = @"SELECT * FROM [TestTable]";
report.DataSource = dataSource;
Wat to do after this if my 'TestTable from Db 'has more than 20 columns and more rows..Can i use Telerik.Reporting.Table for this??
Regards and Thanks
Titti.S