Omnis Studio8 - append column titles to an exported csv file

Jef Leys | Desim jef.leys at desim.be
Fri Sep 25 05:25:10 EDT 2020




Hi,

This how I add column names (there in the field description) in the export file.

		Do $cclass.$ivardefs.$makelist($ref.$name,$ref.$desc) Returns iVarList
		Do iVarList.$redefine(iNaam,iDesc)
		Do iList.$cols.$first() Returns rCol
		While rCol
			Do ColNamesRow.$cols.$add(rCol().$name,kCharacter,kSimplechar,1000)
			Calculate ColNamesRow.[rCol().$name] as $cinst.$ReturnDesc(rCol.$name)
			Do iList.$cols.$next(rCol) Returns rCol
		End While
		Do oExcelWorkbook.$initialize(kXLxlsx)
		Do oExcelWorkbook.$populatewithlist(iList,kXLPopulateCustomHeader,ColNamesRow)
		Do oExcelWorkbook.$save(Path)


$ReturnDesc

Do iVarList.$search($ref.iNaam=pVarName,1,0,0,0) Returns rLine
Calculate DescName as iVarList.[rLine].iDesc
Do iVarList.$search(kFalse)
Quit method DescName




> Op 24 sep. 2020, om 15:56 heeft Plum Hollow Software <plum_hollow at cogeco.ca> het volgende geschreven:
> 
> Hi List,
> 
> I have records being exported from an invoice file but now they (end loser, I mean end user) want column titles also.  Any easy way to attach column titles to an export report?
> 
> 
> Thanks,
> 
> Randy Wilson
> Plum Hollow Software Inc.
> plum_hollow at cogeco.ca
> 905-563-6516
> 
> 
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 




More information about the omnisdev-en mailing list