【问题标题】:Why is my report not showing the fields I place down?为什么我的报告没有显示我放置的字段?
【发布时间】:2016-03-28 22:48:11
【问题描述】:

我目前正在使用 iReport 来编辑和自定义以前由其他人构建的另一个报告。我唯一想做的就是添加一个静态文本标签和一个文本字段。

文本标签应显示“电子邮件” 文本字段应包含变量“SHIPTOEMAIL”

目标是让报告包含电子邮件变量并在编译时显示它。

现在,报表当前已经有一个名为“Notes”的静态文本标签和一个包含变量“MEMO”的文本字段。这些目前工作得很好。 我的问题是,当我在编译和运行报告(没有错误)时添加文本标签和文本字段(电子邮件字段)时,这些字段不会显示 - 尽管它们已放置在报告上。


我唯一的猜测是,因为我对 SQL 很陌生,所以这个人的 SQL 是使他的领域工作的原因。这是报告的当前 SQL 的代码。我没有更改任何内容,但也许我需要更改才能使我的字段正常工作?

SELECT so.id AS soid, ship.id AS shipid, so.locationgroupid AS locationgroupid, ship.statusid AS shipstatus,
ship.note AS memo, so.customerpo AS socustomerpo, ship.dateshipped AS shipdate,
COALESCE(so.shiptoname,'') AS shiptoname, so.shiptoaddress AS shiptoaddress, so.shiptocity AS shiptocity,
shipState.code AS shiptostate, so.shiptozip AS shiptozip, so.customercontact AS shiptocontact,
COALESCE(so.billtoname,'') AS billtoname, so.billtoaddress AS billtoaddress, so.billtocity AS billtocity,
billState.code AS billtostate, so.billtozip AS billtozip, COALESCE(ship.cartoncount,0) AS cartoncount,
so.datefirstship AS regshipdate, fobpoint.name AS fobpoint, shipterms.name AS ShippingTerms, ship.num AS shipnum,
carrier.name AS carriername, so.num AS sonum, shipcountry.name AS shipcountry, billcountry.name AS billcountry,
(SELECT s1.sysvalue
    FROM sysproperties s1
    WHERE s1.syskey = 'Barcodes have DI'
) AS barcodeshavedi,
company.name AS company,
contact.datus as customerphone,
paymentterms.name as paymentterms,
memo.memo as memo1,shiptophone.datus as shiptophone, shiptoemail.datus as      shiptoemail, customer.number as accountNum, billtoemail.datus as billtoemail,     upsservices.description AS shipservice


FROM ship
    INNER JOIN carrier ON ship.carrierid = carrier.id
    INNER JOIN so ON ship.soid = so.id
inner join customer on so.customerid = customer.id
INNER JOIN fobpoint ON so.fobpointid = fobpoint.id
INNER JOIN shipterms ON so.shiptermsid = shipterms.id
LEFT OUTER JOIN stateconst shipState ON so.shiptostateid = shipState.id
LEFT OUTER JOIN stateconst billState ON so.billtostateid = billState.id
LEFT OUTER JOIN countryconst shipCountry ON so.shiptocountryid = shipCountry.id
LEFT OUTER JOIN countryconst billCountry ON so.billtocountryid = billCountry.id
JOIN company ON company.id = 1
left join address on address.accountid = customer.accountid and address.typeid = 50 and address.defaultflag = 1
left join contact on contact.addressid = address.id and contact.typeid = 50 and contact.defaultflag = 1
left join paymentterms on paymentterms.id = so.paymenttermsid
left join memo on company.id = memo.recordid and memo.tableid = -776196226
left join address shippingaddress on shippingaddress.accountid = customer.accountid and shippingaddress.typeid = 10 and shippingaddress.defaultflag = 1
left join contact shiptoemail on shippingaddress.id = shiptoemail.addressid  and customer.accountid = shiptoemail.accountid and shiptoemail.typeid = 60 and shiptoemail.defaultflag = 1
left join contact shiptoPhone on shippingaddress.id = shiptoPhone.addressid  and customer.accountid = shiptoPhone.accountid and shiptoPhone.typeid = 50 and shiptoPhone.defaultflag = 1
left join contact billtoemail on billtoemail.addressid = address.id and billtoemail.accountid = customer.accountid and billtoemail.typeid = 60 and billtoemail.defaultflag = 1
LEFT OUTER JOIN upsservices ON so.upsserviceid = upsservices.id
WHERE ship.id = '7'AND ship.ordertypeid = 20

【问题讨论】:

  • 您确定您的查询返回“shiptoemail”的数据吗?

标签: sql jasper-reports


【解决方案1】:

首先在任何其他控制台中执行此查询,看看它是否返回报告中所需的所有值。

如果不是,请更正查询

如果是,请使用包含查询返回的所有字段的空白普通报告,看看是否是您的报告设计问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多