Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run report using node-jasper #65

Open
itranga opened this issue Nov 18, 2021 · 0 comments
Open

run report using node-jasper #65

itranga opened this issue Nov 18, 2021 · 0 comments

Comments

@itranga
Copy link

itranga commented Nov 18, 2021

I have attached my jrxml here .

How do i run this report using node-jasper ? I mean how do i pass 'data: ..' .here . Do you have example for mysql ?

app.get('/pdf', function(req, res, next) {
//beware of the datatype of your parameter.
var report = {
report: 'hw',
data: {
id: parseInt(req.query.id, 10)
secundaryDataset: jasper.toJsonDataSource({
data: ...
},'data')
}
dataset: //main dataset
};
var pdf = jasper.pdf(report);
res.set({
'Content-type': 'application/pdf',
'Content-Length': pdf.length
});
res.send(pdf);
});

..................................................................................................

WHERE
b.date = '2021-11-17'
UNION ALL
SELECT
2 sort,a.batchid,
g.name compname,
c.batchcode,
c.batchvehicleno,
c.date,
d.routename,
a.container,
h.name supname,
b.itmdesc,
a.finaldrc,
a.kgs,
a.liters,
a.metrolac,
a.nh3,
a.remarks,
a.sampledrc,
a.tz,
a.temp,
0 accqty,
0 accltr,
0 dryweightdif,
0 findryweight,
0 fldltr,
0 fldqty,
0 invqty,
0 samdryweight,
' ' vfa,
' ' drc
FROM
batchitempicitem a
INNER JOIN itemmaster b ON
a.companyid = b.companyid AND a.itemmasterid = b.id
INNER JOIN batch c ON
a.batchid = c.id
INNER JOIN route d ON
c.companyid = d.companyid AND c.locationid = d.locationid AND c.routeid = d.id
LEFT OUTER JOIN batchitem e ON
a.companyid = e.companyid AND a.batchid = e.batchid AND a.batchitemid = e.id
INNER JOIN location f ON
a.companyid = f.companyid AND a.locationid = f.id
INNER JOIN company g ON
a.companyid = g.id
INNER JOIN custsup h ON
a.companyid = h.companyid AND h.custsup = 'S' AND e.custsupid = h.id
WHERE
DATE(c.date) = '2021-11-17'
) X
ORDER BY
batchcode,sort,supname,container]]>







































..........................................................

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant