通过尝试第二次查看报告,“报告查看器缩放”部分出现问题

时间:2020-09-01 19:26:46

标签: vb.net vb.net-2010

我有此表单和一个报表查看器控件来显示我的报表,输入parameres后我运行该项目以检索报表,所有选项(例如打印,保存,放大/缩小)和其他选项均能正常工作,但唯一的问题是当我从[整个页面]视图放大报表并使用此设置(放大)大小关闭表单,然后再次打开该表单并第二次查看该报表时,放大,我无法向上或向下滚动以查看整个页面,并且缩小选项无法回答,以下是我的代码...

Private Sub VieReportButton_Click(sender As Object, e As EventArgs) Handles rptViewbtn.Click
Try
   Dim rds As New ReportDataSource("DataSet1", spGLstatementBindingSource)
   rvControl.LocalReport.DataSources.Add(rds)
   rvControl.LocalReport.ReportEmbeddedResource = "Beans.GLstatement.rdlc"
   Dim command As New SqlCommand("Execute spGLstatementInfo '" & prm2.Text & "', '" & prm1.SelectedValue & "' ", connection)
   Dim adapter As New SqlDataAdapter(command)
   Dim table As New DataTable
   adapter.Fill(table)
   Dim acName As New ReportParameter("GLName", table.Rows(0)(0).ToString)
   Dim acNameTxt As New ReportParameter("GLNameTxt", rptAcName)
   Dim acNumber As New ReportParameter("GLNumber", table.Rows(0)(1).ToString())
   Dim acNumberTxt As New ReportParameter("GLNumberTxt", rptAcNo)
   Dim acCategory As New ReportParameter("GLCategory", table.Rows(0)(2).ToString())
   Dim acCategoryTxt As New ReportParameter("GLCategoryTxt", rptAcCategory)
   Dim acCcy As New ReportParameter("GLCurrency", table.Rows(0)(3).ToString())
   Dim acCcyTxt As New ReportParameter("GLCurrencyTxt", rptAcCcy)
   Dim acStatus As New ReportParameter("GLStatus", table.Rows(0)(4).ToString())
   Dim acStatusTxt As New ReportParameter("GLStatusTxt", rptAcStatus)
   Dim acBal As New ReportParameter("GLBalance", table.Rows(0)(5).ToString())
   Dim acBalTxt As New ReportParameter("GLBalanceTxt", rptAcCurrentBalance)
   Dim user As New ReportParameter("UserID", UserID)
   Dim userTxt As New ReportParameter("UserIDTxt", rptUserID)
   Dim AccStm As New ReportParameter("ReportName", GlAccStatement)
   Dim coName As New ReportParameter("comName", ComName)
   Dim glStmRef As New ReportParameter("GLStmRef", rptRef)
   Dim glStmDate As New ReportParameter("GLStmDate", rptDate)
   Dim glStmNarration As New ReportParameter("GLStmNarration", rptNarration)
   Dim glStmDebit As New ReportParameter("GLStmDebit", rptDebit)
   Dim glStmCredit As New ReportParameter("GLStmCredit", rptCredit)
   Dim glStmBalance As New ReportParameter("GLStmBalance", rptBalance)
   Dim glStmDateTime As New ReportParameter("GLStmRptDateTime", ReportDateTime)
   Me.rvControl.LocalReport.SetParameters(New ReportParameter() {acName, acNameTxt, acNumber, acNumberTxt, acCategory, acCategoryTxt, acCcy, acCcyTxt, acStatus, acStatusTxt, acBal, acBalTxt, user, userTxt,
                                               AccStm, coName, glStmRef, glStmDate, glStmNarration, glStmDebit, glStmCredit, glStmBalance, glStmDateTime})
   Me.spGLstatementTableAdapter.Fill(Me.beansDataSet.spGLstatement, prm2.Text, prm1.SelectedValue, rptPrmFromDate.Value, rptPrmToDate.Value)
   Me.rvControl.SetDisplayMode(DisplayMode.PrintLayout)
   Me.rvControl.ZoomMode = ZoomMode.FullPage
   Me.rvControl.RefreshReport()
Catch ex As Exception
   MessageBox.Show(ex.Message, "GL Statement")
End Try

结束子

This screenshot is normal to view and after this, I zoom in the report to 200 % and close the from

And this screenshot shows the second commit to view a report that I am not able to scroll up

几个月来我一直在为这个错误或问题苦苦挣扎,我尝试了以下代码,但是没有用,非常感谢希望您的开发人员帮助我解决这个问题...

Me.rvControl.Reset()
Me.rvControl.LocalReport.DataSources.Clear()
Me.rvControl.LocalReport.ReportEmbeddedResource = Nothing
Me.rvControl.LocalReport.Dispose()

0 个答案:

没有答案