*** note: kolonlar is my array about user select which colums. EXTERNAL ARRAY kolonlar LOCAL scrmouse scrmouse=_screen.MousePointer _screen.MousePointer= 11 * cari hesap genel durum raporu IF !DIRECTORY("..\temp") MD ..\temp ENDIF totalbaslik=.f. * Create an SFReportFile object and set some properties. loReport = newobject('SFReportFile', 'SFRepObj') rfilename="..\temp\"+SYS(2015)+".FRX" loReport.cReportFile = m.rfilename loReport.lSummaryBand = .T. loReport.cFontName = 'Arial' loreport.nfontsize = m.xdfboy *loreport.lwholepage=.t. * Set the height of the page header band. loPageHeader = loReport.GetReportBand('Page Header') loPageHeader.nHeight = 8 * Set the height of the detail band. loDetail = loReport.GetReportBand('Detail') loDetail.nHeight = 1 * Set the height of the summary band. loSummary = loReport.GetReportBand('Summary') loSummary.nHeight = 3 *-------- qbakiye ------- (this is report variable) loVariable = loReport.CreateVariable() loVariable.cName = 'qbakiye' loVariable.cValue = 'giren-cikan' loVariable.cInitialValue = 0 loVariable.cTotalType = 'Sum' lovariable.nresetongroup = 1 dpos=0 &&----- sol hiza ------- *----------- carikod -------------- IF kolonlar(1)#0 * Insert the column heading. loObject = loPageHeader.AddItem('Text') loObject.cExpression = caption('Cari Kod') loObject.nVPosition = 5 loObject.nHPosition = dpos loObject.lFontBold = .T. loObject.cAlignment = 'Left' * Insert the field. loObject = loDetail.AddItem('Field') loObject.cExpression = 'kod' loObject.nWidth = kolonlar(1) loObject.nVPosition = 0 loObject.nHPosition = dpos loObject.cAlignment = 'Left' loObject.cPicture = 'XXXXXXXXXXXXXXXXXXXX' dpos=dpos+kolonlar(1)+1 ENDIF *----------- adý+soyadý -------------- IF kolonlar(2)#0 * Insert the column heading. loObject = loPageHeader.AddItem('Text') loObject.cExpression = caption("Adý, Soyadý") loObject.nVPosition = 5 loObject.nHPosition = dpos loObject.lFontBold = .T. loObject.cAlignment = 'Left' * Insert the field. loObject = loDetail.AddItem('Field') loObject.cExpression = 'allt(adi)+ALLTRIM(soyadi)' loObject.nWidth = kolonlar(2) loObject.nVPosition = 0 loObject.nHPosition = dpos loObject.cAlignment = 'Left' loObject.cPicture = REPLICATE('X',66) dpos=dpos+kolonlar(2)+1 ENDIF *----------- kredi -------------- IF kolonlar(29)#0 * Insert the column heading. loObject = loPageHeader.AddItem('Text') loObject.cExpression = PADL(caption("Kredi"),kolonlar(29)) loObject.nVPosition = 5 loObject.nHPosition = dpos loObject.lFontBold = .T. loObject.cAlignment = 'Right' * Insert the field. loObject = loDetail.AddItem('Field') loObject.cExpression = 'kredi' loObject.nWidth = kolonlar(29) loObject.nVPosition = 0 loObject.nHPosition = dpos loObject.cAlignment = 'Right' loObject.cPicture = '999,999,999,999' totalbaslik() loObject = loSummary.AddItem('Line') loObject.nWidth = kolonlar(29) loObject.nVPosition = 1 loObject.nHPosition = dpos loObject.nForeColor = 8388863 loobject.npensize = 4 loObject = loSummary.AddItem('Field') loObject.cExpression = 'kredi' loObject.nWidth = kolonlar(29)+1 loObject.nVPosition = 2 loObject.nHPosition = dpos-1 loObject.cAlignment = 'Right' loObject.cTotalType = 'Sum' loObject.cPicture = '9999,999,999,999' loObject.lFontBold = .T. loObject.cDataType = 'N' dpos=dpos+kolonlar(29)+1 ENDIF *----------- iskonto -------------- IF kolonlar(36)#0 * Insert the column heading. loObject = loPageHeader.AddItem('Text') loObject.cExpression = PADL(caption("Ýsk.%"),kolonlar(36)) loObject.nVPosition = 5 loObject.nHPosition = dpos loObject.lFontBold = .T. loObject.cAlignment = 'Right' * Insert the field. loObject = loDetail.AddItem('Field') loObject.cExpression = 'iskonto' loObject.nWidth = kolonlar(36) loObject.nVPosition = 0 loObject.nHPosition = dpos loObject.cAlignment = 'Right' loObject.cPicture = '@z 999.999' dpos=dpos+kolonlar(36)+1 ENDIF *------------- field'lar bitti -------------------- * Insert the page header. loObject = loPageHeader.AddItem('Field') loObject.cExpression = 'iif(EMPTY(xxsiradi),xxsirkod,xxsiradi)' loObject.nWidth = dpos loObject.nHPosition = 0 loObject.nVPosition = 0 loObject.cAlignment = 'Left' loobject.cfontname = 'Times New Roman' loObject.lFontBold = .T. loobject.nfontsize = 10 loObject.nForeColor = 8421376 loObject = loPageHeader.AddItem('Field') loObject.cExpression = 'caption("Cari Kart Genel Raporu")' loObject.nWidth = dpos loObject.nHPosition = 0 loObject.nVPosition = 0 loobject.cfontname = 'Times New Roman' loObject.cAlignment = 'Center' loObject.lFontBold = .T. loobject.nfontsize = 20 loObject.nForeColor = 128 * Insert the date. loObject = loPageHeader.AddItem('Field') loObject.cExpression = 'dtoc(date())+" "+TIME()' loObject.nWidth = 19 loObject.nHPosition = 0 loObject.nVPosition = 2 loObject.lFontBold = .T. * Insert the page number. loObject = loPageHeader.AddItem('Field') loObject.cExpression = 'padl(caption("Sayfa : ")+; ALLTRIM(TRANSFORM(_pageno,"9,999"))+"/"+; ALLTRIM(TRANSFORM(_pagetotal,"9,999")),19)' loObject.nWidth = 19 loObject.nVPosition = 2 loObject.nHPosition = dpos-19 loObject.cAlignment = 'Right' loObject.lFontBold = .T. * Insert a line above the column headings. loObject = loPageHeader.AddItem('Line') loObject.nWidth = dpos loObject.nVPosition = 4 loObject.nHPosition = 0 loObject.nPenSize = 6 loObject.nForeColor = rgb(0, 0, 255) * Insert a line below the column headings. loObject = loPageHeader.AddItem('Line') loObject.nWidth = dpos loObject.nVPosition = 6 loObject.nHPosition = 0 * Create the report, then let's run it. *npageorientation *npagesize *ncopies *coutput *cdevice loreport.npageorientation=xorient-1 loReport.Save() * Specifically release the report object so proper object cleanup occurs. loReport.Release() _screen.MousePointer=m.scrmouse RETURN m.rfilename FUNCTION totalbaslik IF totalbaslik RETURN ENDIF totalbaslik=.t. loObject = loSummary.AddItem('Text') loObject.cExpression = "Genel Toplam :" loObject.nVPosition = 2 loObject.nHPosition = dpos-15 loObject.lFontBold = .T. loObject.cAlignment = 'Left' RETURN