Hello:
I have a report created by someone else that works fine at design time. It is very simple report, the query behind it is a command of this form:
select * from SomeView where field in ({?SomeParameter}).
{?SomeParameter} has the following options:
- List of Values: Static
- Value Field = (None)
- Allow custom values = true
- Allow multiple values = false
- Allow discrete values = true
- Allow range values=false
- The rest are default
The values that are fed to {?SomeParameter} are numbers (multiple numbers are comma separated), for instance, 100.
The report was created with CR Designer 11.5. I tested it in CR Designer 11.5 and it works fine, I also opened the report in VS 2013 with CR 13 SP 14 and it also works.
However, when I open the report at runtime using the standard code I found on this forum(load the report, set the connection info, set the parameter value with ReportDocument.SetParameterValue, then open the viewer) the report doesn't run the query and it doesn't display any data. It displays the column headers but no detail data. I checked the open cursors on the server (I am using Oracle) and I don't see the report query anywhere.
Any ideas? Again, I am using CR 13 SP 14. Is this a bug?
One other question that I have is this: Is this the right way to do this, if you want to feed the report a list of manually entered numbers? It seems like a security issue because {?SomeParameter} will be replaced with the values entered by the user. Is CR runtime performing any checks?
Thanks
An update: debugging through the app, I noticed that when the connection information is set on the command the CR runtime executes the query: select * from SomeView where field in () as if the parameter doesn't have any value (even though I assigned a default value). I guess the question is how do I set the connection for a command without firing the command?