How to Design a NEW report

Stimulsoft Reports.WEB discussion
Post Reply
someuser
Posts: 3
Joined: Thu Jul 02, 2009 5:10 pm

How to Design a NEW report

Post 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
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How to Design a NEW report

Post by Jan »

Hello,

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

Thank you.
someuser
Posts: 3
Joined: Thu Jul 02, 2009 5:10 pm

How to Design a NEW report

Post 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...








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

How to Design a NEW report

Post 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.
someuser
Posts: 3
Joined: Thu Jul 02, 2009 5:10 pm

How to Design a NEW report

Post 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.





Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

How to Design a NEW report

Post 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.
Post Reply