Excel column formatting using ExcelFormat xcomp

Andy Hilton andyh at totallybrilliant.com
Sat Sep 19 16:31:32 EDT 2020


Folks

Am trying to get a little fancier with my excel spreadsheet creation….

Starting with something very simple - columns 12 to 17 of a spreadsheet I am creating want to be formatted as a percentage (or kXLNumFormatPercent_d2 in ExcelFormat speak)

So this is what I have created :

Do oExcel.$initialize(pExportFormat) 
Do oExcel.$populatewithlist(ExportList,pColumnHeaderFormat,HeaderRow) 
Calculate Sheet as oExcel.$getSheet(1)
Calculate Format as oExcel.$addFormat()
Calculate Format.$borderleft as kXLBorderStyleDashDot
Calculate Format.$bordertop as kXLBorderStyleDashDot
Calculate Format.$borderright as kXLBorderStyleDashDot
Calculate Format.$borderbottom as kXLBorderStyleDashDot
Calculate Format.$numformat as kXLNumFormatPercent_d2
Do Sheet.$setCol(12,17,9,Format,kFalse) Returns #F
Do oExcel.$save(pPathName)

Fundamentally this works in that columns 12 to 17 *do* have their width set (the third parameter of $setCols), and all cells beneath my own data are shown with the border style (I added the border style as its easier to visually see what happens !)

However all of my actual data cells are unaffected by this call - does anyone know why this is ??

Andy Hilton
Totally Brilliant Software Inc
Phone (US) : (863) 409 4870 
Phone (UK) : 0207 193 8582
Web : www.totallybrilliant.com <http://www.totallybrilliant.com/> 
Helpdesk : http://totallybrilliant.kayako.com
Email : andyh at totallybrilliant.com




More information about the omnisdev-en mailing list