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

How to use FileStream as Report Datasource?

1 Answer 212 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 04 Feb 2020, 09:51 AM

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();
                 }

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 07 Feb 2020, 06:43 AM

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
Tags
General Discussions
Asked by
Simon
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or