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
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
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);