Search for more than value in report or a web report
I am trying to make a report that will accept more than value in the search box. For example, let users search for more then one serial number at a time. This will save us time when searching for 100 servers that are about to be refreshed. Or if someone has built a website that will connec to the sql server directly and do it from there, maybe can give me some pointer on how to start something like this.
Thanks in advance,
Art
Don't forget if you're using
Don't forget if you're using a Standard field instead of a dropdown or something of that nature you always have the % Wildcard as an option.
- Matt
Sure, No problem
You can do this by using a "Where In" SQL statement, and then feeding the box a comma delimited list of serial numbers. here is an example:
Create a new report and begin by creating a new parameter that will be your input text box. One very important step is to make the value type of the parameter be "None" otherwise it will see it as a string or something else and enclose your value in quotes, breaking your report.
Next, write your SQL (Something like this, %LIST% being the parameter that we created in the step above):
Select [Serial Number],[Asset Type],[Model],[Status] From vAsset Where [Serial Number] in (%LIST%)
Now when you run your report, you give it input like this: '7sf9p81','c0b00b1','4k88v51', where each serial is surrounded by single quots and seperated by a comma. The result is that any in your list will be displayed. It is pretty easy to come up with a script that will take a list of serials and put them in the correct format so you don't have to do the formatting manually. Let me know if you need help with that.
See the screenshots below:
Parameter (Note Value Type is None):

Results:

One more note:
If you are interested in building a web form that lets you connect and query the database directly, let me know. I can help you out. I have done that in the past as well.
Would you like to reply?
Login or Register to post your comment.