How to get valuelist value in excel/text export

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

How to get valuelist value in excel/text export

Postby svisser1448437380 » Thu Dec 17, 2015 12:31 pm

Hello,

I want to export showed record to Excel or CSV. For one field the display value comes from a valuelist. How can I get the display value from the valuelist in the export instead of the realvalue.

Example:
plugins.excelxport.excelExport(foundset,['from','to','status','releation1.name','relation2.department''])

Status is an integer for which I want to get the displayvalue from valuelist vls_status.

vls_status:
1 - draft
2 - new
3 - active
4 - completed
saNder Visser
IT2serve
Servoy 7.4.7 / Windows 8.1
User avatar
svisser1448437380
 
Posts: 10
Joined: Wed Nov 25, 2015 9:43 am
Location: Zoetermeer, Netherlands

Re: How to get valuelist value in excel/text export

Postby Peter de Groot » Thu Dec 17, 2015 1:38 pm

Hi,

Code: Select all
plugins.excelxport.excelExport(foundset,['from','to','status','releation1.name','relation2.department''])


Maybe this will work;

Code: Select all
plugins.excelxport.excelExport(foundset,['from','to',application.getValueListDisplayValue('your valuelist', status),'releation1.name','relation2.department'']


Regards,

Peter
Servoy 8.1.3

Siemens Heat Transfer Technology B.V.
User avatar
Peter de Groot
 
Posts: 210
Joined: Thu Jan 10, 2008 8:38 pm
Location: Not sure...

Re: How to get valuelist value in excel/text export

Postby patrick » Thu Dec 17, 2015 1:44 pm

that won't work, because that's not a dataprovider. You could create a calculation 'status_display' doing that and use that calculation then as a dataprovider.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3633
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: How to get valuelist value in excel/text export

Postby svisser1448437380 » Thu Dec 17, 2015 4:53 pm

Thanks Patrick, using a calculation is the trick
saNder Visser
IT2serve
Servoy 7.4.7 / Windows 8.1
User avatar
svisser1448437380
 
Posts: 10
Joined: Wed Nov 25, 2015 9:43 am
Location: Zoetermeer, Netherlands


Return to Programming with Servoy

Who is online

Users browsing this forum: Bing [Bot] and 5 guests

cron