Designer : preview errors when using parameters

DomiDomi Belgium
edited 8:22AM in FastReport .NET
Hi,

although my reports work fine, I get errors in designer mode when using the preview function :

problem #1 :

with

FReport.SetParameterValue("@Appli.connstring", ConnStr);

I get the following error :

Comments

  • edited 8:22AM
    you didnt read documentation: section "Passing own connection string"
      public class ReportScript
      {
    
        private void _StartReport(object sender, EventArgs e)
        {
          String connection = Report.GetParameterValue("Connection").ToString();
          Report.Dictionary.Connections[0].ConnectionString = connection;
        }
      }
    
  • DomiDomi Belgium
    edited March 2018
    Hi ipong,

    thanks for your fast reply, very appreciated.

    but this doesn't solve the problem (in designer/preview, works fine directly from the app) :

  • edited 8:22AM
    because you send connection string via parameter, therefore, you must open with code, not designer
  • DomiDomi Belgium
    edited 8:22AM
    the designer is called via my application therefore the parameters are sended, it could be fine that the designer takes care of the parameters in the preview mode when it's called from the appli.
  • edited 8:22AM
    i think the documentation quite clear, do not change the connection string via parameter.
    // in my application
    FastReport.Report report = new FastReport.Report();
    report.Preview = previewControl1;            
    report.Load(@"d:\untitled.frx");
    report.Dictionary.Connections[0].ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\data.mdb";
    
    // run designer
    report.Design();
    
    // show in previewcontrol
    report.Show();
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.