Resetting line number on each printed page shows last number of previous page
I want to print a line-number before each printed detail-line of a report, and reset that number to 1 on each new page.
Therefore I use a variable (xLineNumber) , set in the following code in my report (in VB.Net) :
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Drawing
Imports Microsoft.VisualBasic
Imports FastReport
Imports FastReport.Data
Imports FastReport.Dialog
Imports FastReport.Table
Imports FastReport.Barcode
Imports FastReport.Utils
Namespace FastReport
Public Class ReportScript
public xLineNumber as Integer
Private Sub PageHeader1_BeforePrint(ByVal sender As object, ByVal e As EventArgs)
xLineNumber = 0
End Sub
Private Sub Data1_BeforePrint(ByVal sender As object, ByVal e As EventArgs)
xLineNumber += 1
End Sub
End Class
End Namespace
Problem is, starting on page 2 and on all the following pages, my first line-number seems to be the last number of the previous page. (See PDF attached).
How can I avoid this?
Therefore I use a variable (xLineNumber) , set in the following code in my report (in VB.Net) :
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Drawing
Imports Microsoft.VisualBasic
Imports FastReport
Imports FastReport.Data
Imports FastReport.Dialog
Imports FastReport.Table
Imports FastReport.Barcode
Imports FastReport.Utils
Namespace FastReport
Public Class ReportScript
public xLineNumber as Integer
Private Sub PageHeader1_BeforePrint(ByVal sender As object, ByVal e As EventArgs)
xLineNumber = 0
End Sub
Private Sub Data1_BeforePrint(ByVal sender As object, ByVal e As EventArgs)
xLineNumber += 1
End Sub
End Class
End Namespace
Problem is, starting on page 2 and on all the following pages, my first line-number seems to be the last number of the previous page. (See PDF attached).
How can I avoid this?
Comments
first pass : detect rowNumber, make a correction if needed, put the result into list<int>
final pass : just display from list<int>
(Strange there is no system variable to achieve this...)