Hi, I am using Reports add-on and my template is in jrxml format, using JasperSoft 6.2.0
I created a ‘reportSummary’ band, with this jpql script:
SELECT e.einvoiceType AS einvoice_type,
e.trxNo AS trx_no,
e.trxDate AS trx_date,
e.einvoiceDate AS einvoice_date,
CASE
WHEN c.name <> b.name THEN b.name
ELSE s.name
END AS supplierBuyer,
e.erpCurrencyCode AS erp_currency_code,
e.currencyExchangeRate AS currency_exchange_rate,
(e.totalIncludeTax + e.roundingAmt) AS totalFXTrxAmt,
(e.totalIncludeTax + e.roundingAmt) * e.currencyExchangeRate AS totalDOMTrxAmt,
e.internalStatus AS internal_status,
e.myinvStatus AS myinv_status,
e.uuid AS invoiceUuid,
e.validatedDatetime AS validated_datetime,
e.rejectDatetime AS reject_datetime,
e.cancelDatetime AS cancel_datetime,
e.direction AS direction
FROM TrxHead e
JOIN Company c ON c.co = ${co}
JOIN TrxSupplier s ON s.id = e.id
JOIN TrxBuyer b ON b.id = e.id
WHERE
(${direction} IS NULL OR e.direction = ${direction})
AND (${einvoiceType} IS NULL OR e.einvoiceType = ${einvoiceType})
AND (${internalStatus} IS NULL OR e.internalStatus = ${internalStatus})
AND (${myinvStatus} IS NULL OR e.myinvStatus = ${myinvStatus})
AND (${erpTrxDateFrom} IS NULL OR e.trxDate >= ${erpTrxDateFrom})
AND (${erpTrxDateTo} IS NULL OR e.trxDate <= ${erpTrxDateTo})
AND (${eInvoiceDateFrom} IS NULL OR e.einvoiceDate >= ${eInvoiceDateFrom})
AND (${eInvoiceDateTo} IS NULL OR e.einvoiceDate <= ${eInvoiceDateTo})
AND (${rejectRequestDateFrom} IS NULL OR e.rejectDatetime >= ${rejectRequestDateFrom})
AND (${rejectRequestDateTo} IS NULL OR e.rejectDatetime <= ${rejectRequestDateTo})
AND (${cancelRequestDateFrom} IS NULL OR e.cancelDatetime >= ${cancelRequestDateFrom})
AND (${cancelRequestDateTo} IS NULL OR e.cancelDatetime <= ${cancelRequestDateTo})
Then i uploaded my jrxml file into the template,but i get a blank pdf as the report. The jrxml and the report is uploaded here. Can someone help me, why does this happen? Thank you.
The null parameters are correct, only the company and companyEntity are required.
I updated the drive with a sample sql file which can be run to create dummy tables and data.
Best regards,
Amirul Mukminin
Update:
I tried using Groovy dataset (I used a different band named groovyReportSummary)
import com.atgnexus.einvoice.entity.TrxHead;
def result = []
def list = dataManager.loadValue("select CASE WHEN c.name <> b.name THEN b.name ELSE s.name END AS supplierBuyer from TrxHead e JOIN Company c ON c.co = :co JOIN TrxSupplier s ON s.id = e.id JOIN TrxBuyer b ON b.id = e.id", TrxHead.class).parameter("co", params['company']).list()
list.each(e->{
result.add(['supplierBuyer': e.supplierBuyer])
})
return result
ReportingException: An error occurred while loading data for band [groovyReportSummary] and query [dataSet1]. Report name [Transaction Report]
An error occurred while loading data for data set [dataSet1]
Could not compile static script
No such property: supplierBuyer for class: java.lang.String