Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Control in Reports

Status
Not open for further replies.

splaisance

Programmer
Jul 2, 2001
67
0
0
US
I am fairly new to Clarion and I am trying to get this to work the way needed. I have a report where I need to be able to print subtitles based on changes in the data. Along with these subtitles, the column headers should be reprinted. I put the column headers in my report header and I have another 'detail' band with the headers to call in the middle of a page. I am trying to determine the page break by adding up the height of the bands as they are printed and comparing to the report's page height. But for some reason these values are off. I am printing the detail bands myself in code instead of letting clarion doing it automatically.

I am using Clarion 6.3 Build .9054. Has anyone done this and have any suggestions or help? Basically the report needs to be an account reconciliation which has a summary section then cleared items, uncleared items, then new transactions.
 
Hi!

Unluckily, Clarion does not have an EVENT to notify a page overflow to date. Unless you have all bands defined as Detail Bands of FIXED height, it will be difficult to calculate and predict a page change.

Do you have Group Header information in the Report Header?

Is doing a Page Break on a Group Footer not viable?

If you post your report structure here, I can be in a better position to help you.

Regards
 
I've seen how there is no easy or straight-forward way to determine a page break. What I am trying right now does not have any group headers or group footers. I will post my report structure below. All the detail bands have a fixed height. I have the BlankDetail band for when the calculations determine the report to be close to the end of a page and the column headers need to be reprinted because there is a status change yet the column header (ItemHeader) detal bank is too large to fit here. If I have my code print this detail, it gets printed on the next page but since I have the Header including these column headers also, then the report would show them twice. What I was trying to do was in this case change the height of the BlankDetail band to the height available from my calculations and the available page height. This would (in my thinking) then signal the report to go to the next page and I would skip printing this additional column header line this time.


Report Structure:
Report REPORT('Reconciliation Details Report'), AT(219,1292,8000,9260), PAPER(PAPER:LETTER), PRE(RPT), FONT('Arial', 10, , FONT:regular, CHARSET:ANSI), THOUS
HEADER,AT(229,198,8000,1104),USE(?Header)
STRING(@s50),AT(2073,52,3833,208),USE(CCTR:NAME),CENTER
STRING('Reconciliation Details'),AT(3292,240),USE(?String2),TRN
STRING('Statement Period:'),AT(2302,417),USE(?String3),TRN
STRING(@D2B),AT(4542,417),USE(loc:StmntEndDate),LEFT(1)
STRING(@s50),AT(21,719,3427,188),USE(HdrItemDesc),FONT(,8,,FONT:bold)
STRING('Balance'),AT(7344,906),USE(?StrBalance),TRN,FONT(,8,,FONT:bold)
LINE,AT(0,1066,7990,0),USE(?HdrLine),COLOR(COLOR:Black)
STRING('Payable'),AT(2365,906),USE(?StrPayable),TRN,FONT(,8,,FONT:bold)
STRING('CL'),AT(5260,906),USE(?StrCL),TRN,FONT(,8,,FONT:bold)
STRING('Date'),AT(219,906),USE(?StrDate),TRN,FONT(,8,,FONT:bold)
STRING('Nbr'),AT(813,906),USE(?StrNbr),TRN,FONT(,8,,FONT:bold)
STRING('Vendor'),AT(1250,906),USE(?StrVendor),TRN,FONT(,8,,FONT:bold)
STRING('Amount'),AT(6083,906),USE(?StrAmount),TRN,FONT(,8,,FONT:bold)
STRING(@D2B),AT(3510,417),USE(loc:StmntFromDate),LEFT(1)
STRING('To'),AT(4323,417),USE(?String4),TRN
END
SumHeader DETAIL,AT(,,,229),USE(?SumHeader)
STRING('Summary of Activity Since Your Last Statement'),AT(21,10,3375,208),USE(?String15),TRN,FONT(,,,FONT:bold)
LINE,AT(10,188,8000,0),USE(?Line2),COLOR(COLOR:Black),LINEWIDTH(1)
END
SumDetail DETAIL,AT(,,,188),USE(?SumDetail)
STRING(@n-17.2),AT(6100,10),USE(SumBalance),DECIMAL(4)
STRING(@s75),AT(646,10,5469,208),USE(SumDesc)
STRING(@s6),AT(30,10),USE(SumNbr)
END
ItemHeader DETAIL,AT(,,,458),USE(?ItemHeader)
STRING(@s50),AT(21,73,3542,188),USE(ItemDesc),FONT(,8,,FONT:bold)
STRING('Balance'),AT(7344,260),USE(?String26),TRN,FONT(,8,,FONT:bold)
LINE,AT(0,415,7990,0),USE(?HdrLine:2),COLOR(COLOR:Black)
STRING('CL'),AT(5260,260),USE(?String24),TRN,FONT(,8,,FONT:bold)
STRING('Amount'),AT(6094,260),USE(?String25),TRN,FONT(,8,,FONT:bold)
STRING('Date'),AT(229,260),USE(?String20),TRN,FONT(,8,,FONT:bold)
STRING('Vendor'),AT(1260,260),USE(?String22),TRN,FONT(,8,,FONT:bold)
STRING('Payable'),AT(2375,260),USE(?String23),TRN,FONT(,8,,FONT:bold)
STRING('Nbr'),AT(813,260),USE(?String21),TRN,RIGHT,FONT(,8,,FONT:bold)
END
ItemDetail DETAIL,AT(,,,198),USE(?ItemDetail)
STRING(@N-16.2),AT(6708,10),USE(DtlBalance),DECIMAL(1),FONT(,8,,)
STRING(@s15),AT(1260,10),USE(DtlVendor),FONT(,8,,)
STRING(@n-14.2),AT(5573,10),USE(DtlAmount),DECIMAL(1),FONT(,8,,)
STRING(@D01B),AT(10,10),USE(DtlDate),LEFT,FONT(,8,,)
STRING(@s40),AT(2375,0,2700,208),USE(DtlPayable),FONT(,8,,)
STRING(@N-6),AT(615,10),USE(DtlCkNbr),RIGHT,FONT(,8,,)
STRING(@s1),AT(5281,10),USE(DtlCleared),FONT(,8,,)
END
SummaryLine DETAIL,AT(,,,177),USE(?SummaryLine)
LINE,AT(10,50,7975,0),USE(?Line3),COLOR(COLOR:Black),LINEWIDTH(1)
END
TotalDetails DETAIL,AT(,,,219),USE(?TotalDetails)
STRING(@s70),AT(0,10,4583,208),USE(TtlDesc),FONT(,8,,FONT:bold)
STRING(@N-16.2),AT(6708,10),USE(TtlBalance),DECIMAL(1),FONT(,8,,)
END
ItemTotals DETAIL,AT(,,,396),USE(?ItemTotals)
STRING(@s75),AT(104,30,4896,208),USE(SumDesc,,?SumDesc:2),FONT(,8,,FONT:bold)
STRING(@N-16.2),AT(6708,42),USE(SumBalance,,?SumBalance:2),DECIMAL(1),FONT(,8,,)
LINE,AT(7031,10,825,0),USE(?Line4),COLOR(COLOR:Black)
END
ItemHeader2 DETAIL,AT(,,,250),USE(?ItemHeader2)
STRING(@s40),AT(21,30,2900,208),USE(ItemHdrType),LEFT,FONT(,8,,FONT:bold)
END
BlankDetail DETAIL,AT(,,,302),USE(?BlankDetail)
END
FOOTER,AT(229,10552,8000,250),USE(?Footer)
STRING('Time:'),AT(1688,42),USE(?ReportTimePrompt),TRN,FONT(,8,,)
STRING('<<-- Time Stamp -->'),AT(2021,42),USE(?ReportTimeStamp),TRN,FONT(,8,,)
STRING(@pPage <<<<#p),AT(7333,42),USE(ReportPageNumber),FONT(,8,,)
STRING('Date:'),AT(83,40),USE(?ReportDatePrompt),TRN,FONT(,8,,)
STRING('<<-- Date Stamp -->'),AT(438,42),USE(?ReportDateStamp),TRN,FONT(,8,,)
END
END


 
Hi!

From what I can see, you are using LETTER which is 8500 x 11500 and all your detail bands are of fixed height and you do not have any TEXT controls of variable height. Your detail area is 9260. When do you check for page break - before or after printing a band. Ideally it should be before printing a band i.e.

UsedReportHeight USHORT


IF (9260 - UsedReportHeight) < 198
!do page break
END

PRINT(RPT:ItemDetail)

UsedReportHeight += 198

Since a similar approach needs to be done for ALL detail bands, you could generalize it with a local procedure i.e.

Code:
In the first embed of the data section ::

             MAP
               CheckAndPrint(LONG ReportBandFEQ)
             END

UsedReportHeight      USHORT

In the Local Procedures embed ::

CheckAndPrint    PROCEDURE(LONG ReportBandFEQ)

BandHeight       USHORT

  CODE

  BandHeight = ReportBandFEQ{PROP:Height}

  IF (9260 - UsedReportHeight) < BandHeight
     !do page break
  END

  PRINT(Report, ReportBandFEQ)

  UsedReportHeight += BandHeight

  RETURN

Usage ::

  CheckAndPrint(?ItemDetail)

  CheckAndPrint(?SumDetail)

Regards
 
Would it make a big difference if the var used for UsedReportHeight is LONG or USHORT?
Would doing this work if the BlankDetail detail band had been defined as default - even if its height was changed in the code? I believe maybe that was throwing everything off for me because I was doing as you showed except I hadn't set it into its own procedure at this point (wanted to get it to work before I did anything else). And yes I was checking before I printed a line.

Thanks for your help!
Shannon
 
Hi Shannon,

No, I used a USHORT since it was more than enough. A LONG will also be fine.

You can change the PROP:Height of the BlankDetail before calling CheckAndPrint(?BlankDetail).

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top