Search code examples
vb.netreportrdlcreportviewer

how to make the header only appear on the first page in rdlc report/report viewer but the info page header still appears on every page in vb.net


I want to make the header only appear on the first page in rdlc or report viewer but the info page still appears on every page header in vb.net and the result should only be 2 pages because the header appears so it becomes 3 pages.

Below I am sharing the link of the rdlc report file. Please guide me.

link rdlc file

Thanks

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim order = OrderBusiness.GetOrder()
        Me.OrderBindingSource.DataSource = order
        Me.OrderDetailBindingSource.DataSource = order.OrderDetails
        Me.ReportViewer1.RefreshReport()
    End Sub
End Class
Public Class Order
    Public Property CustomerName() As String
    Public Property OrderDetails() As List(Of OrderDetail)
End Class
Public Class OrderDetail
    Public Property No() As Integer
    Public Property ProductName() As String
    Public Property UnitPrice() As Integer
    Public Property Quantity() As Integer
    Public Property Discount() As Integer
End Class
Public Class OrderBusiness
    Public Shared Function GetOrder() As Order
        Return New Order() With {
                .CustomerName = "John Doe",
                .OrderDetails = New List(Of OrderDetail)() From {
                    New OrderDetail() With {
                        .No = 1,
                        .ProductName = "TEST1",
                        .UnitPrice = 100,
                        .Quantity = 1,
                        .Discount = 0
                    },
                    New OrderDetail() With {
                        .No = 2,
                        .ProductName = "TEST2",
                        .UnitPrice = 200,
                        .Quantity = 2,
                        .Discount = 50
                    },
                    New OrderDetail() With {
                        .No = 3,
                        .ProductName = "TEST3",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                      New OrderDetail() With {
                         .No = 4,
                        .ProductName = "TEST4",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                         .No = 5,
                        .ProductName = "TEST5",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                         .No = 6,
                        .ProductName = "TEST6",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                        .No = 7,
                        .ProductName = "TEST7",
                        .UnitPrice = 100,
                        .Quantity = 1,
                        .Discount = 0
                    },
                    New OrderDetail() With {
                        .No = 8,
                        .ProductName = "TEST8",
                        .UnitPrice = 200,
                        .Quantity = 2,
                        .Discount = 50
                    },
                    New OrderDetail() With {
                        .No = 9,
                        .ProductName = "TEST9",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                      New OrderDetail() With {
                        .No = 10,
                        .ProductName = "TEST10",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                         .No = 11,
                        .ProductName = "TEST11",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                         .No = 12,
                        .ProductName = "TEST12",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                        .No = 13,
                        .ProductName = "TEST13",
                        .UnitPrice = 200,
                        .Quantity = 2,
                        .Discount = 50
                    },
                    New OrderDetail() With {
                        .No = 14,
                        .ProductName = "TEST14",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                      New OrderDetail() With {
                        .No = 15,
                        .ProductName = "TEST15",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                         .No = 16,
                        .ProductName = "TEST16",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                         .No = 17,
                        .ProductName = "TEST17",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                        .No = 18,
                        .ProductName = "TEST18",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                        .No = 19,
                        .ProductName = "TEST19",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    },
                     New OrderDetail() With {
                         .No = 20,
                        .ProductName = "TEST20",
                        .UnitPrice = 50,
                        .Quantity = 3,
                        .Discount = 0
                    }
                }
            }
    End Function

End Class

Print Layout Page1

Print Layout Page1

Print Layout Page2

Print Layout Page2

Print Layout Page3

Print Layout Page3


Solution

  • If you have to display only one logo for report (i.e. no groups) you can simply fix this by moving your logo in Body section above Tablix.