I don't bother trying to determine the point width. I simply set a test sheet up the way I want it to look with the correct font etc. then use the point width in the resulting XML doc. Remember this is a column value - so using %Trim against a field normally wouldn't help as that field may be short content wise and you have to determine column width for the whole sheet. That's why I normally do it "by hand" after analyzing the file to determining what column width will handle the majority of data without looking "silly" on the short fields.
Jon, I wish to thank you for including the Excel example as I have used that many times to communicate with feeds off the System i and have found it the best way to do so using XML & CGIDEV2. Simpler is most often better when it comes to code design and the fact that an RPG developer of very little experience can pick it up quickly w/o knowledge of XML is very beneficial in our shop, not to mention the fact that many are experienced in Excel but may not be in XML so it is a well accepted means of data exchange.
I have been using the same technique to replace various paper reports, especially exception reports and periodic summaries (sales, performance, quotas, commissions ect...) Here is a similar example: http://tinyurl.com/q7v9h
Nice example - thanks for sharing it with us. How did you build the original XML - from scratch or from an example sheet with the look/feel you wanted?
Comment