We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Dealing with NULL values

We have a document where we are formatting incoming numerical values from a SQL table to use in a SUM function

Example: {MERGEFIELD Field1 \#"£#,##0.00"}

If the value stored in the SQL column for Field1 is NULL, is there a function I can use to convert the NULL value to a zero? The problem is that we are getting an undefined bookmark error when attempting to SUM(val1,val2) where one of the values is “”

Many thanks


Hi Mike,

Thanks for your inquiry. You can achieve your requirements by using IF field inside Sum field as shown below:

{ =SUM(IF fieldvalue = "" 0 fieldvalue, 20) }

You may also use isNull(fieldValue, 0) method in your SQL. Hope this helps you. Please let us know if you have any more queries.