Link to home
Start Free TrialLog in
Avatar of FOS-Bret
FOS-BretFlag for United States of America

asked on

rdlc "Print Layout" not showing all pages of report.

Hey All,

VB 2005. ADO.NET. NOT Crystal Reports.

I have some mailing label reports that I'm generating and I finally got them lined up perfectly for the 30-up labels I use.

I like the "Print Layout" view much more than the regular report view, so I'm displaying my reports to that view right out of the chute.

The first time I run a mailing label report, all of the pages of the report are there and print correctly. Thereafter, every time I run the same report, the first page is missing from the "Print Layout" view (and doesn't print).

If I click back to the regular view, I see all pages, but the first page still doesn't print.

Below is the code for the form that loads the report. Any ideas?

Any help will be much appreciated.

Thanks,
Bret

Imports System.Data.OleDb
Imports Microsoft.Reporting.WinForms

Public Class frmReportViewer

    Private connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataFile & ";"
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Me.WindowState = FormWindowState.Maximized
        'MsgBox(Me.WhichTitle)
        Try
            Me.ReportViewer1.Reset()
            With Me.ReportViewer1.LocalReport
                .ReportPath = Application.StartupPath & "\..\..\" & Me.WhichReport
                .DataSources.Clear()
                Dim parameters(0) As ReportParameter
                parameters(0) = New ReportParameter("Title", Me.WhichTitle)
                .SetParameters(parameters)
            End With
            Dim SQL As String = Me.WhichSQL
            Using da As New OleDbDataAdapter(SQL, connString)
                Using ds As New DataSet
                    da.Fill(ds, "tblMembers")
                    Dim rptDataSource As New ReportDataSource("ID_NET_SJ_DBDataSet_tblMembers", ds.Tables("tblMembers"))
                    Me.ReportViewer1.LocalReport.DataSources.Add(rptDataSource)
                End Using
            End Using
            ReportViewer1.RefreshReport()
        Catch ex As Exception
            MessageBox.Show(ex.Message, My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try

    End Sub

    Private Sub ReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReportViewer1.Load
        Me.ReportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout)
        Me.ReportViewer1.ZoomMode = ZoomMode.FullPage
    End Sub
End Class

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of FOS-Bret
FOS-Bret
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial