数据库查询能预览,但是报表主体查询错误




${if(queryDate==1,
"select
    pmr.master_record_id,
  pmr.payment_amount 付款金额,
  to_char(pmr.payment_datetime, 'YYYY')||'年'||to_char(pmr.payment_datetime, 'MM')|| '月'||to_char(pmr.payment_datetime, 'DD')|| '日' 日期,
  to_char(pmr.operate_datetime, 'YYYY')||'年'||to_char(pmr.operate_datetime, 'MM')|| '月'||to_char(pmr.operate_datetime, 'DD')|| '日' 录入日期,
  cat.materials_merchant_name 供应商名称,
  cat.materials_merchant_code 供应商编码
  from
  MATERIALS_MERCHANT_CATALOG cat, --物资商家目录表
  MATERIALS_PAYMENT_RECORD pmr -- 物资付款主记录
  where 1=1
  and pmr.supplier_id in(select c.materials_merchant_id from  MATERIALS_MERCHANT_CATALOG c
              where c.materials_merchant_name ='"+supplierName+"')
              
  and pmr.supplier_id=cat.materials_merchant_id"
  + if((len(startTime)==0)&&(len(endTime)>0)," and pmr.payment_datetime <=to_date('"+endTime+"','yyyy-MM-dd')","")
    + if((len(startTime)>0)&&(len(endTime)==0)," and pmr.payment_datetime >=to_date('"+startTime+"','yyyy-MM-dd')","")
    + if((len(startTime)>0)&&(len(endTime)>0)," and pmr.payment_datetime >= to_date('"+startTime+"','yyyy-MM-dd') and pmr.payment_datetime < to_date('"+endTime+"','yyyy-MM-dd')+1","")
   
,
"select
    pmr.master_record_id,
    pmr.payment_amount 付款金额,
    to_char(pmr.payment_datetime, 'YYYY')||'年'||to_char(pmr.payment_datetime, 'MM')|| '月'||to_char(pmr.payment_datetime, 'DD')|| '日' 日期,
    to_char(pmr.operate_datetime, 'YYYY')||'年'||to_char(pmr.operate_datetime, 'MM')|| '月'||to_char(pmr.operate_datetime, 'DD')|| '日' 录入日期,
    cat.materials_merchant_name 供应商名称,
    cat.materials_merchant_code 供应商编码
    from
    MATERIALS_MERCHANT_CATALOG cat, --物资商家目录表
    MATERIALS_PAYMENT_RECORD pmr -- 物资付款主记录
    where 1=1
    and pmr.supplier_id in(select c.materials_merchant_id from  MATERIALS_MERCHANT_CATALOG c
                            where c.materials_merchant_name ='"+supplierName+"')
                           
    and pmr.supplier_id=cat.materials_merchant_id"
    + if((len(startTime)==0)&&(len(endTime)>0)," and trunc(pmr.operate_datetime) <=to_date('"+endTime+"','yyyy-MM-dd')","")
+ if((len(startTime)>0)&&(len(endTime)==0)," and trunc(pmr.operate_datetime)  >=to_date('"+startTime+"','yyyy-MM-dd')","")
+ if((len(startTime)>0)&&(len(endTime)>0)," and trunc(pmr.operate_datetime)  >=
to_date('"+startTime+"','yyyy-MM-dd') and trunc(pmr.operate_datetime) <  to_date('"+endTime
+ "','yyyy-MM-dd')+1","")
   
)}
order by pmr.master_record_id





FineReport尹作梅 发布于 2016-6-2 15:37
回答问题
悬赏:2 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共4回答
最佳回答
0
yets11发布于2016-6-2 15:39(编辑于 2023-9-6 09:34)
555
  • 尹作梅 尹作梅(提问者)

    严重:报表计算中[Name : wuzicaigouyifukuan.cpt] [Parameter : {__LOCALE__ : zh_CN[java.util.Locale], CMD : parameters_d[java.lang.String], ENDTIME : 2016-06-02[java.lang.String], LABEL1 : 开始日期:[java.lang.String], LABEL3 : 结束日期:[java.lang.String], LABEL5 : 供应商:[java.lang.String], OP : fr_dialog[java.lang.String], QUERYDATE : 1[java.lang.String], REPORTLET : wuzicaigouyifukuan.cpt[java.lang.String], SESSIONID : 13227[java.lang.String], STARTTIME : 2015-06-04[java.lang.String], SUPPLIERNAME : 青岛新华亿医疗器械有限公司[java.lang.String]}][Type : page]  :
    null
            at com.fr.util.SynchronizedLiveDataModelUtils.getLiveDataModel(Unknown Source)
            at com.fr.report.core.A.O.__s_name2ResultSet(Unknown Source)
            at com.fr.report.core.A.N.A(Unknown Source)
            at com.fr.report.core.A.PA.A(Unknown Source)
            at com.fr.report.core.A.N.C(Unknown Source)
            at com.fr.report.core.A.N.A(Unknown Source)
            at com.fr.report.core.A.N.execute4Expand(Unknown Source)
            at com.fr.report.core.A.N.B(Unknown Source)
            at com.fr.report.WorkSheet._execute(Unknown Source)
            at com.fr.report.WorkSheet.execute(Unknown Source)
            at com.fr.report.core.A.B.F.G(Unknown Source)
            at com.fr.report.core.A.B.F.B(Unknown Source)
            at com.fr.main.impl.WorkBook.execute(Unknown Source)
            at com.fr.log.LogUtils$1.exe(Unknown Source)
            at com.fr.log.LogUtils.executeAndLogAndRecord(Unknown Source)
            at com.fr.log.LogUtils.executeAndLogRecord(Unknown Source)
            at com.fr.web.cache.ReportCache.getResultWorkBook(Unknown Source)
            at com.fr.main.impl.WorkBookTemplateDelegate.execute(Unknown Source)
            at com.fr.web.core.ShowWorkBookPolicy$Policy4Page.show(Unknown Source)
            at com.fr.web.core.ReportSessionIDInfor.showDirect(Unknown Source)
            at com.fr.web.core.ReportSessionIDInfor.initBook2Show(Unknown Source)
            at com.fr.web.core.ReportSessionIDInfor.getWorkBook2Show(Unknown Source)
            at com.fr.web.core.ReportSessionIDInfor.createPageSetChain(Unknown Source)
            at com.fr.web.core.ReportSessionIDInfor.getReportPage(Unknown Source)
            at com.fr.web.core.service.PageService$PageContentReader.getReportPageBySessionIDInfo(Unknown Source)
            at com.fr.web.core.service.PageService$PageContentReader.readPageContent(Unknown Source)
            at com.fr.web.core.service.PageService.process(Unknown Source)
            at com.fr.web.core.ReportDispatcher.dealWithRequest(Unknown Source)
            at com.fr.web.BaseServlet.doGet(Unknown Source)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
            at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
            at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
            at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
            at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
            at org.mortbay.http.HttpServer.service(HttpServer.java:909)
            at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
            at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
            at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
            at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
            at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
            at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
    回复
    2016-06-02 15:45 
  • 尹作梅 尹作梅(提问者)

    我贴出来了,亲帮我看看,我已经晕了
    回复
    2016-06-02 15:49 
最佳回答
0
尹作梅发布于2016-6-2 15:45(编辑于 2023-9-6 09:34)
555
  • 尹作梅 尹作梅(提问者)

    这个是主查询语句:
    ${if(queryDate==1,
    \"select
        pmr.master_record_id,
      pmr.payment_amount 付款金额,
      to_char(pmr.payment_datetime, \'YYYY\')||\'年\'||to_char(pmr.payment_datetime, \'MM\')|| \'月\'||to_char(pmr.payment_datetime, \'DD\')|| \'日\' 日期,
      to_char(pmr.operate_datetime, \'YYYY\')||\'年\'||to_char(pmr.operate_datetime, \'MM\')|| \'月\'||to_char(pmr.operate_datetime, \'DD\')|| \'日\' 录入日期,
      cat.materials_merchant_name 供应商名称,
      cat.materials_merchant_code 供应商编码
      from
      MATERIALS_MERCHANT_CATALOG cat, --物资商家目录表
      MATERIALS_PAYMENT_RECORD pmr -- 物资付款主记录
      where 1=1
      and pmr.supplier_id in(select c.materials_merchant_id from  MATERIALS_MERCHANT_CATALOG c
                  where c.materials_merchant_name =\'\"+supplierName+\"\')
                  
      and pmr.supplier_id=cat.materials_merchant_id\"
      + if((len(startTime)==0)&&(len(endTime)>0),\" and pmr.payment_datetime <=to_date(\'\"+endTime+\"\',\'yyyy-MM-dd\')\",\"\")
            + if((len(startTime)>0)&&(len(endTime)==0),\" and pmr.payment_datetime >=to_date(\'\"+startTime+\"\',\'yyyy-MM-dd\')\",\"\")
            + if((len(startTime)>0)&&(len(endTime)>0),\" and pmr.payment_datetime >= to_date(\'\"+startTime+\"\',\'yyyy-MM-dd\') and pmr.payment_datetime < to_date(\'\"+endTime+\"\',\'yyyy-MM-dd\')+1\",\"\")
           
    ,
    \"select
        pmr.master_record_id,
            pmr.payment_amount 付款金额,
            to_char(pmr.payment_datetime, \'YYYY\')||\'年\'||to_char(pmr.payment_datetime, \'MM\')|| \'月\'||to_char(pmr.payment_datetime, \'DD\')|| \'日\' 日期,
            to_char(pmr.operate_datetime, \'YYYY\')||\'年\'||to_char(pmr.operate_datetime, \'MM\')|| \'月\'||to_char(pmr.operate_datetime, \'DD\')|| \'日\' 录入日期,
            cat.materials_merchant_name 供应商名称,
            cat.materials_merchant_code 供应商编码
            from
            MATERIALS_MERCHANT_CATALOG cat, --物资商家目录表
            MATERIALS_PAYMENT_RECORD pmr -- 物资付款主记录
            where 1=1
            and pmr.supplier_id in(select c.materials_merchant_id from  MATERIALS_MERCHANT_CATALOG c
                                                            where c.materials_merchant_name =\'\"+supplierName+\"\')
                                                           
            and pmr.supplier_id=cat.materials_merchant_id\"
            + if((len(startTime)==0)&&(len(endTime)>0),\" and trunc(pmr.operate_datetime) <=to_date(\'\"+endTime+\"\',\'yyyy-MM-dd\')\",\"\")
    + if((len(startTime)>0)&&(len(endTime)==0),\" and trunc(pmr.operate_datetime)  >=to_date(\'\"+startTime+\"\',\'yyyy-MM-dd\')\",\"\")
    + if((len(startTime)>0)&&(len(endTime)>0),\" and trunc(pmr.operate_datetime)  >=
    to_date(\'\"+startTime+\"\',\'yyyy-MM-dd\') and trunc(pmr.operate_datetime) <  to_date(\'\"+endTime
    + \"\',\'yyyy-MM-dd\')+1\",\"\")
           
    )}
    order by pmr.master_record_id
    回复
    2016-06-02 15:45 
最佳回答
0
尹作梅发布于2016-6-2 15:45(编辑于 2023-9-6 09:34)
555
最佳回答
0
尹作梅发布于2016-6-2 15:49(编辑于 2023-9-6 09:34)
555
  • 0关注人数
  • 1025浏览人数
  • 最后回答于:2016-6-2 15:49
    活动推荐 更多
    热门课程 更多
    返回顶部