Crystal Reports Export Question

rustypoot
rustypoot used Ask the Experts™
on
Hi,
I have a rpt that I am exporting the data to .csv file. In rpt I do NOT see any blank lines. But when I export to .csv file, it is inserting a blank line! I can not have blank lines in .csv file as the application that it exports the data to fails on blank line!

Any idea how to resolve this or what could be going on?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
WillOwner

Commented:
you probably have a header or footer showing that is blank.  can you post the rpt
WillOwner

Commented:
it could also be spacing on the export line or a subreport if one is included in your rpt.  It would easier to look at it than making a guess

Author

Commented:
Thanks . Attached is the file. It is inserting blank line at row 73 when exported to .csv file. Please advise. Thx
test.rpt
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

WillOwner

Commented:
can you include some sample data  (redact the PHI)  so I can replicate the export
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
I don't know why line 73 would be the problem butwhat about you master formula
ToText({@Row#})
Has a decimal, 2 decimal places and adds  a "," when you get to 1,000.00

Change this (which is 4,5,6,7 or more characters depending on the value)
Right('00000' & ToText({@Row#},0,"") ,5)

or use
Fix the format to 6 digits
ToText({@Row#},"000000")

What format do you need it in?

mlmcc

Author

Commented:
Actually u can remove that @ROW from the FixedLength formula. I do not need that field. I just placed it to test. Thanks

Author

Commented:
There should be data on rpt as I saved rpt with data.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
No data in it.

mlmcc

Author

Commented:
Please try this one. Thanks
test.rpt
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Still no data

There must be something tht is making that record too long
Can any of the fields be NULL?

mlmcc

Author

Commented:
yes there are some fields that can be NULL. Can you code it to account for NULL's?
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Basic method would be to change all the FORMAT formulas to handle the NULLs by changing them to use the fields directly rather than the formulas as they do now.

You could chnge the base formulas but that raises other issues on what to do with humeric and date fields that are NULL since you would have to return a number or date that is meaningless.  You would then have to change the formatting formulas to handle the default value.

Basic idea
Format - Admit Date
NumberVar Len := 25;
If IsNull({PATIENT_VISIT.ADMIT_ARRIVE_DATE}) then
    Space(Len)
Else
    Left(ToText({PATIENT_VISIT.ADMIT_ARRIVE_DATE},"yyyyMMdd") + Space(Len), Len);

mlmcc
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
I would also declare all the numbervars as local.

Here it is

mlmcc
testRevA.rpt

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial