Changes in SSRS 2005 FindString HTMLViewer Command (URL Access)

In SQL Server 2000 Reporting Services, you could use the rc:Findstring command to find and highlight a string inside an HTML report.

 

In 2005, the Report Viewer control is now used to display HTML reports in Report Manager and via URL Access. As a result, the behavior of FindString has changed.

 

Books Online 2005 has the following example of using FindString (ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rptsprg9/html/6f3410c4-7944-448f-bae8-bab3e8152d46.htm):

 

https://server/Reportserver?/SampleReports/Product Catalog&rs:Command=Render&rc:StartFind=1&rc:EndFind=5&rc:FindString=Mountain-400

 

If you fix this string up a bit (name your server and point to the right report folder) to make it look like so, you'll find it doesn't work, however:

 

https://localhost/Reportserver?/Adventureworks Sample Reports/Product Catalog&rs:Command=Render&rc:StartFind=1&rc:EndFind=5&rc:FindString=Mountain-400

 

Donovan Smith enlightened me on the following:

 

  • The Report Viewer control essentially ignores FindString
  • If you turn the toolbar OFF (rc:Toolbar=False), then the HTML renderer picks up the FindString DeviceInfo tag
  • Even after you turn off the toolbar, you must ALSO provide the page number on which you want to search using rc:Section=<pageno>

 

So, assuming we want to find the string "Mountain-400", and we know that the value lives on page 4, we'd do this:

 

https://localhost/Reportserver?/Adventureworks Sample Reports/Product Catalog&rs:Command=Render&rc:ToolBar=False&rc:Section=4&rc:FindString=Mountain-400

 

This still begs the question of what to do if you don't know ON WHAT PAGE a particular string will be found...If you don't, you must first use the SOAP ReportExecutionService.FindString Method against your report which will return the page number on which the string can be found...Then, you plug this information into your URL Access String.