This is a migrated thread and some comments may be shown as answers.

Telerik Reporting For Saving Files of Large Tables..

3 Answers 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
TSM
Top achievements
Rank 1
TSM asked on 24 Nov 2010, 04:34 AM
Hi Friends,
                   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





3 Answers, 1 is accepted

Sort by
0
TSM
Top achievements
Rank 1
answered on 24 Nov 2010, 10:33 AM
Hi,
     Anyone there to help me ??
        Regards And Thanks,
                 Titti.S.
0
TSM
Top achievements
Rank 1
answered on 25 Nov 2010, 11:26 AM
Hi Friends,
                   Its very disappointing that there is no one to answer me.Can plz any one help me?? Expecting a quick reply...I  want to create my report using sql query and save the report as file.My report may consists of many columns and rows.I want everything to be done using code and by not using Telerik Report Q1 2010 which i has to add and meet the requirements of report.cs Wizard. Now Clear  ????
Regards & Thanks,
Titti.S.
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 25 Nov 2010, 01:07 PM
Titti, generally forums are community driven and Telerik do no guarantee a reply here, although they go through most of them (hey, I know this from experience). So if it is a pressing issue, I suggest to open a ticket. However it seems to me that you've scoured only the docs and have not searched the huge information available here, in the very forum you write in. I just made a quick search for your inquiry and found this topic among many others: http://www.telerik.com/community/forums/reporting/telerik-reporting/report-constructor-runs-3-times-and-values-set-in-between-are-lost.aspx which shows how to create a table with variable number of columns programmatically.

The forums are often underrated, but they contain a lot of useful info, and the chances are that somebody else has already thought of your question and it has been answered here.

Cheers!
Tags
General Discussions
Asked by
TSM
Top achievements
Rank 1
Answers by
TSM
Top achievements
Rank 1
Massimiliano Bassili
Top achievements
Rank 1
Share this question
or