clear ** END HEADER -- do not remove this line // // Generated on 2014-10-15 // local r r = new test_countReport() r.render() class test_countReport of REPORT with (this) autoSort = false endwith this.DBASESAMPLES1 = new DATABASE(this) with (this.DBASESAMPLES1) left = 1080.0 top = 1080.0 width = 360.0 height = 360.0 databaseName = "DBASESAMPLES" active = true endwith this.EMPLOYEES1 = new QUERY(this) with (this.EMPLOYEES1) left = 1080.0 top = 1080.0 width = 360.0 height = 360.0 database = form.form.dbasesamples1 sql = "select e.*,substring(lastname from 1 for 1) as intial from employees e order by lastname" requestLive = false active = true endwith this.PAGETEMPLATE1 = new PAGETEMPLATE(this) with (this.PAGETEMPLATE1) height = 16837.0 width = 11905.0 marginTop = 1080.0 marginLeft = 1080.0 marginBottom = 1080.0 marginRight = 1080.0 gridLineWidth = 0 endwith this.PAGETEMPLATE1.STREAMFRAME1 = new STREAMFRAME(this.PAGETEMPLATE1) with (this.PAGETEMPLATE1.STREAMFRAME1) height = 11592.0 left = 360.0 top = 1365.0 width = 9360.0 form.STREAMFRAME1 = form.pagetemplate1.streamframe1 endwith with (this.printer) duplex = 1 // None orientation = 1 // Portrait paperSource = 268 paperSize = 9 resolution = 3 // Medium color = 2 // Color trueTypeFonts = 1 // Bitmap endwith this.STREAMSOURCE1 = new STREAMSOURCE(this) this.STREAMSOURCE1.GROUP1 = new GROUP(this.STREAMSOURCE1) with (this.STREAMSOURCE1.GROUP1) groupBy = "intial" endwith with (this.STREAMSOURCE1.GROUP1.footerBand) onRender = class::FOOTERBAND_ONRENDER height = 250.0 endwith with (this.STREAMSOURCE1.GROUP1.headerBand) height = 250.0 endwith this.STREAMSOURCE1.GROUP1.headerBand.TEXTINTIAL1 = new TEXT(this.STREAMSOURCE1.GROUP1.headerBand) with (this.STREAMSOURCE1.GROUP1.headerBand.TEXTINTIAL1) height = 300.0 left = 390.0 top = 35.0 width = 1530.0 variableHeight = true prefixEnable = false text = {||this.form.employees1.rowset.fields["intial"].value} endwith with (this.STREAMSOURCE1.detailBand) height = 250.0 endwith this.STREAMSOURCE1.detailBand.TEXTEMPLOYEEID1 = new TEXT(this.STREAMSOURCE1.detailBand) with (this.STREAMSOURCE1.detailBand.TEXTEMPLOYEEID1) height = 293.0 left = 525.0 top = 348.0 width = 1350.0 variableHeight = true prefixEnable = false alignHorizontal = 2 // Right text = {||this.form.employees1.rowset.fields["employeeid"].value} endwith this.STREAMSOURCE1.detailBand.TEXTFIRSTNAME1 = new TEXT(this.STREAMSOURCE1.detailBand) with (this.STREAMSOURCE1.detailBand.TEXTFIRSTNAME1) height = 293.0 left = 2115.0 top = 348.0 width = 1530.0 variableHeight = true prefixEnable = false text = {||this.form.employees1.rowset.fields["firstname"].value} endwith this.STREAMSOURCE1.detailBand.TEXTLASTNAME1 = new TEXT(this.STREAMSOURCE1.detailBand) with (this.STREAMSOURCE1.detailBand.TEXTLASTNAME1) height = 293.0 left = 3990.0 top = 348.0 width = 1530.0 variableHeight = true prefixEnable = false text = {||this.form.employees1.rowset.fields["lastname"].value} endwith this.STREAMSOURCE1.detailBand.TEXTHIREDATE1 = new TEXT(this.STREAMSOURCE1.detailBand) with (this.STREAMSOURCE1.detailBand.TEXTHIREDATE1) height = 293.0 left = 6015.0 top = 333.0 width = 1080.0 variableHeight = true prefixEnable = false text = {||this.form.employees1.rowset.fields["hiredate"].value} endwith with (this.reportGroup.footerBand) height = 250.0 endwith with (this.reportGroup.headerBand) height = 0.0 endwith this.firstPageTemplate = this.form.pagetemplate1 this.form.pagetemplate1.nextPageTemplate = this.form.pagetemplate1 this.form.pagetemplate1.streamframe1.streamSource = this.form.streamsource1 this.form.streamsource1.rowset = this.form.employees1.rowset function FOOTERBAND_onRender local oStream, nCount, nSpaceRemaining, nSpaceNeeded,cInitial oStream = this.parent.parent oStream.bookMark = oStream.rowset.bookMark() if not oStream.rowset.endofset oStream.rowset.next() nCount = 0 cInitial = substr(oStream.rowset.fields["lastname"].value,1,1) do while oStream.rowset.fields["lastname"].value = cInitial ; and not oStream.rowset.endofset oStream.rowset.next() nCount ++ enddo oStream.rowset.goto(oStream.bookmark) endif nSpaceRemaining = this.streamframe.height - this.renderOffset nSpaceNeeded = 250+250+(nCount*641) //space for header, footer and rows if nSpaceRemaining < nSpaceNeeded this.parent.headerband.beginNewframe := true else this.parent.headerband.beginNewframe := false endif return endclass