You said that you tried concatenating the columns together, but how did you do it? Did you just put the fields in the detail section of a report? It would be more or less impossible to get fixed column lengths and positions that way.
What do your fields look like? Are the text columns a fixed length with trailing spaces at the end? How do the number columns need to be formatted?
Basically, you can combine the fields into one record with specific formatting (field 1 in columns 1 - 10, field 2 in columns 11 - 25, etc.) using a formula. The formula would combine the fields into one long string and then you'd put that formula on the report, instead of the individual fields. The specifics will depend on your fields: How do the numbers need to be formatted? Do the string fields need to be padded out to a preset length? etc.
For example, let's say that you had a string field that needed to be padded out, if necessary, to 25 characters and a numeric field that needed to have 8 digits to the left of the decimal point and 2 to the right, with leading zeros. Your formula might look something like:
Left ({string field} + Space (25), 25) + CStr ({number field}, "00000000.00")
You'd do the same kind of thing for each field in your record. If you need delimiters between each field (eg. a comma or tab), just add those in between the fields. You can use ChrW (9) for a tab character.
James
Main Topics
Browse All Topics





by: raycruelPosted on 2009-01-12 at 09:27:08ID: 23355264
I am trying to use Crystal reports 11 to create an export flat text file. I have queried the necessary data, but have not been able to export a usuable fiel because of the parameters. Parameters require a set length of each field without adding zeros or commas.(added spaces are fine). I can create the file correclty, but when I attempt to export the file, the file automatically reformats with extra spaces and throws the file length count out of whack.