本文介绍了报告查看器,可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! < asp:按钮 ID = Button1 runat = server onclick = Button1_Click 文字 = 确定 / > < asp:ScriptManager ID = ScriptManager1 runat = 服务器 > < / asp:ScriptManager > < rsweb:ReportViewer ID = ReportViewer1 runat = server 字体名称 = Verdana 字体大小 = 8pt InteractiveDeviceInfos = (收藏) WaitMessageFont-Names = Verdana WaitMessageFont-Size = 14pt 宽度 = 800px 高度 = 600px 可见 = false > < LocalReport ReportPath = rdlc\absent_form.rdlc > < / LocalReport > < / rsweb:ReportViewer > protected void Button1_Click( object sender,EventArgs e) { var conString = ConfigurationManager.ConnectionStrings [ ConnectionString]; string strConnString = conString.ConnectionString; SqlConnection conn = new SqlConnection(); 使用(conn = new SqlConnection(strConnString)) { if (conn.State!= ConnectionState.Open) { conn.Open(); } ReportViewer1.Visible = true ; } 这是我遇到的问题,当用户按下按钮时,我将reportviewer的设置显示为false ,那么它将变为真,但是它不起作用。我可以知道我是否有任何错误。请帮助.... 解决方案 on page load reportViewer1.Visible = false 和按钮点击 ReportViewer1.Visible = true ; < rsweb:ReportViewer ID = ReportViewer1 runat = server字体名称= Verdana 字体大小= 8pt InteractiveDeviceInfos = (Collection) WaitMessageFont-Names = Verdana WaitMessageFont-Size = 14pt Width = 800px 高度= 600px> ; 不要在HTML中设置Visible =false。 而不是那个集合在页面加载上报告正文可见性并使其在按钮点击事件中可见,如下所示: 页面加载 ReportViewer1.ShowReportBody = false ; 按钮点击 ReportViewer1.ShowReportBody = true ; < rsweb:ReportViewer ID = ReportViewer1 runat = server Font-Names = Verdana 字体大小= 8pt InteractiveDeviceInfos = (Collection) WaitMessageFont-Names = Verdana WaitMessageFont-Size = 14pt宽度= 800px 高度= 600px> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="確定" /> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="800px" Height="600px" Visible="false"> <LocalReport ReportPath="rdlc\absent_form.rdlc"> </LocalReport> </rsweb:ReportViewer>protected void Button1_Click(object sender, EventArgs e) { var conString = ConfigurationManager.ConnectionStrings["ConnectionString"]; string strConnString = conString.ConnectionString; SqlConnection conn = new SqlConnection(); using (conn = new SqlConnection(strConnString)) { if (conn.State != ConnectionState.Open) { conn.Open(); } ReportViewer1.Visible = true; }Here's i get problem, I set the reportviewer's visible as false in the beginning, when the user press the button, then it will turn to true, but however it doesn;t work. May i know if there anything i get mistakes. Please help.... 解决方案 on Page loadreportViewer1.Visible="false"and on Button ClickReportViewer1.Visible = true;<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="800px" Height="600px">Do not set Visible="false" in HTML.Instead of that set Report Body visibility on Page Load and make it visible on button click event as shown below:On Page LoadReportViewer1.ShowReportBody = false;On Button ClickReportViewer1.ShowReportBody = true;<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="800px" Height="600px"> 这篇关于报告查看器,可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-02 17:27