Thanks Fabien for adding the "ForceNewPage" setting to the report component.

I am close to getting the report for my application to look like I want using the new ForceNewPage setting. However I am having problems with the automatic page numbering now. My report consists of X number of pages with tables that are repeated Y number of times with new data each time (the report is then X times Y pages long). For example a report may consist of two pages of data in tables that are repeated three times to create a six page report. The page numbers now only show up on the last X number of pages in the report (the last two pages in the example - the first four pages do not get numbered).

Any help fixing this would be appreciated. I have attached the class and report files for the code used to create the report.

Thanks,
Greg


' Gambas class file

Public nnoderows As Integer
Public nanchorrows As Integer

Public Sub _new()
  
  'enter current date on the header
  ReportLabel2.Text = Date
  
  'enter the project information in the header on the print out page
  With FMain.Project
     ReportLabel3.Text = "Project Title:  " & .JobTitle
     ReportLabel4.Text = "Project No.:  " & .Number
     ReportLabel5.Text = "Company:  " & .Company
     ReportLabel6.Text = "Designer:  " & .Designer
     ReportLabel7.Text = "Base Plate ID:  " & .BasePlateID
  End With
  
  'set count to four to display the results for qmax. Tmax, L, and phi
  ReportHBox9.DataCount = 4
  
  'set the number of plate nodes to display in print out tables
  nnoderows = Module1.RoundUpInt(FMain.ConcreteSection.cNodes.Count / 2)
  ReportHBox5.DataCount = nnoderows
  
  'set the number of anchor rods to display in print out tables
  nanchorrows = Module1.RoundUpInt(FMain.cAnchorRods.Count / 2)
  ReportHBox7.DataCount = nanchorrows
  
  'set the number of report panels - one for each load combination result
  ReportPanel1.DataCount = FMain.AnalysisResults.Count
  
End
  

Public Sub ReportImage2_Data(Index As Integer)
  Dim current_results As Results
  Dim pSection As Picture

  'create a new picture object for drawing the base plate
  pSection = New Picture(300, 300, False)
  
  'get the results for first load case
  current_results = FMain.AnalysisResults[Str$(ReportHBox3.DataIndex)]
  
  'refresh base plate drawing with results
  Module1.DrawBasePlate(pSection, 1, current_results)
  
  'add the picture of the base plate to the page
  ReportImage2.Image = pSection.Image

End


Public Sub ReportLabel9_Data(Index As Integer)

   Last.Data = "Load Case:  " & FMain.cLoads[Str$(ReportHBox3.DataIndex)].label

End


Public Sub ReportLabel14_Data(Index As Integer)
  Dim $value As String

  Select Case Index
    Case 0
      $value = 
Module1.AdvFormat(FMain.AnalysisResults[Str$(ReportHBox3.DataIndex)].Tmax, 2)
      Last.Data = "T(max) = " & $value & " lbs"
    Case 1
      $value = 
Module1.AdvFormat(FMain.AnalysisResults[Str$(ReportHBox3.DataIndex)].maxstress, 
2)
      Last.Data = "q(max) = " & $value & " psi"
    Case 2
      $value = 
Module1.AdvFormat(FMain.AnalysisResults[Str$(ReportHBox3.DataIndex)].L, 2)
      Last.Data = "L = " & $value & " in"
    Case 3
      $value = 
Module1.AdvFormat(FMain.AnalysisResults[Str$(ReportHBox3.DataIndex)].phi, 2)
      Last.Data = "phi = " & $value & " degrees"
    Case Else
  End Select

End


Public Sub ReportLabel25_Data(Index As Integer)

  Last.Data = Index + 1

End

Public Sub ReportLabel29_Data(Index As Integer)
  Dim current_results As Results

  current_results = FMain.AnalysisResults[Str$(ReportPanel1.DataIndex)]
  
  If nnoderows + Index < current_results.stress.Count Then
    Last.Data = nnoderows + Index + 1
  Else
    Last.Data = Null
  Endif
  
End

Public Sub ReportLabel26_Data(Index As Integer)
  Dim value As Float

  value = FMain.AnalysisResults[Str$(ReportPanel1.DataIndex)].stress[Index]
  Last.Data = Module1.AdvFormat(value, 2)

End

Public Sub ReportLabel30_Data(Index As Integer)
  Dim value As Float
  Dim current_results As Results

  current_results = FMain.AnalysisResults[Str$(ReportPanel1.DataIndex)]
  If nnoderows + Index < current_results.stress.Count Then
     value = current_results.stress[nnoderows + Index]
     Last.Data = Module1.AdvFormat(value, 2)
  Else
    Last.Data = Null
  Endif
  
End

Public Sub ReportLabel49_Data(Index As Integer)

  Last.Data = Index + 1

End

