Report Already Compiled
Report Already Compiled
Hi,
First off I would like to say that Stimulsoft Reports is a great tool, and meets all my needs for creating complex documents and reports :feelgood:
Unfortunately, I've come up against a problem:
On my report screen I have added 3 buttons - Generate, Save, and Open.
The Generate button fills various datasets in my report, compiles the report with Compile(), assigns values to report variables, followed by Render() then Show().
The Save button saves the generated report using Report.SaveDocument(FileName)
The Open button loads a previously saved report using Report.LoadDocument(FileName)
My problem is that if I click the Open button to open a previously saved report, then click the Generate button to re-create the original report I get the
"Report Already Compiled" error message on the Compile() statement in my generate function.
Hope you can help.
First off I would like to say that Stimulsoft Reports is a great tool, and meets all my needs for creating complex documents and reports :feelgood:
Unfortunately, I've come up against a problem:
On my report screen I have added 3 buttons - Generate, Save, and Open.
The Generate button fills various datasets in my report, compiles the report with Compile(), assigns values to report variables, followed by Render() then Show().
The Save button saves the generated report using Report.SaveDocument(FileName)
The Open button loads a previously saved report using Report.LoadDocument(FileName)
My problem is that if I click the Open button to open a previously saved report, then click the Generate button to re-create the original report I get the
"Report Already Compiled" error message on the Compile() statement in my generate function.
Hope you can help.
Report Already Compiled
Hi midsomer,
why not just checking the property like
if stireport.iscompiled = false
compile
...
endif
cheers stephan
Btw. Midsomer your name reminds me of Barnaby midsomer.^^
why not just checking the property like
if stireport.iscompiled = false
compile
...
endif
cheers stephan
Btw. Midsomer your name reminds me of Barnaby midsomer.^^
Report Already Compiled
Hi Stephan,
Thanks for the reply.
if stireport.iscompiled = false does stop the error, but then I have a new problem that when the report appears in the viewer the data is missing I only see the elements that are hardcoded in the report design e.g. logo, horizontal and vertical lines etc...
It seems to me that the loaded report from the Open button somehow needs flushing before I generate a new report, but I have found no way to flush a compiled report.
I live in Midsomer Norton, which has no link to Midsomer Murders / Barnaby. I wish I had a pound for every time I'm asked "Is that where all the murders occur" :biggrin:
Thanks for the reply.
if stireport.iscompiled = false does stop the error, but then I have a new problem that when the report appears in the viewer the data is missing I only see the elements that are hardcoded in the report design e.g. logo, horizontal and vertical lines etc...
It seems to me that the loaded report from the Open button somehow needs flushing before I generate a new report, but I have found no way to flush a compiled report.
I live in Midsomer Norton, which has no link to Midsomer Murders / Barnaby. I wish I had a pound for every time I'm asked "Is that where all the murders occur" :biggrin:
Report Already Compiled
Hello,
You can use the following code:
Thank you.
You can use the following code:
Code: Select all
private StiReport report = new StiReport();
private void btnOpen_Click(object sender, EventArgs e)
{
report.LoadDocument("..\\..\\Report.mdc");
report.Show();
}
private void btnGenerate_Click(object sender, EventArgs e)
{
StiReport newReport = new StiReport();
newReport.Load("..\\..\\Report.mrt");
newReport.Compile();
newReport.Render();
newReport.Show();
report = newReport;
}
private void btnSave_Click(object sender, EventArgs e)
{
report.SaveDocument("..\\..\\Report.mdc");
}
Report Already Compiled
Hi Aleksey,
Excellent, your code does exactly what I want. :feelgood:
I have since also discovered that I can use Report.NeedsCompiling = True to achieve the same effect.
Many thanks,
midsomer.
Excellent, your code does exactly what I want. :feelgood:
I have since also discovered that I can use Report.NeedsCompiling = True to achieve the same effect.
Many thanks,
midsomer.
Report Already Compiled
Hello,
Let us know if you need any additional help.
Thank you.
Let us know if you need any additional help.
Thank you.