Dim cryRpt As New ReportDocument If IsConnected() = True Then myCmd.Connection = returnConn() strSQL = "SELECT * FROM tbl_sample where samp='EX'" myCmd.CommandText = strSQL myDA.SelectCommand = myCmd myDA.Fill(myDS, "tbl_sample") End If 'myDR.Close() 'frmReports.Show() 'frmReports.cReportViewer.ReportSource = testReport1 Dim r_username As String Dim r_pass As String r_username = "***" r_pass = "***" cryRpt.Load(DefPhotoPath + "sample.rpt") cryRpt.SetDatabaseLogon(r_username, r_pass) cryRpt.SetDataSource(myDS.Tables("tbl_sample")) With frmReportsPrev .cReportViewer.ReportSource = cryRpt .cReportViewer.RefreshReport() .cReportViewer.Zoom(100) .cReportViewer.RefreshReport() End With frmReportsPrev.ShowDialog(Me)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)