Public Class frmrptProducts Private Sub frmrptProducts_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cryRpt As New ReportDocument Dim CrTables As Tables Dim crtableLogoninfo As New TableLogOnInfo Dim crConnectionInfo As New ConnectionInfo 'Try 'load report cryRpt.Load(ReportPath & "CRproducts.rpt") 'parameters definition(if any) Dim ColourName As String = "White" cryRpt.SetParameterValue("colours", ColourName) 'provide connection info. This is important and you can change it as per your db location With crConnectionInfo .ServerName = My.Application.Info.DirectoryPath.ToString() & "\data\db.mdb" '.DatabaseName = "" '.UserID = "" .Password = "" End With CrTables = cryRpt.Database.Tables For Each CrTable In CrTables crtableLogoninfo = CrTable.LogOnInfo crtableLogoninfo.ConnectionInfo = crConnectionInfo CrTable.ApplyLogOnInfo(crtableLogoninfo) Next CRV.ReportSource = cryRpt CRV.Refresh() 'Catch ex As Exception ' MsgBox(ex.Message) 'End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)