Page 1 of 1

GetReportFromAssembly questions

Posted: Fri Feb 26, 2010 11:53 am
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.


GetReportFromAssembly questions

Posted: Fri Feb 26, 2010 5:54 pm
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.

GetReportFromAssembly questions

Posted: Sat Feb 27, 2010 3:41 am
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.

GetReportFromAssembly questions

Posted: Mon Mar 01, 2010 1:45 am
by Jan
Hello Martin,

Yes you can check NeedsCompiling property.

Thank you.