Imagine that, an ON-TOPIC post from me!

I'm working up a report for a client that does a SQL SELECT into a
cursor to aggregate totals, format, filter, and sort data, and the
result gets pasted into a pre-formatted spreadsheet, using:

_VFP.DataToClip(SELECT(), RECCOUNT(), 3)

to paste a tab-delimited columnar block into the Windows clipboard.

(I'm using LibreOffice Calc, not sure if that makes a difference).

VFP's SQL preprocessor is creating the result cursor column sizes
based on the source data, so a C(30) source datatable column gets 30
characters, right-padded with spaces.

Since this is an output document and the client wants it to look as
pretty as posslble, they're optimizing column widths, and the
right-padding is leaving the columns bloated. Centered-text columns
come out even worse.

Right now, I'm post-processing the data in the spreadsheet with a
Regular Expression Replace of "[ \t]+$" with empty space, but was
wondering if anyone knew a trick to get this trimming to occur in Fox?

One thing I tried was changing the field argument in the select from
sourcetable.fieldname to PADR(RTRIM(sourcetable.fieldname),20,CHR(0))
to zero-fill the strings. It worked for the cursor, but the fields
still show as filled in the spreadsheet.

Any ideas?

-- 
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/CACW6n4sSUjfrZJ8pHaStM_TocY5rDv3XqkeN_FeZ4W5xGq=e...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to