SaveToByteArray differs

Stimulsoft Reports.NET discussion
Post Reply
xss
Posts: 64
Joined: Wed Jun 10, 2009 3:03 am
Location: Austria

SaveToByteArray differs

Post by xss »

hi guys,

i just discovered a small inconsistency. i load a report template (.mrt) from a file. now when i call SaveToByteArray() it gives me an byte array with 22767 bytes at 1st call. at 2nd call - u can make it just one statement after - i get an byte array with 22663 bytes?

thanks in advance.

greets xss
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

SaveToByteArray differs

Post by Edward »

Hi

Please show your code and let us know the version of the report engine you used.

Thank you.
xss
Posts: 64
Joined: Wed Jun 10, 2009 3:03 am
Location: Austria

SaveToByteArray differs

Post by xss »

once again i forgot to post the version. :blush: it's 2009.3.600.0

Code: Select all

using (Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport())
{
string filePath = @"D:\Report.mrt";
report.Load(filePath);
byte[] reportData = report.SaveToByteArray(); // here i get 22700 bytes for example
reportData = report.SaveToByteArray(); // and here 22650
}
additionally i set this global statics:

Code: Select all

Stimulsoft.Report.StiOptions.Dictionary.UseNullableDateTime = true;
Stimulsoft.Report.StiOptions.Dictionary.UseNullableTimeSpan = true;
Stimulsoft.Report.StiOptions.Designer.SaveReportWhenDontAskSaveReport = false;
Stimulsoft.Report.StiOptions.Configuration.SearchLocalizationFromRegistry = false;
Stimulsoft.Report.StiOptions.Dictionary.AutoSynchronize = Stimulsoft.Report.Dictionary.StiAutoSynchronizeMode.None;
Stimulsoft.Report.StiOptions.Engine.DefaultEngineVersion = Stimulsoft.Report.Engine.StiEngineVersion.EngineV2;
Stimulsoft.Report.Print.StiPrintProvider.UseEXDialog = true;
and some user defined funtions.

best regards
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

SaveToByteArray differs

Post by Edward »

Hi

The difference is in ReportFile property.
This property keeps the last path was used for saving or loading report.
When you write or load report from stream, that property is set to null, because the stream can not be connected with a file.

Thank you.
xss
Posts: 64
Joined: Wed Jun 10, 2009 3:03 am
Location: Austria

SaveToByteArray differs

Post by xss »

Thank you Edward, i just wanted to ensure that there's no report data definition loss.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

SaveToByteArray differs

Post by Edward »

Hi

No problem, let us know if any help is required.

Thank you.
Post Reply