GetReportFromAssembly questions

Stimulsoft Reports.NET discussion
Post Reply
Martin Hart Turner
Posts: 66
Joined: Wed Apr 04, 2007 3:32 am
Location: Spain

GetReportFromAssembly questions

Post by Martin Hart Turner »

Hi:

1) When I load a report directly from an assembly with GetReportFromAssembly, the IsCompiled property is False, does this mean that I have to call Compile()?

2) If I don't need to call Compile() after loading a report from an assembly, how can I test to see if the report was actually loaded from an assembly or via Load()?

3) If I use Stimulsoft.Report.StiReport.GetReportFromAssembly(reportFile, true), what exactly is the final boolean indicating? Is the file locked for other users (concurrent access)?

4) If I want to use a report loaded via GetReportFromAssembly multiple times (with different content), should I call ResetRenderedState() before shoing/exporting the report?

Thanks,
Martin.

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

GetReportFromAssembly questions

Post by Edward »

Hi, Martin,
MartinH wrote:1) When I load a report directly from an assembly with GetReportFromAssembly, the IsCompiled property is False, does this mean that I have to call Compile()?
No, that is not necessary as the report will be already complied.
2) If I don't need to call Compile() after loading a report from an assembly, how can I test to see if the report was actually loaded from an assembly or via Load()?
please check NeedsCompiling property of the report and IsCompiled property too.
3) If I use Stimulsoft.Report.StiReport.GetReportFromAssembly(reportFile, true), what exactly is the final boolean indicating? Is the file locked for other users (concurrent access)?
That means that report will be loaded in memory only once and it will be locked from other users too.
In that case report will be loaded using the following method:
Assembly assembly = Assembly.LoadFrom(assemblyFile);
otherwise using this one:
FileStream assemblyStream = new FileStream(assemblyFile, FileMode.Open, FileAccess.Read, FileShare.Read);
4) If I want to use a report loaded via GetReportFromAssembly multiple times (with different content), should I call ResetRenderedState() before shoing/exporting the report?
Yes, you need to call ResetRenderedState() method each time before the report will be rendered.

Thank you.
Martin Hart Turner
Posts: 66
Joined: Wed Apr 04, 2007 3:32 am
Location: Spain

GetReportFromAssembly questions

Post by Martin Hart Turner »

Edward:

Thanks very much for the information, very useful.

Just one clarification, after loading a report with the GetReportFromAssembly method, the property IsCompiled = false. I haven't checked yet, but is the NeedsCompiling = false? This way I know that I don't need to call Compile().

Regards,
Martin.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

GetReportFromAssembly questions

Post by Jan »

Hello Martin,

Yes you can check NeedsCompiling property.

Thank you.
Post Reply