This is what i do have in my Print_command
It works fine. The problem is ......
1. I press the Print button for the first time, it displays in the PrintLayout mode, fine, NO ISSUE.
2. Then I close the frmViewer.
3. Now if I press the Print button for the second time, it shows the last page only in the PrintLayout mode, but in the normal mode it shows all the pages.
Code:
Private Sub cmdPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPrint.Click
Dim vRs1 As SqlClient.SqlDataReader
Dim ds As New DataSet1
Dim dt As DataTable = ds.Tables(0)
Me.Refresh()
vSqlText = "Select * from Z_Address1 order by SlNo"
vRs1 = CreateReader(vSqlText)
dt.Load(vRs1)
frmViewer.ReportViewer1.Reset()
frmViewer.ReportViewer1.LocalReport.Dispose()
frmViewer.ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
frmViewer.ReportViewer1.LocalReport.ReportPath = "Y_Rpt8_Address.rdlc"
frmViewer.ReportViewer1.LocalReport.DataSources.Clear()
frmViewer.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1_DataTable10", ds.Tables(0)))
frmViewer.ReportViewer1.RefreshReport()
frmViewer.ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)
frmViewer.Show()
End Sub
1. I press the Print button for the first time, it displays in the PrintLayout mode, fine, NO ISSUE.
2. Then I close the frmViewer.
3. Now if I press the Print button for the second time, it shows the last page only in the PrintLayout mode, but in the normal mode it shows all the pages.