iReport说'该文件没有页面'

时间:2015-10-22 18:25:12

标签: mysql sql jasper-reports

我只是在编写报告,而且我正在使用已成功连接的数据库。我遇到的问题是每当我尝试" 预览"报告我得到了消息"The document has no pages"。我知道这可能意味着我不应该使用空数据库,但我有一个当前的数据库连接通过"测试"。

还有其他帖子向这个问题提出了类似的问题,但我坚信这个问题是不同的,因为与我读过的其他人不一样 - 他们正在尝试使用EmptyDatabases做例子 - 我实际上在使用一个真正的服务器端数据库。

感谢您的帮助!

这是我的SQL

SELECT
 WO."NUM" AS WO_NUM,
 WO."LOCATIONGROUPID" AS WO_LOCATIONGROUPID,
 WO."ID" AS WO_ID,
 UOM."ID" AS UOM_ID,
 UOM."CODE" AS UOM_CODE,
 PART."ID" AS PART_ID,
 PART."NUM" AS PART_NUM,
 PART."STDCOST" AS PART_STDCOST,
 PART."DESCRIPTION" AS PART_DESCRIPTION,
 PARTCOST."ID" AS PARTCOST_ID,
 PARTCOST."AVGCOST" AS PARTCOST_AVGCOST,
 UOMCONVERSION."ID" AS UOMCONVERSION_ID,
 UOMCONVERSION."DESCRIPTION" AS UOMCONVERSION_DESCRIPTION,
 UOMCONVERSION."FACTOR" AS UOMCONVERSION_FACTOR,
 UOMCONVERSION."FROMUOMID" AS UOMCONVERSION_FROMUOMID,
 UOMCONVERSION."MULTIPLY" AS UOMCONVERSION_MULTIPLY,
 UOMCONVERSION."TOUOMID" AS UOMCONVERSION_TOUOMID,
 COSTLAYER."ID" AS COSTLAYER_ID,
 COSTLAYER."ORGTOTALCOST" AS COSTLAYER_ORGTOTALCOST,
 COSTLAYER."PARTID" AS COSTLAYER_PARTID,
 LOCATIONGROUP."ID" AS LOCATIONGROUP_ID,
 LOCATIONGROUP."NAME" AS LOCATIONGROUP_NAME,
 SO."ID" AS SO_ID,
 SO."DATEISSUED" AS SO_DATEISSUED,
 SO."LOCATIONGROUPID" AS SO_LOCATIONGROUPID,
 SO."NUM" AS SO_NUM,
 SO."PRIORITYID" AS SO_PRIORITYID,
 SOITEM."ID" AS SOITEM_ID,
 SO."BILLTONAME" AS SO_BILLTONAME,
 PRODUCT."ID" AS PRODUCT_ID,
 PRODUCT."DESCRIPTION" AS PRODUCT_DESCRIPTION,
 SOITEM."PRODUCTNUM" AS SOITEM_PRODUCTNUM,
 WO."TYPEID" AS WO_TYPEID,
 WOITEM."ID" AS WOITEM_ID,
 WOITEM."TYPEID" AS WOITEM_TYPEID,
 COMPANY."ID" AS COMPANY_ID,
 COMPANY."NAME" AS COMPANY_NAME
FROM
 "UOM" UOM INNER JOIN "PART" PART ON UOM."ID" = PART."WEIGHTUOMID"
 AND UOM."ID" = PART."SIZEUOMID"
 AND UOM."ID" = PART."UOMID"
 INNER JOIN "PARTCOST" PARTCOST ON PART."ID" = PARTCOST."PARTID"
 INNER JOIN "COSTLAYER" COSTLAYER ON PART."ID" = COSTLAYER."PARTID"
 INNER JOIN "PRODUCT" PRODUCT ON PART."ID" = PRODUCT."PARTID"
 AND PRODUCT."ID" = PART."DEFAULTPRODUCTID"
 INNER JOIN "WOITEM" WOITEM ON PART."ID" = WOITEM."PARTID"
 AND UOM."ID" = WOITEM."UOMID"
 INNER JOIN "WO" WO ON WOITEM."WOID" = WO."ID"
 INNER JOIN "LOCATIONGROUP" LOCATIONGROUP ON WO."LOCATIONGROUPID" = LOCATIONGROUP."ID"
 INNER JOIN "SO" SO ON LOCATIONGROUP."ID" = SO."LOCATIONGROUPID"
 INNER JOIN "SOITEM" SOITEM ON SO."ID" = SOITEM."SOID"
 AND UOM."ID" = SOITEM."UOMID"
 AND PRODUCT."ID" = SOITEM."PRODUCTID"
 AND UOM."ID" = PRODUCT."WEIGHTUOMID"
 AND UOM."ID" = PRODUCT."SIZEUOMID"
 AND UOM."ID" = PRODUCT."UOMID"
 INNER JOIN "UOMCONVERSION" UOMCONVERSION ON UOM."ID" = UOMCONVERSION."TOUOMID"
 AND UOM."ID" = UOMCONVERSION."FROMUOMID",
 "COMPANY" COMPANY

2 个答案:

答案 0 :(得分:0)

从错误中可以看出,Query没有返回任何记录。

即使没有详细信息带没有数据也要打印报告使用以下步骤。

来自报告检查器

  • 右键点击报告名称
  • 点击“属性”
  • 搜索"当没有数据" 属性时,从下拉列表中选择"所有部分,无详细信息"

答案 1 :(得分:0)

尝试从DBMS运行查询,看看它是否返回任何结果,因为它似乎没有提取任何记录。即使mani Deep所说的详细信息区中没有数据,您也可以更改属性以打印报告。