问题
I notice that if a report has default values specified to all its parameters then it renders automatically on startup. How can I prevent this? that is, I don't want the report to be rendered until the user clicks the 'view report' button
回答1:
There is no way to stop the report rendering if all parameters have default values.
The only way to stop the report rendering automatically is to have at least one parameter without a default value.
回答2:
I have achieved from the below solution:
If you are using ReportViewer its posible to set the property ShowReportBody="False"
. Then on the OnSubmittingParameterValues
event, change the ShowReportBody
property to true. Then you do not need any extra parameters or parameters without default value in the report.
<rsweb:ReportViewer
ID="_rv"
runat="server"
Width="100%"
Height="100%"
ShowReportBody="False"
ShowPrintButton="false"
OnSubmittingParameterValues="rv_SubmitParamValues"/>
And then in rv_SubmitParamValuesmethod
:
this.rv.ShowReportBody = true;
来源:https://stackoverflow.com/questions/6820679/how-to-stop-reporting-services-report-from-rendering-automatically-on-startup