I have a Servlet that returns a PDF (Jasper Report). When the request comes from an HTML Form, It successfully shows the PDF.
<form method="post" action="../reports/GenerateReport" target="_blank">
I'm new to jQuery and I would like to generate the report using an AJAX request, I now have the following code:
$.post('../reports/GenerateReport', {
...
}, function (report) {
//this ajax call returns a PDF
//how do I show it?
});
But I don't know what to do with the returned PDF. How do I show it? Thank you.