?
Solved

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

Posted on 2009-12-26
1
Medium Priority
?
1,409 Views
Last Modified: 2013-11-26
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

0
Comment
Question by:FOS-Bret
1 Comment
 

Accepted Solution

by:
FOS-Bret earned 0 total points
ID: 26126260
I should have dug deeper before I posted. I found the solution here.

http://social.msdn.microsoft.com/Forums/en/vsreportcontrols/thread/42e4b6fb-eefa-4968-a9c5-36bd2d7a4b41

The answer was to put the viewer into "Print Layout" mode in the RenderingComplete Event instead of the Form Load event.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Loops Section Overview
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question