Page 1 of 1

ImageBytes gets deleted upon calling report.Dispose()

Posted: Thu Aug 04, 2022 11:14 am
by maier.romeo
Hello,

whenever we are opening a report programatically which has a picture inbedded, and call .Dispose() or open it with a using() statement, the ImageBytes inside the report file get deleted.
Is this intended behaviour?

Opening with .Dipose():

Code: Select all

StiReport report = new StiReport();
string reportFile = "C:\dummyfile.mrt";
report.Load(reportFile);
report.Design(false);
report.Dispose();
Opening with using():

Code: Select all

using (StiReport report = new StiReport()) {
    string reportFile = "C:\dummyfile.mrt";
    report.Load(reportFile);
    report.Design(false);
}
Thank you

Re: ImageBytes gets deleted upon calling report.Dispose()

Posted: Fri Aug 05, 2022 1:04 pm
by Lech Kulikowski
Hello,

Yes, that is correct behavior.

Thank you.