I want to create a pdf according to Incoming Value From Mysql DB using Struts.Could Anyone help me by point any tool or how to process?
You can use iText - a mature open source library for creating PDF documents. The following example is Struts 1 based, but may help you:
public class PDF extends Action {
public ActionForward perform(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
try {
Document document = new Document();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfWriter.getInstance(document, baos);
document.open();
document.add(new Paragraph("Hello World"));
//
// add your data here ...
//
document.close();
response.setContentType("application/pdf");
response.setContentLength(baos.size());
ServletOutputStream out = response.getOutputStream();
baos.writeTo(out);
out.flush();
} catch (Exception e2) {
System.out.println("Error in " + getClass().getName() + "\n" + e2);
}
return null;
}
}
In addition to iText, you can use JasperResports - it is built ontop of iText, but provides a GUI designer for your report (which can be then exported to pdf, excel, printer, etc.).
But either way you will have to read and learn a lot ;)
Docmosis will let you create the basis of your document in Doc or ODT format as a template. You can then use your mysql data to control what you want to do to the template (insert data, remove data, pick a different template etc) before you render the PDF. I'm not sure what your "pdf with complex UI" means. Docmosis lets you template fairly sophistocated documents (thanks to OpenOffice), but Jasper lets you code pretty much any output result you could need.