ssrs and search parameter with names best practices
What are some 'best practices' when programming a search name parameter? If i had another dataset that selected all distinct locations and a drop down box that populated the report how would i select 'all' locations by default?
SELECT a.[Serial No_], a.[Bit Size], a.[Bit Type], e.Name, e.[Search Name], f.[Document Date], f.[Shortcut Dimension 1 Code] AS Tool, f.[Shortcut Dimension 2 Code] AS District,
f.[Location Code]
FROM [Ulterra Drilling Technologies$Asset] AS a
INNER JOIN [Ulterra Drilling Technologies$Sales Invoice Line] AS d ON d.[Asset Serial No_] = a.[Serial No_]
INNER JOIN [Ulterra Drilling Technologies$Customer] AS e ON e.No_ = d.[Sell-to Customer No_]
INNER JOIN [Ulterra Drilling Technologies$Sales Invoice Header] AS f ON f.No_ = d.[Document No_]
WHERE (f.[Shortcut Dimension 1 Code] IN ('TB', 'CB')) AND (f.[Document Date] = COALESCE (@docDate, f.[Document Date]))
AND (a.[Serial No_] = UPPER(COALESCE (@serialNo, a.[Serial No_])))
AND (a.[Bit Size] = COALESCE (@bitSize, a.[Bit Size]))
AND (a.[Bit Type] = UPPER(COALESCE (@bitType, a.[Bit Type])))
AND (e.[Search Name] = UPPER(COALESCE (@SearchName, e.[Search Name])))
AND (f.[Shortcut Dimension 2 Code] = COALESCE (@dist, f.[Shortcut Dimension 2 Code]))
May 16th, 2011 9:30am
As I understood correctly.
Write a Query for all the parameters like this,
Select 'All'
Union All
Select Distinct Bit_Type From Table
After that, change the main dataset query as
Where (B.Bit_Type IN (@BitType) OR 'All' In (@BitType))
Now you are able to see All in parameter value. It selects everything, when you setup ALL as default value.
For search parameter, I think like is a good operator.
Where BitType Like '%'+@Bittype+'%'
Thanks
Tarak
Free Windows Admin Tool Kit Click here and download it now
May 16th, 2011 2:36pm