How to use FileStream as Report Datasource?

2 posts, 0 answers
  1. Simon
    Simon avatar
    77 posts
    Member since:
    Sep 2018

    Posted 04 Feb Link to this post

    Hello,

    in my project I have a function to export data to an excel file.

    I have a filestream object to do this.

    In the same project I have created a report with a table in it.

    And now I want to set the datasource so that the same data will be shown in the report.

    But how can I get this data ?

    Best regards

    Simon

     

    public void ExcelExport(string fileName)
           {
               FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
               gridEXExporter1.Export(fs);
               fs.Close();
                     }
  2. Katia
    Admin
    Katia avatar
    702 posts

    Posted 07 Feb Link to this post

    Hi Simon,

    If you wish to bind the report to the data directly with code the supported data types are arrays, collections, DataSet, DataTable, DataView, and DbDataAdapter. 

    In general, our recommendation is to use DataSource components and to specify declaratively how the data needs to be retrieved. For example, you can convert the Excel file to CSV format and use CsvDataSource component to fetch the data from that file. 

    For additional reference, please check help articles under Connecting to Data section from our online documentation.

     

    Regards,
    Katia
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top