"Steven Cheng[MSFT]" wrote:
> Hello Chris,
>
> Yes, you're right, you can use the ReportViewer Control's "ServerReport"
> property to dynamically customize the report server url and report server
> path if you want to display different report according to different user
> inputs or other conditions.
>
> And the ServerReport.SetParameters method can help programmtically specify
> parameter values for the report. Be careful tha the SetParameters methdo
> accept collection which contains "ReportParameter" class instances. And
> this class can only contains string value based "name/value" paramter pair.
> So if you have any complex object parameter(such as Datetime), you need to
> convert it to string first. For example:
>
> ==========================
> protected void Page_Load(object sender, EventArgs e)
> {
> string reportpath = Request.QueryString["rptpath"];
>
> if (!string.IsNullOrEmpty(reportpath))
> {
>
>
> ReportViewer1.ServerReport.ReportPath = reportpath;
>
> ReportParameter[] pms = new ReportParameter[1];
>
> DateTime date = DateTime.Parse("2005-3-10");
> pms[0] = new ReportParameter("Raw_Date_Param",
> date.ToShortDateString() );
>
>
> ReportViewer1.ServerReport.SetParameters(pms);
>
> ReportViewer1.ServerReport.Refresh();
> }
> }
> ============================
>
> Hope this helps.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
>
> ==================================================
>
> Get notification to my posts through email? Please refer to
>
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif > ications.
>
>
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
>
http://msdn.microsoft.com/subscriptions/support/default.aspx. >
> ==================================================
>
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>