I would like to require that the users select the "view report" button
before the report renders.
How can I do that?
Also, can I trap the event for when that button is selected? how/
where?
Thank you.The report only renders automatically if there is either no parameters or if
all the parameters have defaults. You need one parameter that requires user
input to get the behavior you desire.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"jobs" <jobs@.webdos.com> wrote in message
news:1193312927.881290.217200@.k79g2000hse.googlegroups.com...
>I would like to require that the users select the "view report" button
> before the report renders.
> How can I do that?
> Also, can I trap the event for when that button is selected? how/
> where?
> Thank you.
>|||thank you. That makes sense and works great from VS.NET. However, and
this is odd, when make the change to default the two date params to
null and deploy, I continue to get the original defaults that I had
oriiginally. I've cleared my cache, I've even made other cosmetic
changes to make sure i am deploying. It's almost as if somewhere on
the report server it's remembering the last set value. It continues to
automatically load the report with the original default values.
here's part of my xml source, note no VALUES tag:
<ReportParameter Name="iStartDate">
<DataType>DateTime</DataType>
<AllowBlank>true</AllowBlank>
<Prompt>Start Date</Prompt>
</ReportParameter>
<ReportParameter Name="iEndDate">
<DataType>DateTime</DataType>
<AllowBlank>true</AllowBlank>
<Prompt>End Date</Prompt>
</ReportParameter>
Thanks.|||Perhaps I forgot to mention, my issue is through reportviewer over
asp.net.
Also, and maybe this would help, I am also passing some other internal
security related parameters from the codebehind. I'm doing that under
the on load subroutine when postback is false. This code has been
working nicely, but maybe this is what is forcing the report to
render, but somehow i doubt it and agree with your statement about the
empty parameters. the only mystery now is where the report continue to
get the original date values'
as a test, i tried changing the value, reloading, clearing cash, but
the original date defaults of 1/1/2007 and 1/1/2099 continue to come
back. It's just strange.
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
If IsPostBack = "False" Then
Dim Roles() As String =GetRolesForUser(Page.User.Identity.Name.ToString)
Dim cred As New Retailer.ReportServerCredentials("myuser",
"mypassword", "mydomain")
ReportViewer1.ServerReport.ReportServerCredentials = cred
Dim param As New ReportParameter("r_user",
Page.User.Identity.Name.ToString)
Dim param2 As New ReportParameter("r_role", Roles(0))
Dim p() As ReportParameter = {param, param2}
ReportViewer1.ServerReport.SetParameters(p)
ReportViewer1.ServerReport.Refresh()
End If|||Drive deleting the report in Report Manager and re-deploy.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"jobs" <jobs@.webdos.com> wrote in message
news:1193446029.715262.142250@.z24g2000prh.googlegroups.com...
> thank you. That makes sense and works great from VS.NET. However, and
> this is odd, when make the change to default the two date params to
> null and deploy, I continue to get the original defaults that I had
> oriiginally. I've cleared my cache, I've even made other cosmetic
> changes to make sure i am deploying. It's almost as if somewhere on
> the report server it's remembering the last set value. It continues to
> automatically load the report with the original default values.
> here's part of my xml source, note no VALUES tag:
> <ReportParameter Name="iStartDate">
> <DataType>DateTime</DataType>
> <AllowBlank>true</AllowBlank>
> <Prompt>Start Date</Prompt>
> </ReportParameter>
> <ReportParameter Name="iEndDate">
> <DataType>DateTime</DataType>
> <AllowBlank>true</AllowBlank>
> <Prompt>End Date</Prompt>
> </ReportParameter>
> Thanks.
>|||What about the trapping of the click event for "View Report"? Is this
possible?
Showing posts with label event. Show all posts
Showing posts with label event. Show all posts
Tuesday, March 20, 2012
Tuesday, February 21, 2012
ReportViewer's ReportError event handler not firing
Hi.
I want to intercept any errors generated when the report's stored procedure
executes. I've created a handler for the ReportError event but it never
fires.
My web page is in C# and has AutoEventWireup="true". I even tried explicitly
adding a handler...
theReportViewer.ReportError += new ReportErrorEventHandler(explicitHandler);
...but my handlers don't get run.
What have I missed? Is there a property that needs turning on as well as
creating an event handler?
I'm running with VS sp1.
Thanks,
AndrewForgot to say the report is a server report.
Andrew|||Hi Andrew,
From your description, you're wondering how to capture some error raised in
store-procedure(used in SSRS sever report query) in your client ASP.NET
reportviewer,correct?
Based on my research, the ReportViewer control's ReportError event is
implemented as below:
In ReportViewer's rendering code(such as PreRender, or ReportArea's control
creation and rendering methods...), it will wrapper the code with a
try...catch... block and if any exceptions occur, it will check the
"ReportError" event handler and invoke it if registered.
So for your scenario, I think it problem is possible due to the server-side
report's processing is not in reportviewer(but in the server reportserver's
processing engine). Therefore, the related store-procedure error is not
propagate to the client-side reportviewr control and you didn't get the
event raised. To verify this, you can try using a client report and raise
some error in it to see whether the event work. Also, based on my test, if
the report server(server report) not available, it will also raise error.
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.|||Thanks Steven.
I had a poke around with Reflector and was coming to the same conclusion.
Thinking about it, when running async the host page is rendered and returned
whilst the report is still running, so even if the server report errors it
wouldn't have anything to report its error to.
I guess we can always look at the ReportServer log file to see what's
occurred.
Thanks,
Andrew|||Thanks for your reply Andrew,
Yes, your further analysis is also reasonable. Actually, exception
propagating is always quite difficult when dealing with distributed
component or service. Anyway, it is a pleasure to discuss with you on this.
If you meet any other problems later, welcome to discuss here.
Have a nice day!
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
I want to intercept any errors generated when the report's stored procedure
executes. I've created a handler for the ReportError event but it never
fires.
My web page is in C# and has AutoEventWireup="true". I even tried explicitly
adding a handler...
theReportViewer.ReportError += new ReportErrorEventHandler(explicitHandler);
...but my handlers don't get run.
What have I missed? Is there a property that needs turning on as well as
creating an event handler?
I'm running with VS sp1.
Thanks,
AndrewForgot to say the report is a server report.
Andrew|||Hi Andrew,
From your description, you're wondering how to capture some error raised in
store-procedure(used in SSRS sever report query) in your client ASP.NET
reportviewer,correct?
Based on my research, the ReportViewer control's ReportError event is
implemented as below:
In ReportViewer's rendering code(such as PreRender, or ReportArea's control
creation and rendering methods...), it will wrapper the code with a
try...catch... block and if any exceptions occur, it will check the
"ReportError" event handler and invoke it if registered.
So for your scenario, I think it problem is possible due to the server-side
report's processing is not in reportviewer(but in the server reportserver's
processing engine). Therefore, the related store-procedure error is not
propagate to the client-side reportviewr control and you didn't get the
event raised. To verify this, you can try using a client report and raise
some error in it to see whether the event work. Also, based on my test, if
the report server(server report) not available, it will also raise error.
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.|||Thanks Steven.
I had a poke around with Reflector and was coming to the same conclusion.
Thinking about it, when running async the host page is rendered and returned
whilst the report is still running, so even if the server report errors it
wouldn't have anything to report its error to.
I guess we can always look at the ReportServer log file to see what's
occurred.
Thanks,
Andrew|||Thanks for your reply Andrew,
Yes, your further analysis is also reasonable. Actually, exception
propagating is always quite difficult when dealing with distributed
component or service. Anyway, it is a pleasure to discuss with you on this.
If you meet any other problems later, welcome to discuss here.
Have a nice day!
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to:
Posts (Atom)