Public Sub ReportLabel52_Data(Index As Integer)
  Dim current_results As Results

  current_results = FMain.AnalysisResults[Str$(ReportPanel1.DataIndex)]

  If nanchorrows + Index < current_results.T.Count Then
    Last.Data = nanchorrows + Index + 1
  Else
    Last.Data = Null
  Endif
  
End

Public Sub ReportLabel50_Data(Index As Integer)
  Dim value As Float

  value = FMain.AnalysisResults[Str$(ReportPanel1.DataIndex)].T[Index]
  Last.Data = Module1.AdvFormat(value, 2)

End

Public Sub ReportLabel53_Data(Index As Integer)
  Dim value As Float
  Dim current_results As Results

  current_results = FMain.AnalysisResults[Str$(ReportPanel1.DataIndex)]
  If nanchorrows + Index < current_results.T.Count Then
     value = current_results.T[nanchorrows + Index]
     Last.Data = Module1.AdvFormat(value, 2)
  Else
    Last.Data = Null
  Endif
  
End
# Gambas Form File 3.0

{ Report Report
  #MoveScaled(0,0,76,88)
  Fixed = True
  Padding = ReportPadding["Top:20mm;Bottom:20mm;Left:20mm;Right:20mm"]
  Ignore = True
  AutoResize = True
  Paper = Printer.Letter
  Index = 0
  Text = ("")
  { ReportHBox1 ReportHBox
    #MoveScaled(2,0,62,11)
    Height = "25mm"
    Fixed = True
    Padding = ReportPadding["Top:1mm;Bottom:1mm;Left:1mm;Right:1mm"]
    Border = ReportBorder["Bottom:2px #000000"]
    { ReportImage1 ReportImage
      #MoveScaled(1,1,18,9)
      Width = "51mm"
      AutoResize = True
      Image = Image.Load("BPdesignlogo.svg")
    }
    { ReportLabel1 ReportLabel
      #MoveScaled(21,1,10,9)
      Width = "25mm"
      AutoResize = True
      Text = ("Version 1.0")
      Alignment = Align.BottomLeft
    }
    { ReportLabel2 ReportLabel
      #MoveScaled(31,1,30,9)
      Expand = True
      AutoResize = True
      Text = ("Date")
      Alignment = Align.BottomRight
      UseField = True
    }
  }
  { ReportVBox1 ReportVBox
    #MoveScaled(2,11,62,9)
    Height = "28.01mm"
    Fixed = True
    Padding = ReportPadding["Top:1mm;Bottom:1mm;Left:1mm;Right:1mm"]
    Border = ReportBorder["Bottom:2px #000000"]
    { ReportLabel3 ReportLabel
      #MoveScaled(0,0,12,2)
      Height = "6mm"
      AutoResize = True
      Text = ("Project Title:")
      Alignment = Align.TopLeft
    }
    { ReportLabel4 ReportLabel
      #MoveScaled(0,2,12,2)
      Height = "6mm"
      AutoResize = True
      Text = ("Project No.:")
      Alignment = Align.TopLeft
    }
    { ReportLabel5 ReportLabel
      #MoveScaled(0,4,12,2)
      Height = "6mm"
      AutoResize = True
      Text = ("Company:")
      Alignment = Align.TopLeft
    }
    { ReportLabel6 ReportLabel
      #MoveScaled(0,6,12,2)
      Height = "6mm"
      AutoResize = True
      Text = ("Designer:")
      Alignment = Align.TopLeft
    }
  }
  { ReportHBox2 ReportHBox
    #MoveScaled(2,20,62,3)
    Height = "8mm"
    Fixed = True
    Padding = ReportPadding["Top:1mm;Bottom:1mm;Left:1mm;Right:1mm"]
    Border = ReportBorder["Bottom:2px #000000"]
    { ReportLabel7 ReportLabel
      #MoveScaled(0,0,12,2)
      Height = "6mm"
      AutoResize = True
      Text = ("Base Plate ID:")
      Alignment = Align.TopLeft
    }
  }
  { ReportPanel1 ReportPanel
    #MoveScaled(2,25,67,52)
    AutoResize = True
    ForceNewPage = True
    { ReportHBox3 ReportHBox
      #MoveScaled(1,1,62,17)
      Height = "61mm"
      Expand = True
      { ReportVBox3 ReportVBox
        #MoveScaled(1,1,18,14)
        AutoResize = True
        { ReportHBox8 ReportHBox
          #MoveScaled(1,2,15,4)
          Width = "51mm"
          Height = "12mm"
          { ReportLabel9 ReportLabel
            #MoveScaled(1,1,13,2)
            Font = Font["+1"]
            Expand = True
          }
        }
        { ReportHBox9 ReportHBox
          #MoveScaled(1,8,15,4)
          Width = "51mm"
          Height = "6mm"
          { ReportLabel14 ReportLabel
            #MoveScaled(1,1,13,2)
            Expand = True
          }
        }
      }
      { ReportImage2 ReportImage
        #MoveScaled(31,1,17,15)
        Padding = ReportPadding["Top:5mm;Bottom:5mm;Left:5mm;Right:5mm"]
        Expand = True
        Alignment = Align.Center
      }
    }
    { ReportVBox4 ReportVBox
      #MoveScaled(1,20,62,14)
      AutoResize = True
      { ReportLabel19 ReportLabel
        #MoveScaled(2,0,16,4)
        Fixed = True
        Font = Font["+1"]
        Padding = ReportPadding["Top:3mm"]
        AutoResize = True
        Text = ("Bearing Pressue")
      }
      { ReportHBox4 ReportHBox
        #MoveScaled(1,3,60,4)
        Height = "6mm"
        Fixed = True
        { ReportLabel20 ReportLabel
          #MoveScaled(1,1,13,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Text = ("Node #")
          Alignment = Align.Center
        }
        { ReportLabel21 ReportLabel
          #MoveScaled(14,1,14,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Text = ("Brg. Press., psi")
          Alignment = Align.Center
        }
        { ReportLabel22 ReportLabel
          #MoveScaled(28,1,4,2)
          Width = "5mm"
        }
        { ReportLabel23 ReportLabel
          #MoveScaled(32,1,12,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Text = ("Node #")
          Alignment = Align.Center
        }
        { ReportLabel24 ReportLabel
          #MoveScaled(44,1,15,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Text = ("Brg. Press., psi")
          Alignment = Align.Center
        }
      }
      { ReportHBox5 ReportHBox
        #MoveScaled(1,8,60,4)
        Height = "6mm"
        { ReportLabel25 ReportLabel
          #MoveScaled(1,1,13,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Alignment = Align.Center
        }
        { ReportLabel26 ReportLabel
          #MoveScaled(14,1,14,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Alignment = Align.Center
        }
        { ReportLabel27 ReportLabel
          #MoveScaled(28,1,4,2)
          Width = "5mm"
        }
        { ReportLabel29 ReportLabel
          #MoveScaled(32,1,12,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Alignment = Align.Center
        }
        { ReportLabel30 ReportLabel
          #MoveScaled(44,1,15,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Alignment = Align.Center
        }
      }
    }
    { ReportVBox6 ReportVBox
      #MoveScaled(1,36,62,14)
      AutoResize = True
      { ReportLabel31 ReportLabel
        #MoveScaled(2,0,19,4)
        Fixed = True
        Font = Font["+1"]
        Padding = ReportPadding["Top:3mm"]
        AutoResize = True
        Text = ("Anchor Rod Tension")
      }
      { ReportHBox6 ReportHBox
        #MoveScaled(1,3,60,4)
        Height = "6mm"
        Fixed = True
        { ReportLabel44 ReportLabel
          #MoveScaled(1,1,13,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Text = ("Rod #")
          Alignment = Align.Center
        }
        { ReportLabel45 ReportLabel
          #MoveScaled(14,1,14,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Text = ("Tension, lbs")
          Alignment = Align.Center
        }
        { ReportLabel46 ReportLabel
          #MoveScaled(28,1,4,2)
          Width = "5mm"
        }
        { ReportLabel47 ReportLabel
          #MoveScaled(32,1,12,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Text = ("Rod #")
          Alignment = Align.Center
        }
        { ReportLabel48 ReportLabel
          #MoveScaled(44,1,15,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Text = ("Tension, lbs")
          Alignment = Align.Center
        }
      }
      { ReportHBox7 ReportHBox
        #MoveScaled(1,8,60,4)
        Height = "6mm"
        { ReportLabel49 ReportLabel
          #MoveScaled(1,1,13,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Alignment = Align.Center
        }
        { ReportLabel50 ReportLabel
          #MoveScaled(14,1,14,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Alignment = Align.Center
        }
        { ReportLabel51 ReportLabel
          #MoveScaled(28,1,4,2)
          Width = "5mm"
        }
        { ReportLabel52 ReportLabel
          #MoveScaled(32,1,12,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Alignment = Align.Center
        }
        { ReportLabel53 ReportLabel
          #MoveScaled(44,1,15,2)
          Expand = True
          Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px 
#000000;Right:1px #000000"]
          Alignment = Align.Center
        }
      }
    }
  }
  { ReportHBox10 ReportHBox
    #MoveScaled(2,79,62,4)
    Fixed = True
    Expand = True
    AutoResize = True
    { ReportLabel8 ReportLabel
      #MoveScaled(22,1,21,2)
      Expand = True
      AutoResize = True
      Text = ("Page $PAGE of $NPAGE")
      Alignment = Align.Bottom
      UseField = True
    }
  }
  Index = 0
}
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to