Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tamar's book strikes again
Message
From
28/10/2023 16:31:14
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Tamar's book strikes again
Miscellaneous
Thread ID:
01687133
Message ID:
01687133
Views:
120
Likes (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.
Next
Reply
Map
View

Click here to load this message in the networking platform