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 = Nothing Public 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
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)