Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tamar's book strikes again
Message
 
To
28/10/2023 16:31:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01687133
Message ID:
01687139
Views:
90
>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";
>
>
...
loExcel.Selection.NumberFormat = "#,##0.00" && Or whatever you want;
...
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform