Issue "can't cast empty string to a number value"

I encountered this exception when running this code. My query contained a column with NULL value which caused the exception since it was trying to cast a null to integer.

<cfquery name="myQuery" datasource="#datasource#">
    select * from myTable
</cfquery>

<jr:jasperreport jrxml="#datapath#/sample-001.jrxml" query="#myQuery#" xportfile="#workpath#/sample-001.pdf" exporttype="pdf"/>