Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.81 KB | None | 0 0
  1.  
  2.  Dim cryRpt As New ReportDocument
  3.         Dim crtableLogoninfos As New TableLogOnInfos
  4.         Dim crtableLogoninfo As New TableLogOnInfo
  5.         Dim crConnectionInfo As New ConnectionInfo
  6.         Dim CrTables As Tables
  7.         Dim CrTable As Table
  8.  
  9.         cryRpt.Load("C:\Users\Gian-PC\Documents\Visual Studio 2015\Projects\Capsstone\Capsstone\CrystalReport1.rpt")
  10.  
  11.         With crConnectionInfo
  12.             .DatabaseName = "GoodShepherd"
  13.         End With
  14.  
  15.         CrTables = cryRpt.Database.Tables
  16.         For Each CrTable In CrTables
  17.             crtableLogoninfo = CrTable.LogOnInfo
  18.             crtableLogoninfo.ConnectionInfo = crConnectionInfo
  19.             CrTable.ApplyLogOnInfo(crtableLogoninfo)
  20.         Next
  21.  
  22.         CrystalReportViewer1.ReportSource = cryRpt
  23.         CrystalReportViewer1.Refresh()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement