Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
' this is the class for connecting crystal reports to database
' applies logoninfo
Public Class Creports
'returns a ReportDocument after applying logoninfo for the passed report
Public Function connect(ByVal rpt5 As ReportDocument) As ReportDocument
Dim tbCurrent As Table
Dim tbLogOnInfo As TableLogOnInfo
Try
'apply LogOn info for each table of the report document
For Each tbCurrent In rpt5.Database.Tables
tbLogOnInfo = tbCurrent.LogOnInfo
With tbLogOnInfo.ConnectionInfo
.ServerName = mod_1.serverName
.UserID = mod_1.userName
.Password = mod_1.password
.DatabaseName = mod_1.dataBaseName
End With
tbCurrent.ApplyLogOnInfo(tbLogOnInfo)
'tbLogOnInfo = tbCurrent.LogOnInfo
'tbLogOnInfo.ConnectionInfo.ServerName = serverName
'tbLogOnInfo.ConnectionInfo.UserID = userName
'tbLogOnInfo.ConnectionInfo.Password = password
'tbLogOnInfo.ConnectionInfo.DatabaseName = databaseName
'tbCurrent.ApplyLogOnInfo(tbLogOnInfo)
Next tbCurrent
Return rpt5
Catch lsExp As LoadSaveReportException
MessageBox.Show(lsExp.Message)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Function
End Class
Microsoft Hosted General Download from Microsoft Failing with 500.30
Asp.Net Core error - Microsoft Q&A
-
I was asked to post this question here as well...I'm following a Microsoft
article
(https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view...
6 months ago
1 comment:
Parameter passing to a crystal report.
Dim pvCollection As New ParameterValues
Dim pvYCollection As New ParameterValues
Dim pdvMonthly As New ParameterDiscreteValue
Dim pdvYMonthly As New ParameterDiscreteValue
mod_1.reportO.Load("../reports/crpMonAge.rpt") 'Load Report
mod_1.reportO = mod_1.reportDoc.connect(reportO) 'Apply LogonInfo
pdvMonthly.Value = cbMonth.SelectedIndex + 1 'Get Parameters from form
pdvYMonthly.Value = CInt(cmbYear.Text)
pvCollection.Add(pdvMonthly) 'Pass Month
mod_1.reportO.DataDefinition.ParameterFields("paraMonth").ApplyCurrentValues(pvCollection)
pvYCollection.Add(pdvYMonthly) 'Pass Year
mod_1.reportO.DataDefinition.ParameterFields("paraYear").ApplyCurrentValues(pvYCollection)
Me.CrystalReportViewer1.ReportSource = reportO
Post a Comment