Tuesday, March 20, 2012

Requiring / Trapping the View Report button

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?

No comments:

Post a Comment