Query Parameter - Report Parameter

epfepf
edited 7:02PM in FastReport .NET
I'm working with FastReport and SQLite database.

With FastReport Design I created a query, and I created 2 parameters for the query. (Query Parameters)
Query1:
SELECT E.CLTE_EMPRESA, E.CLTE_CLIENTE, E.CLTE_NOMBRE
FROM `EPALI_CLIENTE` E
WHERE CLTE_NOMBRE = :parNombre


I have a project in C # .net. From this project I assign value to the parameters and I run a report:
? ? ? ? ? ? ? ? ? ? ? ?  using (Report report = new Report ())
? ? ? ? ? ? ? ? ? ? ? ?  {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  report.Load ("C: \\ temp \\Client-Sucursal2.frx");
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  Report.SetParameterValue ("parNombre" "MARSHALLS");
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  report.Show ();
? ? ? ? ? ? ? ? ? ? ? ?  }

But to launch the report will not return data. (MARSHALLS exists in my database).

Where is the error ??
How is done parameter passing from the application to the query of the report ??
Is it necessary to create the Report Parameters in FastReport Desing??

I just do not understand the use of Query Parameter or Report Parameter.

How the parameters are passed to the query of the report ??

Thanks

Comments

  • edited 7:02PM
    you must Use Event For That I use This way And Work Fine:
      webReport.Report.StartReport += delegate(object sender, EventArgs e)
                    {
                        webReport.Report.SetParameterValue("PersianDate", App_Code.DateTimeConverter.GetPersianDate(DateTime.Now));
                    };
    
  • edited 7:02PM
    epf wrote: »
    I'm working with FastReport and SQLite database.

    With FastReport Design I created a query, and I created 2 parameters for the query. (Query Parameters)
    Query1:
    SELECT E.CLTE_EMPRESA, E.CLTE_CLIENTE, E.CLTE_NOMBRE
    FROM `EPALI_CLIENTE` E
    WHERE CLTE_NOMBRE = :parNombre


    I have a project in C # .net. From this project I assign value to the parameters and I run a report:
    ? ? ? ? ? ? ? ? ? ? ? ?  using (Report report = new Report ())
    ? ? ? ? ? ? ? ? ? ? ? ?  {
    ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  report.Load ("C: \\ temp \\Client-Sucursal2.frx");
    ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  Report.SetParameterValue ("parNombre" "MARSHALLS");
    ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  report.Show ();
    ? ? ? ? ? ? ? ? ? ? ? ?  }

    But to launch the report will not return data. (MARSHALLS exists in my database).

    Where is the error ??
    How is done parameter passing from the application to the query of the report ??
    Is it necessary to create the Report Parameters in FastReport Desing??

    I just do not understand the use of Query Parameter or Report Parameter.

    How the parameters are passed to the query of the report ??

    Thanks


    Firstly Add a report parameter in Report Designer and add value to the report parameter using this

    Report.SetParameterValue ("parNombre" "MARSHALLS");

    Then create the Data connection and after entering the Query Statement , in the next step you need to add a Query Parameter and give a name to it same as the name used in the sql query parameter and set that parameter expression ,and select report parameter.

    Hope this helps you.

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.