Adding two reports with different parameter values to reportbook

2 posts, 1 answers
  1. Martin Gartmann
    Martin Gartmann avatar
    51 posts
    Member since:
    Apr 2004

    Posted 25 Jul Link to this post

    Dear fellows,

    i have created a report with a parameter and standalone this is working as expected.

    What i want to do is: add multiple reports (same type) with different parameters to following up pages in a report book

    my code:

    Dim reportBook As New ReportBook()
     
     
         Dim page1 As New prTicket.trainingtimesdriver()
         page1.ReportParameters("Position").Value = 4
     
         Dim page2 As New prTicket.trainingtimesdriver()
         page2.ReportParameters("Position").Value = 3
     
     
         reportBook.Reports.Add(page1)
         reportBook.Reports.Add(page2)
     
         ReportViewer1.ReportSource = reportBook

    As a result i am getting two pages with the filter applied to page1. page2 is not shown or simply the parameter does not have effect.

    Any suggestions where i am wrong?

    Kind regards

    Martin

  2. Answer
    Martin Gartmann
    Martin Gartmann avatar
    51 posts
    Member since:
    Apr 2004

    Posted 25 Jul Link to this post

    Problem solved: Set mergetable to false. then it is working

     

    For i = 1 To 10
            Dim page1 As New prTicket.trainingtimesdriver()
            page1.ReportParameters("Position").Value = i
            page1.ReportParameters("Position").Mergeable = False
            reportBook.Reports.Add(page1)
            reportBook.Reports(i - 1).PageNumberingStyle = PageNumberingStyle.ResetNumberingAndCount
        Next

  3. DevCraft banner
Back to Top