Problem in SetParameterValue

IN FastReport.frx
SQL="SELECT * FROM PayCheckDaily WHERE RoomNo=@param1";
and Set Parameter
param1 | DataType=Int
In VS2005

report1.SetParameterValue("param1",2222);
report1.Show();

In the result, param1 can not add to FasReport.frx.
can everybody ask me what problem ? THX

Comments

  • edited 3:29AM
    Hello,

    param1 is query parameter. The report.SetParameterValue method works with *report* parameters. Since there is no easy way to pass a value directly to the query parameter, you need to use the report parameter, which can be easily set via code. You should do the following:

    ?· Create the report parameter in the "Data" window. Set the same DataType for the report parameter, as it is used in the query parameter.
    ?· In the "Expression" property of the query parameter, refer to a report parameter, for example:

    [MyReportParameter]

    ?· Pass a value to the report parameter:

    report1.SetParameterValue("MyReportParameter", 10);

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.