?
Solved

How can I eliminate the blank line at the end of a text file created in Crystal Reports?

Posted on 2011-10-13
21
Medium Priority
?
868 Views
Last Modified: 2012-08-13
How can I eliminate the blank line at the end of a text file created in Crystal Reports?
0
Comment
Question by:TheThroCompany
  • 9
  • 6
  • 3
  • +1
19 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 36962368
As a guess.
Shrink the report footer and page footer to 0 height.
Also ensure all sections are set to the minimum height

I assume this is from an export of the report.

mlmcc
0
 
LVL 19

Expert Comment

by:GJParker
ID: 36963313
make sure all osections at the end fo teh report are suppressed i.e. any unused Group footers, page footer and report footer
0
 

Author Comment

by:TheThroCompany
ID: 36963836
I have tried both suppressing entire unused footers and set the section heights to 0, still no sucess.
Is it possible that some sort of control character such as a carraige return is being generated to indicate end of file?
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
LVL 101

Expert Comment

by:mlmcc
ID: 36966026
Can you upload the report?

mlmcc
0
 

Author Comment

by:TheThroCompany
ID: 36968126
I am sorry, I am not sure what you mean.  Upload the report to where?
0
 

Author Comment

by:TheThroCompany
ID: 36968165
Ok now I think I know what you meant.  I have attached the report.
PositivePay.rpt
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36971143
Nothing in the report jumps out.
Be sure to shrink the suppressed sections to 0 height.

Can any of the fields be NULL?

Try making th edetail section textbox a bit widerThe same for the report footer textbox.

mlmcc
0
 

Author Comment

by:TheThroCompany
ID: 36980077
Thanks for the ideas, but still the extra line is at the end of the text file.  Just for kicks I tried another report with no report or page footer information only a detail section.  I suppressed the page and report footers and made the 0 height also suppressed any blank sections in the detail and footers sections.  Then when I exported to Text I also selected 0 for the lines per inch.  Still there is a blank line at the end of the file.  Is it possible that this line is created no matter how it is formatted?  Perhaps it is a nonprintable character such as a printer command for end of file?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36980931
It may be.  After all the line before has to end with something so the eport may always add a CR/LF

I don't export reports to text very often

mlmcc
0
 
LVL 35

Expert Comment

by:James0628
ID: 36982249
Is there actually a blank line at the end, or does the cursor just go down to the next line after your last report line, if you open the file in Notepad or whatever?  Crystal puts a CR-LF pair at the end of every line, so if you open the file in Notepad, the cursor will go down to the next line after the last line on your report, but there isn't really another line there.  Maybe that's not what you meant and you really do have an extra line at the end.  Just checking.

 James
0
 

Author Comment

by:TheThroCompany
ID: 36994939
When I open it up in Notepad my cursor stays at the top of the report, then when I scroll down to the end, the blank line is at the end of the report.  The reason I have an issue with the blank line, it that this report that is created by Crystal is a listing of checks issued which is uploaded to our bank.  The bank is rejecting the file because of the blank line and they won't accept the file in any other format than a text file.  
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36997069
I just tried one of my reports.  It added 2 or more lines to the end of the report.  I had everything suppressed that was after the last text in the report. (page footer)

It would seem the export adds 1 or more CR/LF to the end.

Is that the only place where there is a blank line?
Perhaps you could do a search/replace for 2 CRs or CR/LF together

mlmcc
0
 
LVL 35

Expert Comment

by:James0628
ID: 36998949
Hmm.  I tried exporting something to a text file and did not get any extra lines at the end.  There was just the CR-LF at the end of the last line in the report.  So, when I went to the end of the file in Notepad, the cursor sat right below that line.  But I guess in some cases it does add 1 or more lines.  FWIW, this report was designed to be exported to a text file and has everything but the detail section suppressed.


 How often do you export this report?  If nothing else, maybe you could just open the file in Notepad and delete any extra lines at the end?

 James
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 37001664
I suspect his program may read by lines and it reads the last line and thinks there is another

He is getting
DateLine1<cr-lf>
DataLine2<cr-lf>
...
DataLineLast<cr-lf>
<eof>


He needs
DateLine1<cr-lf>
DataLine2<cr-lf>
...
DataLineLast<eof>

mlmcc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 37001677
One thing to try which made a difference in how many extra lines were added is to set the lines per page to 0 to eliminate the paging.  WIth it set to 60 my file had enough blank lines to get 60 lines on the page
When I set it to 0 I got 1 extra line or 2 blank lines at the bottom

mlmcc
0
 

Author Comment

by:TheThroCompany
ID: 37006313
I had already changed the lines per page to 0 and got the result you mentioned, but it does still leave that last extra line.

This may sound crazy, is there anyway to force a <eof> on the report footer in crystal reports by adding a text field or a formula field?
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 1000 total points
ID: 37007224
The only way I can think of would be to write your own export.  You cannot change Crystal export routiines.

I suspect in the text export it outputs the line add the CR/LF then looks for the next line to export which it doesn't have.

You could put this in an application that when the export is done edits the file to eliminate the last CR/LF

mlmcc
0
 
LVL 35

Accepted Solution

by:
James0628 earned 1000 total points
ID: 37163917
I don't know.  This may be one of those "you can't do that" situations, in which case I guess some of our posts would be the "solution".

 Ironically, as I was looking at the posts again just now, I had an idea about his last post, where he asked about adding an EOF.

 Back in the MS-DOS days, a ^Z marked the end of a text file.  I suppose he could have tried a formula with ChrW (26) in the report footer.  There would still presumably be a CR-LF after that, but if the software reading the file recognized the ^Z and stopped when it saw it, that might have worked.  For some reason that never crossed my mind back when I first saw that post.

 James
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 37205957
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Suggested Courses

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question