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 04:43:27
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
11/02/2013 04:18:35
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:
01565707
Vues:
56
>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform