Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27020

VS 2008 RDLC Report ISSUE

$
0
0
This is what i do have in my Print_command

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

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.

Viewing all articles
Browse latest Browse all 27020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>