Page 1 of 1

How to Design a NEW report

Posted: Thu Jul 02, 2009 5:14 pm
by someuser
Hi !

I am trying to design a new report online.

This does not work:

Code: Select all

     StiWebDesigner1.Report = new StiReport();
     StiWebDesigner1.Design();
What do I need to do in order to design a NEW report from scratch ?

Thanks !

Michel

How to Design a NEW report

Posted: Fri Jul 03, 2009 5:09 am
by Jan
Hello,

Can you provide more details about problem? What is not work? Where you call this code?

Thank you.

How to Design a NEW report

Posted: Fri Jul 03, 2009 7:36 am
by someuser
I call this in a ASP.NET page...

Code: Select all

		private void DesignerLoadReport(string reportFile)
		{
			try
			{
				StiWebDesigner1.Report = new StiReport();

				if (File.Exists(reportFile))
				{
					// load report in control
					StiWebDesigner1.Report.Load(reportFile);
				}
				
				StiWebDesigner1.Design();
			}
			catch (Exception ex)
			{
				Master.MsgBox(ex.Message);
			}
		}

If I load a reportFile, it works, but if I want to edit a NEW empty report I get the error:

"Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack."

Not much help and the documentation is really bad...









How to Design a NEW report

Posted: Mon Jul 06, 2009 6:03 am
by Jan
Hello,

Please try to use following code:

Code: Select all

private void DesignerLoadReport(string reportFile)
       {
           try
           {
               if (File.Exists(reportFile))
               {
                   // load report in control
                   StiReport report = new StiReport();
                   report.Load(reportFile);
                   StiWebDesigner1.Design(report);
               }
               else
               {
                   StiWebDesigner1.Design();
               }
           }
           catch (Exception ex)
           {
               Master.MsgBox(ex.Message);
           }
       } 
Thank you.

How to Design a NEW report

Posted: Mon Jul 06, 2009 7:36 am
by someuser
Jan wrote:Hello,

Please try to use following code:

Code: Select all

private void DesignerLoadReport(string reportFile)
       {
           try
           {
               if (File.Exists(reportFile))
               {
                   // load report in control
                   StiReport report = new StiReport();
                   report.Load(reportFile);
                   StiWebDesigner1.Design(report);
               }
               else
               {
                   StiWebDesigner1.Design();
               }
           }
           catch (Exception ex)
           {
               Master.MsgBox(ex.Message);
           }
       } 
Thank you.

So, you mean I do not have to create a new StiReport before calling StiWebDesigner1.Design() method ?

At this point, in the "else" condition, StiWebDesigner1.Report is null...

Thank you, I will try this.






How to Design a NEW report

Posted: Mon Jul 06, 2009 9:07 am
by Andrew
Hello,

If the report is null, then the StiWebDesigner component will create it itself.
To call a report for editing it is necessary to call the Design method with a report as parameter. If to assign previously a report to the component, then, when calling the Design() method, it will be recreated again (this problem is fixed and the patch will be available today in the prerelease build).

Thank you.