发新话题
打印

动态列报表中空值问题

动态列报表中空值问题

我已按照手册实现了动态列。现在的问题是,当碰上NUMBER类型的数据列为空时,会被自动填0,我不想自动填0该怎么做?
谢谢!

TOP

请把你的代码,贴上来,不填零,默认取null值吗?

TOP

贴我自己的代码有什么用?
解析简表设计器生成的XML,然后生成HTML页面的表格不都是简表的代码吗?

本来是空值,却在页面显示了0值,但是用0值作条件去查询却又什么都查不到,这不是让人很奇怪吗?

TOP

我是说,把报表模板发上来,并告诉我哪个字段显示,出来有变0的问题。

TOP

<?xml version="1.0" encoding="UTF-8"?>
<jatools Class="jatools.ReportDocument" Name="jatools report template"><VariableContext/><Page><Children ItemClass="PagePanel"><Item0><Width>757</Width><Height>1086</Height><Children ItemClass="Table"><Item0><NodePath>rpt</NodePath><X>10</X><Y>5</Y><Children><Item0 Class="Label"><BackColor>-2890759</BackColor><Border><StyleText>border:1.0px solid #D3E3F9</StyleText></Border><Cell><Row>0</Row><Col>0</Col></Cell></Item0><Item1 Class="RowPanel"><Cell><Row>1</Row><Col>0</Col></Cell><Children ItemClass="Text"><Item0><Border><StyleText>border:1.0px solid #D3E3F9</StyleText></Border><Cell><Row>1</Row><Col>0</Col></Cell></Item0></Children><NodePath>Row</NodePath></Item1></Children><ColumnWidths>60</ColumnWidths><RowHeights>20,20</RowHeights><InitPrint>builder = new jatools.component.table.DynamicColumnTableBuilder(me,rpt.getDataset()); if(myfields != null && !"".equals(myfields)){builder.fields=myfields;} builder.build();</InitPrint></Item0></Children><Type>102</Type></Item0></Children><PageFormat><Width>793</Width><Height>1122</Height><Left>18</Left><Top>18</Top><Right>18</Right><Bottom>18</Bottom></PageFormat></Page><NodeSource><Children ItemClass="DatasetNodeSource"><Item0><Children ItemClass="RowNodeSource"><Item0/></Children><Reader Class="SqlReader"><Name>rpt</Name><Sql>select a.统计月份,b.city_name as 市公司,b.subst_name as 县分公司,b.branch_name as 营服中心, a.光节点达到总数,a.主干节点到达数,a.配线节点到达数, a.光缆段总数,a.光缆段总长度,a.主干光缆段长度,a.配线光缆段长度,a.引入光缆段平均长度 from tb_sum_odn_node a,tb_dim_branch b where a.营服id=b.branch_id where 1=1  ${has(统计月份)?(" and 统计月份 like '%"+统计月份+"%'"):("")} ${has(市公司)?(" and 市公司 like '%"+市公司+"%'"):("")} ${has(县分公司)?(" and 县分公司 like '%"+县分公司+"%'"):("")} ${has(营服中心)?(" and 营服中心 like '%"+营服中心+"%'"):("")} ${has(光节点达到总数)?(" and 光节点达到总数='"+光节点达到总数+"'"):("")} ${has(主干节点到达数)?(" and 主干节点到达数='"+主干节点到达数+"'"):("")} ${has(配线节点到达数)?(" and 配线节点到达数='"+配线节点到达数+"'"):("")} ${has(光缆段总数)?(" and 光缆段总数='"+光缆段总数+"'"):("")} ${has(光缆段总长度)?(" and 光缆段总长度='"+光缆段总长度+"'"):("")} ${has(主干光缆段长度)?(" and 主干光缆段长度='"+主干光缆段长度+"'"):("")} ${has(配线光缆段长度)?(" and 配线光缆段长度='"+配线光缆段长度+"'"):("")} ${has(引入光缆段平均长度)?(" and 引入光缆段平均长度='"+引入光缆段平均长度+"'"):("")}</Sql><Description>select a.统计月份,b.city_name as 市公司,b.subst_name as 县分公司,b.branch_name as 营服中心, a.光节点达到总数,a.主干节点到达数,a.配线节点到达数, a.光缆段总数,a.光缆段总长度,a.主干光缆段长度,a.配线光缆段长度,a.引入光缆段平均长度  from tb_sum_node a,tb_dim_branch b where a.营服id=b.branch_id</Description><Connection><Driver>oracle.jdbc.driver.OracleDriver</Driver><User></User><Password></Password><Url></Url></Connection></Reader><TagName>rpt</TagName></Item0></Children></NodeSource></jatools>

a.光缆段总长度,a.主干光缆段长度,a.配线光缆段长度,a.引入光缆段平均长度
这几个字段在数据库里是number类型,如果是空,在页面会显示0

TOP

a==0?"":a

TOP

发新话题