Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Export to Excel With Coloured Rows
Message
De
11/02/2013 05:02:59
 
 
À
11/02/2013 04:43:27
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01565703
Message ID:
01565709
Vues:
60
>>I am Having table which contains many Rows and columns.
>>
>>I want to Export export it to .XLS and I want that If filed remarks of my Table has "N" Value that row should be highlited in RED colour in exported .XLS file.
>>
>>Kinldy Guide. How to Do This
>
>After export, open the sheet (manually or, if you're up to it, via automation) and apply formatting. If automation, you'd have to loop through the rows, check the value in the remarks cell, and if it contains that value, apply the formatting to the whole row. Now I haven't done lot of excel automation last seven years, so the syntax is probably wrong:
>
>
>oSheet=oExcel.activeSheet
>for each oRow in oSheet.rows
>    if oRow.cells(32).value="your value"
>       oRow.color=0xff0000   && or whatever goes for red in excel
>    endif
>endfor
>
>Not sure if this is the proper way to get a reference to the active sheet, maybe you need to get active workbook first, then the sheet from it. I took 32 as an example; your remarks cell may be in any column - you'll know which.

I use NumberFormat
&& Currency
.NumberFormat = '#,###.00' + '_);[Red](' + '#,###.00' + ')'

or 
.NumberFormat = '#,###.00' + '_);[Red](' + '#,###.00' + ');'
Integer
.NumberFormat = '#,###' + '_);[Red](' + '#,###' + ')'

or 
.NumberFormat = '#,###' + '_);[Red](' + '#,###' + ');'
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform