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

How can I eliminate the blank line at the end of a text file created in Crystal Reports?
TheThroCompanyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
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
GJParkerCommented:
make sure all osections at the end fo teh report are suppressed i.e. any unused Group footers, page footer and report footer
0
TheThroCompanyAuthor Commented:
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
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

mlmccCommented:
Can you upload the report?

mlmcc
0
TheThroCompanyAuthor Commented:
I am sorry, I am not sure what you mean.  Upload the report to where?
0
TheThroCompanyAuthor Commented:
Ok now I think I know what you meant.  I have attached the report.
PositivePay.rpt
0
mlmccCommented:
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
TheThroCompanyAuthor Commented:
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
mlmccCommented:
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
James0628Commented:
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
TheThroCompanyAuthor Commented:
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
mlmccCommented:
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
James0628Commented:
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
mlmccCommented:
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
mlmccCommented:
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
TheThroCompanyAuthor Commented:
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
mlmccCommented:
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
James0628Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.