yamurkahtan / excellibrary

Automatically exported from code.google.com/p/excellibrary
0 stars 0 forks source link

workbook.Save(string) #109

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.all steps for save a workbook
2.
3.

What is the expected output? What do you see instead?
i want to save a workbook in a stream, and that is not possible.

What version of the product are you using? On what operating system?
last version in the website

Please provide any additional information below.

Original issue reported on code.google.com by gersoncz...@gmail.com on 15 Sep 2011 at 2:32

GoogleCodeExporter commented 9 years ago
For resolve add this line:

stream.Position = 0;

at end of method public void Save(Stream stream) in Workbook.cs:

        public void Save(Stream stream)
        {
            CompoundDocument doc = CompoundDocument.Create(stream);
            using (MemoryStream memStream = new MemoryStream())
            {
                WorkbookEncoder.Encode(this, memStream);
                doc.WriteStreamData(new string[] { "Workbook" }, memStream.ToArray());
                doc.Save();
            }
            stream.Position = 0;
        }

Original comment by silveir...@gmail.com on 18 Sep 2011 at 10:34