代码之家  ›  专栏  ›  技术社区  ›  siwa86

如何在rdlcreport/report-viewer中使页眉只出现在第一页上,而在vb.net中信息页眉仍然显示在每一页上

  •  0
  • siwa86  · 技术社区  · 1 年前

    我想让页眉只出现在rdlc或报表查看器的第一页上,但信息页仍然出现在vb.net的每个页眉上,结果应该只有2页,因为页眉出现了,所以变成了3页。

    下面我将分享rdlc报告文件的链接。请引导我。

    link rdlc file

    谢谢

    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
    
    

    打印版式第1页

    Print Layout Page1

    打印版式第2页

    Print Layout Page2

    打印布局第3页

    Print Layout Page3

    0 回复  |  直到 1 年前
        1
  •  0
  •   tezzo    1 年前

    如果您必须只为报告显示一个徽标(即没有组),您可以简单地通过移动徽标来解决此问题 Body 上面的部分 Tablix