![]() Response.AddHeader("Pragma", "no-cache") įoreach (DataColumn column in _dataToProcess. Response.AddHeader("Content-Disposition", "attachment filename=report.csv ") Something like the following would get you started: response.ContentType = "text/csv" Excel can be configured to open those pretty easily. If it's simple data, then just emit a CSV file. ![]() I use the load function in Matlab to read the data however, there is inconsistency as to the the number of datastart and dataend columns and the channel references don't always correspond to the extraction done by my program. NOTE: When in release mode, this does the trick I have a series of data files from experiments that have been converted via LabChart 8 to. OWB.Close(Missing.Value, Missing.Value, Missing.Value) Missing.Value, Missing.Value, Missing.Value, ![]() Missing.Value, Missing.Value, Missing.Value, Missing.Value, DataTable dt = Customers.RetrieveAsDataTable() //commentedįor (int i = 1 i < dt.Columns.Count + 1 i++) BE SURE TO CHANGE THIS LINE TO USE *YOUR* DATATABLE OSheet = (Excel.Worksheet)oWB.ActiveSheet Start Excel and get Application object. But I recommend this one: //Make sure you add this reference and have it imported = "SELECT DISTINCT Company, Address1, Address2, City, State, ZipCode" + Response.ContentType = "application/ms-excel" Response.AddHeader("content-disposition", attachment) = "attachment filename=Report_" + () + ".xls" I have data coming back via the DataReader but what I need help with is how to create the headers and output them, along with the rows of data, to the Excel file. First problem I'm encountering is that there is no DataTable Load method in 1.1. I have succeeded in outputting some sample values from the DataReader. I've got data in SQL Server 2000 and have a HyperLink that goes to a pass-through form whose code-behind will output the data to an Excel file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |