[Mono-dev] creating excel files
monoman at gmail.com
Mon Feb 28 08:26:43 EST 2011
That is the documented (expected) behavior of Close:
"Saves and closes the package plus all underlying part streams."
And that is a common pattern in all reader/writer classes in .NET.
Hope it clarifies it all,
Rafael "Monoman" Teixeira
"The most exciting phrase to hear in science, the one that heralds new
discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'"
US science fiction novelist & scholar (1920 - 1992)
On Sat, Feb 26, 2011 at 9:04 AM, eng. Ahmed Youssef <ahhatem at gmail.com>wrote:
> Hello everyone,
> Sorry for the late reply but I thought I do my homework first...
> After moving to mono 2.10 on opensuse, I managed to make the library work
> on mono.
> The problem was with this scenario:
> using System;
> using System.IO.Packaging;
> using System.IO;
> namespace test
> class MainClass
> public static void Main (string args)
> MemoryStream stream = new MemoryStream ();
> Package p = Package.Open (stream, FileMode.Create, FileAccess.ReadWrite);
> p.Close ();
> throws this exception:
> Unhandled Exception: System.ObjectDisposedException: The object was used
> after being disposed.
> at System.IO.MemoryStream.CheckIfClosedThrowDisposed () [0x00000] in
> at System.IO.MemoryStream.ReadByte () [0x00000] in
> at test.MainClass.Main (System.String args) [0x00000] in <filename
> the package.Close call internally makes this:
> public void Close()
> for some reason the dispose call disposes the stream too....
> After replacing the package.Close() with package.Flush().... the EPPlus lib
> works nicely....
> I hope that is useful... I don't mind digging into the issue more but I am
> not sure how to do that.... any info would be appreciated.
> I hope you confirm that it is a mono issue and that it will be fixed so
> that either mono is fixed or the library...
> Thank you all for the help.
> On Tue, Feb 22, 2011 at 7:11 PM, jmalcolm <malcolm.justin at gmail.com>wrote:
>> I am not sure how big the spreadsheets are that you need to work with but
>> have used the free version of GemBox to great effect:
>> View this message in context:
>> Sent from the Mono - Dev mailing list archive at Nabble.com.
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list