Link to home
Start Free TrialLog in
Avatar of mperez1216
mperez1216

asked on

exporting formatted data from crystal 9 to text file

I have Crystal Report 9 and am having difficulty in exporting data the way that I want to a text file.

My data as shown in CR9:

Part            Formatted Field
1234          00000100
1234A        00000100
12345A      00000200

Export to simple text file
What text file shows:

Part           Field
1234          00000100
1234A         00000100
12345A         00000100

You see how the second field is "shifted" over? I want the text file to show exactly what crystal shows. I am not too familiar with the text formatting of CR9. Maybe there is a way to format the first field to be width-specific. I can do this in Access no problem, but we are starting to use CR more and more.

I am sure that this is extremely simple, but I can't to locate the right wording to use the help files.
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mperez1216
mperez1216

ASKER

How do I know which font is "fixed-width". I've tried Arial and Courier New. Both yield same results.
Okay. I've got a riddle for you.

Why, when I open Notepad to display the exported file AND the font is Arial, the columns are not aligned properly THEN I change the font to Courier New and BOOM, everything lines up!?

I know you instructed me to use a fixed-width font in Crystal, but I didn't think that Notepad needs to same font. Also, if I DIDN'T change the font in Notepad and instead open a command prompt to open the file, the columns are aligned properly.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I accepted both answers as far as the selected font and I understood the steps 1-2 from rhinok. Have to look into use 'Fit Section', though. Additional question, to export using 12 CPI, do I change the font size on the Crystal Report? I don't seem to locate any other reference as far as CPI except that which you see on the report.
When you export to text or paginated text, you should see an option to specify characters per inch.  If you don't, then you may need to add or change  registry settings:

HKEY_CURRENT_USER\Software\Crystal Decisions\9.0\Crystal Reports\Export\TextExport\CharPerInch (REG_DWORD with a Hex value of C)

HKEY_CURRENT_USER\Software\Crystal Decisions\9.0\Crystal Reports\Export\TextExport\PromptAgain (REG_DWORD with a Hex value of 1)

~Kurt
Glad i could help

mlmcc