Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fixed Length txt file from Crystal Reports (11)

Status
Not open for further replies.

kad123

IS-IT--Management
Nov 15, 2018
6
0
0
US
Hi guys,
Need some help ..
I am trying to export a 366 bytes detail record and 47 bytes header record from crystal to .txt. A padspace is created for header and detail, used a formula to combine all fields. Those are all working perfectly fine (record length etc.), EXCEPT, When I export the file as .txt it's giving me two CRLF after each detail record. so after every detail record, there is blank record. How to eliminate the extra CRLF? By the way I tried the
as per PAJON's advise ( I made the textbox bigger than page margin, nothing works!
Appreciate your help. Thanks.
 
Try this. Make the text object exactly 22.5 inches wide. You may need to use a different printer driver to allow an object that wide on the page. Then export using 16 CPI and 0 for pagination. If that doesn't work I would need to know what version of the dll you are using. Go into Help > About and click "More Info". Then find U2FText.dll. If you don't see it run a text export to load that DLL and then check the list to see what version of the dll you have.


Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Changed to 22.5 inches and no luck.
U2FText.dll version is 11.5.10.1298
 
Also, I created a custom page layout of 10*37 for this report. I was using 22 CPI & 0 Pagination, now changed it to 16-0 and still showing two CRLF.
 
Make sure that:

1) Every other section has the 'suppress' check mark
2) the object is at position 0,0 in the section (use size and position)
3) There is no space in the section below the object

Any chance you are using a subreport?


Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Hi Ken,
It is not a sub report. everything else except the RH&DT are suppressed. Text Position is 0-0
and there is no space after the text box. still showing two CRLF. So frustrating!
 
>> A padspace is created for header and detail
What does this mean?

>> used a formula to combine all fields.
Can you post the formula?

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
These are the steps I used. Thanks again Ken.
1. The Detail record length has to be 366. So, first created a separate formula called padSpaces

stringvar padSpaces:= space(366);
padSpaces;

2.Created Formulas for each field filling the appropriate space. F1, F2 etc., like below..

left({F1} + ReplicateString(‘ ‘,4),4) //first field is 4 bytes length
left({F2} + ReplicateString(‘ ‘,10),10)//this is 10 bytes length

3.Made a big string(myString) Formula combining all fields giving the position for each field like below:

stringvar myString:="";
myString:=
left(({F1} + {@padSpaces}),4) +
left(({F2} + {@padSpaces}),10) +
//etc..for each field till the last 366 bytes
myString;

4.Placed the myString inside the textbox (inserted on the Detail)
 
Hi Ken,
It is fixed! you won't believe this..
I changed the text box Height to .1 and the extra line disappeared! The idea of resizing/repositioning the text box was given by you. I played with it, that's all. a huge salute to you!
Hope this thread will help other crystal users.
:)
 
>> 4.Placed the myString inside the textbox (inserted on the Detail)

Glad you found it. I never put these formulas into text objects. If the formula is the correct length then there is no need to do that, and it adds another layer of complexity. But, I never argue with success.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top