Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.04 KB | None | 0 0
  1. Try
  2.             Dim objReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
  3.             Dim ConInfo As New CrystalDecisions.Shared.TableLogOnInfo
  4.             Dim strAlamatReport As String = Application.StartupPath & "\Report2.rpt"
  5.             objReport.Load(strAlamatReport)
  6.  
  7.             With ConInfo.ConnectionInfo
  8.                 .DatabaseName = Application.StartupPath & "\Db_moora.mdb"
  9.                 .IntegratedSecurity = True
  10.             End With
  11.             For intCounter As Integer = 0 To objReport.Database.Tables.Count - 1
  12.                 objReport.Database.Tables(intCounter).ApplyLogOnInfo(ConInfo)
  13.             Next
  14.             objReport.RecordSelectionFormula = ""
  15.             CrystalReportViewer1.ReportSource = objReport
  16.             CrystalReportViewer1.SelectionFormula = "{TblHasil.Periode} = " & Menuutama.ToolStripComboBox1.Text.Substring(8) & ""
  17.             CrystalReportViewer1.RefreshReport()
  18.             CrystalReportViewer1.Show()
  19.         Catch ex As Exception
  20.             MsgBox(ex.Message)
  21.         End Try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement