Jump to content

Radheesh

Members
  • Posts

    4
  • Joined

  • Last visited

Radheesh's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi friends, I am getting empty spaces,incomplete line when i save jasperreport as Html also font size, image,font style are diffrent in Html format I won't prefer Applet Viewer because it was slow while accessing through dialup Please give me the solution Following are the Codes , Expecting ur Solution <%@ page errorPage="error.jsp" %> <%@ page import="net.sf.jasperreports.engine.*" %> <%@ page import="net.sf.jasperreports.engine.util.*" %> <%@ page import="net.sf.jasperreports.engine.export.*" %> <%@ page import="net.sf.jasperreports.j2ee.servlets.*" %> <%@ page import="java.util.*" %> <%@ page import="java.io.*" %> <% String contextPath=request.getContextPath(); JasperPrint jasperPrint = (JasperPrint)session.getAttribute("jasperPrint"); session.setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint); // } JRHtmlExporter exporter = new JRHtmlExporter(); int pageIndex = 0; int lastPageIndex = 0; if (jasperPrint.getPages() != null) { lastPageIndex = jasperPrint.getPages().size() - 1; } String pageStr = request.getParameter("page"); try { pageIndex = Integer.parseInt(pageStr); } catch(Exception e) { } if (pageIndex < 0) { pageIndex = 0; } if (pageIndex > lastPageIndex) { pageIndex = lastPageIndex; } StringBuffer sbuffer = new StringBuffer(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STRING_BUFFER, sbuffer); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "../servlets/image?image="); exporter.setParameter(JRExporterParameter.PAGE_INDEX, new Integer(pageIndex)); exporter.setParameter(JRHtmlExporterParameter.HTML_HEADER, ""); exporter.setParameter(JRHtmlExporterParameter.BETWEEN_PAGES_HTML, ""); exporter.setParameter(JRHtmlExporterParameter.HTML_FOOTER, ""); exporter.exportReport(); %> <html> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <head> <style type="text/css"> a {text-decoration: none} </style> </head> <body text="#000000" link="#000000" alink="#000000" vlink="#000000"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="50%"> </td> <td align="left"> <hr size="1" color="#000000"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><a href="<%=contextPath%>/transactions/viewhtml.jsp?reload=true"><img src="../imagesweb/reload.GIF" border="0"></a></td> <td> </td> <% if (pageIndex > 0) { %> <td><a href="<%=contextPath%>/transactions/viewhtml.jsp?page=0"><img src="../imagesweb/first.GIF" border="0"></a></td> <td><a href="<%=contextPath%>/transactions/viewhtml.jsp?page=<%=pageIndex - 1%>"><img src="../imagesweb/previous.GIF" border="0"></a></td> <% } else { %> <td><img src="../imagesweb/first_grey.GIF" border="0"></td> <td><img src="../imagesweb/previous_grey.GIF" border="0"></td> <% } if (pageIndex < lastPageIndex) { %> <td><a href="<%=contextPath%>/transactions/viewhtml.jsp?page=<%=pageIndex + 1%>"><img src="../imagesweb/next.GIF" border="0"></a></td> <td><a href="<%=contextPath%>/transactions/viewhtml.jsp?page=<%=lastPageIndex%>"><img src="../imagesweb/last.GIF" border="0"></a></td> <% } else { %> <td><img src="../imagesweb/next_grey.GIF" border="0"></td> <td><img src="../imagesweb/last_grey.GIF" border="0"></td> <% } %> <td width="100%"> </td> </tr> </table> <hr size="1" color="#000000"> </td> <td width="50%"> </td> </tr> <tr> <td width="50%"> </td> <td align="center"> <%=sbuffer.toString()%> </td> <td width="50%"> </td> </tr> </table> </body> </html>
  2. Hi Everyone, Before working in the application i added three Local Network printers in my machine now i switched to dialup connection by disconnecting the local connection,then i started my application and i gave a print in jasper..... jasper print dialog shows the printers that are installed in the computer... but, I need only printers that are installed in the current network(ie.,DialUp)...otherwise some warning like UNINSTALL the printers that are not available in the current network....why i am asking this is suppose the user selects the printer that are not available in the current network makes the application to hang ..because it searching the printer that are not available in the network... Friends help me its very urgent :( :blink:
  3. Hi friends, I am doing project for railways.... In this project i want to print tickets... problem is after printing first page.. alignment is out in the second page.. So i adjust the page size in jasper and printer settings to print properly...by now its working.... But the client requirement is the printer head or paper should auomatically adjust according to data and client are not ready to adjust printer settings... For Example in Bank the passbook will get adjusted automatically while printing... from first page to second page also in the bank they will send password for ATM or creditcard during this they will take printout continually for more than 300 customers ..while printing Printer header and paper adjust themselves according to datas. Actually this options are available in C,C++ and foxpro...I don't know in java so how to set formfeed after a page printing in jasper...or how to adjust the printer head and paper using java...I am using Dot matrix printer please help me ..it's very urgent :dry: :blink: :( :whistle: thank you Radheesh Prabhu
  4. hi friends i set page size half comparing to A4 size, the thing is client are using the page which is more height ... so reports are printing without form feed after printing one page[when reports are more than one page] How to make a form feed after printing in one page.. Regards Radheesh Prabhu.C.P
×
×
  • Create New...