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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with nulls during text export

Status
Not open for further replies.

PQTIII

IS-IT--Management
Sep 21, 2004
110
cr9

My report handles the nulls fine and displays them as 0, but when I go to export them to a text file the 0 turns into blanks. How can I make sure that a 0 will be written to the text file?

Thanks
PT
 
I would assume that you are converting nulls to default value (check in File/Report Options). Rather then doing this, create formulas to test for nulls and display a 0 if null ... if appropriate for the datatype.

Example:

If isnull({Table.NumericField} )
then 0
else {Table.NumericField}

regards,

ro


Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Try the following:

File->Report Options->Convert Database Null Values to Default

If that fails, you can create a formula for each such as:

if isnull({table.field}) then
0
else
{table.field}

And use the formula in lieu of the field.

-k
 
The formula works great for the report, but it still shows nulls on the exported text file. I'm not sure if this makes a difference, but the fields that have a zero is a subreport that gets one total from a different table. If it comes back with a number it exports it fine, but if it's 0 it write a blank space to the export file.??????
 
Fields aren't subreports, so "but the fields that have a zero is a subreport " makes no sense.

Perhaps you mean that it's a shared variable bneing passed from a subreport to a main report? If so, state.

If so, then you probably need to reset these values PRIOR to running the subreport so that the default is zero befire it attempts to be set by the subreport.

Hard to know without having spcifics.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top