Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql Reporting services - find item in report - on load

SQL reporting services has a little search box in the top of the report viewer. When used, it finds the search text, navigates to containing page and highlights the text on the page. My question is how can I do this when the report loads.

Currently I have a reportviewer embedded in my page. Is there a method that will find? I am using sql 2008 express and Dot Net 2

For example I send the serial number 1234 to the report so that when it opens it acts like the user searched for the text and finds it for them in the report.


Ed gave me the answer to the url part. http://server/Reportserver?/SampleReports/Product Catalog&rc:FindString=mystring but I still can't figure out the reportviewer.


Here is some of the page code:

using Microsoft.Reporting.WebForms; 

protected void Page_Load(object sender, EventArgs e)

{
    if (!Page.IsPostBack)
    {
        Int32 iID = Convert.ToInt32(Request.QueryString["ID"]);
        String reportsPath = ConfigurationManager.AppSettings["ReportsPath"];
        String sReportName = "ReportInvoice";

        reportViewer1.Reset();
        reportViewer1.ProcessingMode = ProcessingMode.Remote;
        reportViewer1.ShowParameterPrompts = false;
        reportViewer1.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportViewerUrl"]);
        reportViewer1.ServerReport.ReportServerCredentials = new ReportServerCredentials();//http://localhost/reportserver
        reportViewer1.AsyncRendering = false;
        ReportParameter[] reportParams = new ReportParameter[1];
        reportViewer1.ServerReport.ReportPath = reportsPath + sReportName;
        reportParams[0] = new ReportParameter("invoiceID", iID.ToString());
        reportViewer1.ServerReport.Refresh();
    }
}

Thanks in advance.

like image 434
Praesagus Avatar asked Feb 01 '26 12:02

Praesagus


1 Answers

See this MSDN page (SQL 2005 version, but 2008 is the same, I believe).

like image 97
Ed Harper Avatar answered Feb 04 '26 03:02

Ed Harper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!