Crystal Reports - Export XML String as Text file

136 Views Asked by At

I have a crystal reports file with a single Field that displays an XML string and need to export this as a .txt file. When I export the file, I'm getting line breaks and as a result when converting the .txt file to an XML file the data nodes are incorrect and out of line.

Looking for ideas and any help would be greatly appreciated.

Here's example of Source Data, is one large string in a single field.

<?xml version="1.0" encoding="UTF-8"?> <DataImport><JournalDetail><Division>23</Division><AccountId/>

Exporting to Text I get the below.

<?xml version="1.0" encoding="UTF-8"?> <DataImport><JournalDetail><Divisio
n>23</Division><AccountId/>

This is what I need.

<?xml version="1.0" encoding="UTF-8"?> <DataImport><JournalDetail><Division>23</Division>
<AccountId/>

I tried changing the characters per inch when exporting that's not getting what I need.

3

There are 3 best solutions below

0
mweber On

Export as CSV and adjust CSV export options to avoid text qualifiers.

0
MilletSoftware On

You can have full control over the text Crystal writes to a file by creating or using a Crystal Reports UFL (User Function Library).

Ken Hamady maintains a list of 3rd-party UFLs here. Some of them provide functions for writing content to a text file.

0
APB Reports On

Try and set the font size to 1. Characters per inch: 40 Number of lines per page: 0

This should ensure that string does not exceed a single line.