Wow, I find SPost29's approach to be a little heavy handed.Īlso, yes, searching is good, but since I've created a little helper text file for myself and I'm waiting on a huge task to complete here at work, I don't mind a quick cut and paste: You of course can add more as you learn more or need to do more. These are the basics, a little tedious each time, but make yourself and export to Excel template report and you can copy and paste a lot of the code. IF (ExportToExcel) THEN BEGIN // this is your dataĮnterCell(RowNo,1,"Document No.",FALSE,FALSE,'') ĮnterCell(RowNo,2,FORMAT("No."),FALSE,FALSE,'00000')ĮnterCell(RowNo,3,"Vendor Item No.",FALSE,FALSE,'') ĮnterCell(RowNo,4,FORMAT(Quantity),FALSE,FALSE,'0') ĮnterCell(RowNo : Integer ColumnNo : Integer CellValue : Text Bold : Boolean UnderLine : Boolean NumberFormat : Text)ĮxcelBuf.VALIDATE("Column No.",ColumnNo) ĮxcelBuf."Cell Value as Text" := CellValue RowNo += 1 // puts space after header before body starts IF (ExportToExcel) AND (CurrReport.PAGENO = 1) THEN BEGIN // these are the headingsĮnterCell(RowNo,1,Text002,TRUE,FALSE,'') ĮnterCell(RowNo,2,Text001,TRUE,FALSE,'') ĮnterCell(RowNo,3,Text012,TRUE,FALSE,'') ĮnterCell(RowNo,4,Text004,TRUE,FALSE,'') Report - OnPostReport() this handles the creation of the workbook and worsheet and gives control to the userĮxcelBuf.CreateSheet('Name','Name',COMPANYNAME,USERID) IF (ExportToExcel) THEN BEGIN // this gets the buffer ready to go Users almost always want it to default to export I found "export budget to excel" to be way overloaded with extra code and hard to understand.ĮxcelBuffer is set as a global temp tableĮxporttoexcel is a boolean on the request form to choose to export to Excel or not
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |