cancel
Showing results for 
Search instead for 
Did you mean: 

formula problem, sometimes don't add the value

Former Member
0 Kudos

Hi everybody,

I'm trying to learn manage this tool (crystal report) I use visual basic 2005 with the crystal for visual basic. Actually I've a problem with some formula fields. My report has several summarize columns (I sum the values) , not all the columns have values so not all the result fields has values. The problem becomes because I have to sum the result fields, and if i do a formula with this:

+ {@horasTinsitu} + {@ConvertirEnSegundosTreal} + {@ConvertirEnSegundosTtaller}

But only works if the three formulas has values, if one formula is empty the result looks empty, I think the problem was in the value of the formulas and I tried to evaluate with u201Cisnullu201D but neither.

Please, somebody has an idea.

Thanks everybody

Well my English it's bad but I think it's possible understand it.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

Go in each formula and add the following :

If isnull(DatabaseField) Then 0

Else

........Continue your formula steps.

Now you try to add up all formulas and check.

Regards,

Sastry

Former Member
0 Kudos

I finally do it, this is the code

local numbervar InSitu;

local numbervar Remote;

local numbervar Taller;

local numbervar Phone;

if isnull({@T_insitu}) then //{@T_insitu} is the formula to summarize details and add their values...

InSitu:= 0

else

InSitu:= {@T_insitu};

if isnull({@T_remoto}) then

Remote:= 0

else

Remote:={@T_remoto} ;

if isnull({@T_taller}) then

Taller:= 0

else

Taller:= {@T_taller};

if isnull({@T_telefono}) then

Phone:= 0

else

Phone:={@T_telefono} ;

InSituRemoteTallerPhone;

Now looks easy but it's very diferent of the visual code I usually do.

well THANK YOU VERY MUCH EVERY BODY...

Dani

Answers (1)

Answers (1)

pouljorgensen
Discoverer
0 Kudos

I don't know if you have the option in VS 2005 environment, but ...

In the full Crystal reports designer you have the option to select between Exceptions for Nulls and Default values for Nulls. Selecting the latter would solve your issue...

Edited by: Poul Jorgensen on Oct 2, 2008 11:08 PM

Former Member
0 Kudos

Hello Poul.

Thanks for your answer,

Where do you found the option " Default values for Nulls".

see you,

Dani

Former Member
0 Kudos

Hi Daniel,

You can find the option in the Formula Editor, next to Crystal Syntax/Basic Syntax combo box. Just click on "Exceptions For Nulls" combo and you can find "Default Values For Nulls" option.

Regards,

Mohamed

Former Member
0 Kudos

Hello everybody. Iu2019m sorry i donu2019t fiend where to put u201CDefault Values For Nullsu201D,.

Mohamed, in my formula editor just right of the combo box (for select basic or crystal syntax) I have a button with two slash just fort comment the line. In the first row of the toolbar I have a button called u201Cenabled/disabled the properties presentationu201D but if I push doesnu2019t work. This button has an icon like a hand holding a paper.

Maybe, my Crystal report for visual studio 2005 hasnu2019t this characteristic?

Thanks again.

Dani

Former Member
0 Kudos

Hi Daniel,

I think you are using Crystal 10. So you may not find the option in formula editor.

Go to File>Report Options> check the option convert Database NULL values to default.

Regards,

Raghavendra