I have a problem when saving a workbook to a stream in this case using
Workbook.save(memorstream, fileformattype.csv)
When converting the memory stream to bytes and writing this to file I get a single line file which can not be read by Excel or even in notepad. I am using version 4.1.2.1 In my case I am doing the conversion on server sending the bytes back over webservice and then converting the bytes to file. Even if I remove the webservice as in the example bellow I get the same problem.
Here is a simple example of what I am doing.
Dim mstream As New System.io.MemoryStream
With mstream
workbooktemp.Save(mstream, FileFormatType.CSV)
Dim oBytes(CInt(mstream.Length)) As Byte
mstream.Read(oBytes, 0, oBytes.Length)
Dim fs As New System.IO.FileStream("c:\testcsv", IO.FileMode.CreateNew)
HI, I have tried the latest versions with the same result.
I am populating the worksheet from a data table.
The data table has around 35000 rows in it and 100 columns.
If I do workbook.save(filename, fileformatType.csv) it saves the file ok, but in this case I do not want to have to save the file first, before converting it into bytes to send to the client.
I have also tried doing this for 1 record of data and it appears as though the memory stream does not contain the correct encoding characters for ASCII, perhaps this is the problem.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.