Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Print to CSV file

edited October 2004 in General
Hi,

If I print to CSV file, I don't want the text to be in quotes
i.e.:

I want this: 1111111,GCI London,London,123456,999

but I get this: 1111111,"GCI London","London", 123456,999

The report only has a details section. In the layout design, I selected
File->"Print to File Setup..." and selected "Comma Delimited". Selected
the Detail band and selected the order of the fields.

Any ideas on how I can get rid of the quotes around text fields...?

I use Delphi 5 (Ent) with RBuilder 6.03

Regards,
- Graeme -




--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Comments

  • edited October 2004
    Graeme,

    For future reference, please do not post to the newsgroups and to
    support@digital-metaphors.com. Thank you :)


    When the TextFileType is ftComman, quotes will be added around the string if
    it contains a comman or a space. Therefore GCI London will appear as "GCI
    London". However, something like London will not have quotes around it. This
    is consistent with most definitions of comma-delimited format.

    Options for customizing this behavior:

    1. Modify the source code. The source to TppTextFileDevice is contained in
    unit ppFileDev.pas. The method TppTextFileDevice.SavePageToFile contains the
    following line of code:

    if (FTextFileType = ftComma) and ((Pos(',', lsText) <> 0) or
    (Pos(#32, lsText) <> 0)) then
    lsText := '"' + lsText + '"';


    2. The architecture is open to created custom export device classes. You can
    copy the existing TextFileDevice and use it as a starting point for creating
    your own custom TmyTextFileDevice.




    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.