Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tamar's book strikes again
Message
De
28/10/2023 16:31:14
Bill Fitzgerald (En ligne)
Woodbury Systems Group
Hamilton, New Jersey, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Tamar's book strikes again
Divers
Thread ID:
01687133
Message ID:
01687133
Vues:
121
J'aime (2)
I've said before that the textbook "Microsoft Office Automation with Visual Foxpro" by our Tamar Granor and Della Martin is one of the most useful technical books I've bought.
I do a lot of Excel automation with .NET. Many customers want their invoices transmitted via email or FTP in Excel format. Usually they require a format dictated by the A/P system they're using and some of those systems can be pretty finicky.
Since my customer can't get paid till I get it right, I usually give these projects high priority.
Excel has an annoying way of displaying 25.20 as 25.2 as a default and some systems won't accept that.
I vaguely remembered a way to format cells to get that trailing zero, but I couldn't remember the exact syntax.
Googling was no help, so I looked at that 23 year old book and sure enough the exact case I wanted to handle was there.
Translating the VFP to C# was simple.
                // Tax formatting
                Excel.Range taxrange = (Excel.Range)xlWorkSheet.get_Range("D2", "D" + reportsDs.view_guessbillingsummary.Rows.Count + 1.ToString().TrimEnd().TrimStart());
                taxrange.NumberFormat = "###,###,###.#0";
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform