Print MultiPage DB Report

  • Thread starter Thread starter GW
  • Start date Start date
G

GW

Trying to force a new page when required using e.HasMorePages = True but not
having much luck.

All prints OK except for trying to figure out how to do a page feed without
exiting the loop.

There is a lot of data gathering from DB in each loop so exiting the loop is
not an option.

All the examples for multipage printing I found so far are based on printing
simple text from a streamreader , or list box, etc.

LS_PAR7311 is to be called only once.

Tried placing the code for LS-PAR7311 inside the PrintPage but that didn't
do the trick either.

Any suggestions or a different approach would be appreciated.

(Posted this in drawing.ng but no solutions as of yet).

Thks in advance, GW


'//----------------------------------------------------------------\\

Private Sub oPrintDoc_PrintPage(ByVal sender As Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs)

Dim grfx As Graphics = e.Graphics


LS_PBH_7310(grfx, grp, ipMgns) '// Prints boxes, lines and static text
for each page

If mi_Pgn <= 1 Then

'// Sub with details to be printed (some 12 pages of code. Passed "e"
ByRef but appears to have no effect, probably because this is only called
once inside mi_Pgn <= 1)

LS_PAR7311(msSOurceFrm, msSQL, grfx, e)

End If

mi_Pgn += 1

End Sub '(oPrintDoc_PrintPage)

'\\--------------------------------------------//


'//----------------------------------------------------------------\\

Private Sub LS_PAR7311(....)


Do While Critera "A"

'/ Print Details for criteria "A"


Do While Ctriteria "B"

Do While Criteria "C"

'// gather details for "C"

End Do '("C")

'// Print Details for "C"

if iCnt = 5

iCnt = 0

e.HasMorePages = True '*** <== This is where I'm stuck, need to
do a page feed WITHOUT the loop. ***

'// Print another template with lines and static text thru
LS_PBH7310()

end if '(iCnt = 5)

End Do '("B")

'// Print Details for "B"

End Do '("C")

End Sub '(LS_PAR7311)

'\\--------------------------------------------//
 
GW said:
Trying to force a new page when required using e.HasMorePages = True but not
having much luck.

All prints OK except for trying to figure out how to do a page feed without
exiting the loop.

There is a lot of data gathering from DB in each loop so exiting the loop is
not an option.

All the examples for multipage printing I found so far are based on printing
simple text from a streamreader , or list box, etc.

LS_PAR7311 is to be called only once.

Tried placing the code for LS-PAR7311 inside the PrintPage but that didn't
do the trick either.

Any suggestions or a different approach would be appreciated.

(Posted this in drawing.ng but no solutions as of yet).

Thks in advance, GW


'//----------------------------------------------------------------\\

Private Sub oPrintDoc_PrintPage(ByVal sender As Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs) Handles oPrintDoc.PrintPage

Dim grfx As Graphics = e.Graphics


LS_PBH_7310(grfx, grp, ipMgns) '// Prints boxes, lines and static text
for each page

If mi_Pgn <= 1 Then

'// Sub with details to be printed (some 12 pages of code. Passed "e"
ByRef but appears to have no effect, probably because this is only called
once inside mi_Pgn <= 1)

LS_PAR7311(msSOurceFrm, msSQL, grfx, e)

End If

mi_Pgn += 1

End Sub '(oPrintDoc_PrintPage)

'\\--------------------------------------------//


'//----------------------------------------------------------------\\

Private Sub LS_PAR7311(....)


Do While Critera "A"

'/ Print Details for criteria "A"


Do While Ctriteria "B"

Do While Criteria "C"

'// gather details for "C"

End Do '("C")

'// Print Details for "C"

if iCnt = 5

iCnt = 0

e.HasMorePages = True '*** <== This is where I'm stuck, need to
do a page feed WITHOUT exiting the loop. ***

'// Print another template with lines and static text thru
LS_PBH7310()

end if '(iCnt = 5)

End Do '("B")

'// Print Details for "B"

End Do '("C")

End Sub '(LS_PAR7311)

'\\--------------------------------------------//
 
Back
Top