本文介绍了单晶报告查看器中的多个晶体报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 大家好 我有一个包含多个水晶报告的应用程序。 我用报告查看器制作了很多表格。该应用程序工作正常,但我想 只有一个表单。我在表单中使用了这段代码: Hi guysI have an application with multiple crystal reports.I made a lot of forms with report viewers. The application works fine but I want to have only one form. I used this code in a form:Private Sub frmReport_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load ControlBox = False WindowState = FormWindowState.Maximized BringToFront() Dim pvCollection As New ParameterValues Dim pdvSchYr As New ParameterDiscreteValue Dim pdvSem As New ParameterDiscreteValue Dim pdvLas As New ParameterDiscreteValue Select Case globalfrm Case "frmPrintcity" Myrpt.Load("..\..\Reports\rptCity.rpt") Call DataSourceConnection_Report() pdvSchYr.Value = frmPrintcity.cbCompany.Text pdvSem.Value = frmPrintcity.cbCity.Text pvCollection.Clear() pvCollection.Add(pdvSchYr) Myrpt.DataDefinition.ParameterFields("@company").ApplyCurrentValues(pvCollection) pvCollection.Clear() pvCollection.Add(pdvSem) Myrpt.DataDefinition.ParameterFields("@city").ApplyCurrentValues(pvCollection) Report1.ReportSource = Myrpt Case "frmPrintpoi" Myrpt.Load("..\..\Reports\rptPoi.rpt") Call DataSourceConnection_Report() pdvSchYr.Value = frmPrintpoi.cbCompany.Text pvCollection.Clear() pvCollection.Add(pdvSchYr) Myrpt.DataDefinition.ParameterFields("@company").ApplyCurrentValues(pvCollection) Report1.ReportSource = Myrpt Case "frmPrintpoil" Myrpt.Load("..\..\Reports\rptPoin.rpt") Call DataSourceConnection_Report() pdvSchYr.Value = frmPrintpoil.cbCompany.Text pvCollection.Clear() pvCollection.Add(pdvSchYr) Myrpt.DataDefinition.ParameterFields("@company").ApplyCurrentValues(pvCollection) Report1.ReportSource = Myrpt End Select globalfrm = NothingPublic Function DataSourceConnection_Report() Dim conStr As String = My.MySettings.[Default].ConnectionStr Dim arrTemp As String() = conStr.Split(";"c) Myrpt.DataSourceConnections(0).SetConnection(arrTemp(0).Split("="c)(1), "RDMS", False) Myrpt.DataSourceConnections(0).SetLogon(arrTemp(2).Split("="c)(1), arrTemp(3).Split("="c)(1)) Return 0 End Function 问题是显示报告时没有数据。 提前谢谢The problem is that while displaying the report has no data in it.Thanks in advance推荐答案 这篇关于单晶报告查看器中的多个晶体报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-17 23:14