2001 JI Open Discussion Posted August 13, 2006 Share Posted August 13, 2006 By: Barbara McLennan - mcbarb Error compiling JSP 2002-01-04 15:57Hi, Happy New Year to you too!! I am slowly making progress trying to run my first Jasperreport using your servlet example. My code looks like this: <%@ page import="dori.jasper.engine.*" %> <%@ page import="java.util.*" %> <%@ page import="java.io.*" %> <%@ page import="java.sql.*" %> <%@ page import="java.awt.*" %> <%@ include file="./bookConnect.jsp" %> <% Class.forName("org.postgresql.Driver"); String conn = "jdbc:postgresql://" + host + "/" + db + "?user=" + user + "&password=" + pass; Connection Conn = DriverManager.getConnection(conn); JasperReport jasperReport = null; jasperReport = JasperManager.loadReport("bookins.jasper"); //Preparing parameters Image image = Toolkit.getDefaultToolkit().createImage("dukesign.jpg"); MediaTracker traker = new MediaTracker(new Panel()); traker.addImage(image, 0); try { traker.waitForID(0); } catch (Exception e) { e.printStackTrace(); } Map parameters = new HashMap(); parameters.put("ReportTitle", "Insurance Report"); parameters.put("Location", "Mitcham"); parameters.put("SummaryImage", image); JasperPrint jasperPrint = JasperManager.fillReport(jasperReport, parameters, conn); ByteArrayOutputStream baos = JasperManager.printReportToPdf(jasperPrint); response.setContentType("application/pdf"); response.setContentLength(baos.size()); ServletOutputStream outStream = response.getOutputStream(); baos.writeTo(outStream); outStream.flush(); outStream.close(); %> I am developing my app under Netbeans 3.2, and when I try to compile this page I get the following error: ControlFreak/_0002fControlFreak_0002fbookInsRpt_0002ejspbookInsRpt_jsp_0.java [123:1] cannot resolve symbol symbol : method fillReport (dori.jasper.engine.JasperReport,java.util.Map,java.lang.String) location: class dori.jasper.engine.JasperManager JasperPrint jasperPrint = JasperManager.fillReport(jasperReport, parameters, conn); ^ 1 error Errors compiling bookInsRpt. Just in case this error doesn't line up properly in the final message (it doesn't look like it's going to at the moment), the error occurs at the fullstop in the fillreport method. Any help would be appreciated. Barb. By: Teodor Danciu - teodord RE: Error compiling JSP 2002-01-06 23:38 Hi, Barbara, There is a small mistake in your code. You have two variables: String conn Connection Conn Make sure you pass Conn to the fillReport() method and not conn. Good luck! Teodor By: Barbara McLennan - mcbarb RE: Error compiling JSP 2002-01-07 02:41Hi Teodor, YeeeHaaa...I have a report. Thankyou for your great software and for your tolerance of my silly mistake. Cheers, Barb By: Ilievski Bozidar - bobi1978 RE: Error compiling JSP 2002-01-14 04:34Hi Teodor. I have tried this example and it works fine. The server passes PDF format to the client. The only problem is with the Cyrillic character. They are all represented with ????? . In the .JRPRINT file Cyrillic characters are represented OK, So my question (or my request) is : Can you tell me how to pass the JRPRINT format to the client(if it is possible)??? Thanks By: Teodor Danciu - teodord Cyrillic characters 2002-01-14 08:14 Hi, With the current version (0.2.1) of the library, there is now way to display Cyrillic characters in PDF. That's because in this version there is no support for the PDF fonts and encoding. Your problems will be over with the release of the new version of JasperReports (0.2.2), which will introduce a mechanism to map PDF fonts. Users will be able to specify what font and what encoding will be used when generating the PDF file. I'm currently writing the documentation for those new features and I hope they will be sufficient for all applications that need to generate PDF reports in different languages. The new version will be released some time this week. Keep in touch, Teodor By: Teodor Danciu - teodord Cyrillic characters 2002-01-14 08:17 Hi, With the current version (0.2.1) of the library, there is now way to display Cyrillic characters in PDF. That's because in this version there is no support for the PDF fonts and encoding. Your problems will be over with the release of the new version of JasperReports (0.2.2), which will introduce a mechanism to map PDF fonts. Users will be able to specify what font and what encoding will be used when generating the PDF file. I'm currently writing the documentation for those new features and I hope they will be sufficient for all applications that need to generate PDF reports in different languages. The new version will be released some time this week. Keep in touch, Teodor By: Teodor Danciu - teodord Cyrillic characters 2002-01-14 08:19 Hi, With the current version (0.2.1) of the library, there is now way to display Cyrillic characters in PDF. That's because in this version there is no support for the PDF fonts and encoding. Your problems will be over with the release of the new version of JasperReports (0.2.2), which will introduce a mechanism to map PDF fonts. Users will be able to specify what font and what encoding will be used when generating the PDF file. I'm currently writing the documentation for those new features and I hope they will be sufficient for all applications that need to generate PDF reports in different languages. The new version will be released some time this week. Keep in touch, Teodor Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now