Jump to content
We've recently updated our Privacy Statement, available here ×

wjones14

Members
  • Posts

    32
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by wjones14

  1. Thanks Lucian, your suggestion about creating the frames first, and then putting things inside them works! The iReport Document Structure pane also shows the elements as nested inside the frames when done this way. Instead of starting over though, I found that I could simply use iReport to cut the elements, select the frame, and then paste. This puts the elements inside the frame. Then you can drag the elements inside the frame to the position you want.
  2. I have a report that has two subreports, one on top of the other, both floating. Then with iReport, I dragged a frame around the two subreports. The frame has Thin border. But, when the report displays, it only surrounds the column header of the first subreport. Do I have to edit the .jrxml file manually to make the frame surround both subreports? (not even really sure how to do that to be honest) Thanks, Bill J.
  3. I know how to do it with JSF... I put a method in the JSF managed bean named getBaseDir(). It looks like this: public String getBaseDir() { String baseDir = "/WEB-INF/reports"; try { return FacesContext.getCurrentInstance() .getExternalContext() .getResource(baseDir) .getPath(); } catch (MalformedURLException mue) { log.error(mue, mue); return null; } } Then, add a parameter to the parameter map: map.put("base_dir", getBaseDir()); Finally, in the report itself, the graphics element "image expression" is: new File($P{base_dir},"images/logo.gif")
  4. the printerName string got messed up in the post. It should be: //grogrdprt10/MFD443 except windows slashes rather than unix slashes. B)
  5. Okay, using your example, I think the code is close now. It works on a local instance of Weblogic server, running on a PC hooked up to a Windows network. It brings up a javax.Swing print dialog. However, it fails when deployed to a remote Sun server running Weblogic, with this exception: net.sf.jasperreports.engine.JRException: No suitable print service found. Here is the code: JasperReport jasperReport = buildContent(); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, data, new JREmptyDataSource()); // if local weblogic server, can directly use JasperPrintManager, // but for remote weblogic must use JRPrintServerExporter // JasperPrintManager.printReport(jasperPrint, true); // code from the demo samples long start = System.currentTimeMillis(); PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet(); printRequestAttributeSet.add(MediaSizeName.ISO_A4); String networkName = "\\grogrdprt10\MFD443"; PrinterName printerName = new PrinterName(networkName, null); PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet(); printServiceAttributeSet.add(printerName); JRPrintServiceExporter exporter = new JRPrintServiceExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, printRequestAttributeSet); exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, printServiceAttributeSet); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE); exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE); log.debug("Exporting report..."); exporter.exportReport(); log.debug(("Printing time : " + (System.currentTimeMillis() - start))); Is the problem that the Unix system doesn't recognize the Windows network address? Thanks for the help! Bill J.
  6. I see now that JasperPrintManager is really not for printing on a remotely deployed web application. The packaged demo samples have a webapp that can print a report, using an applet. We'd rather not use an applet if possible. Does anyone know another printing solution, for instance if we know the printer address of the logged-in user? Thanks, Bill J.
  7. I use code like this to send a report to the printer: JasperReport jasperReport = buildContent(); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, data, new JREmptyDataSource()); JasperPrintManager.printReport(jasperPrint, true); This code works fine on a PC with a local weblogic server instance running. It brings up a Windows print dialog and sends report to the default printer. However, when the application is deployed on a remote Sun server with weblogic, I get this error: net.sf.jasperreports.engine.JRException: Error printing report. at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:200) at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:88) at net.sf.jasperreports.engine.JasperPrintManager.printPages(JasperPrintManager.java:348) at net.sf.jasperreports.engine.JasperPrintManager.printReport(JasperPrintManager.java:239) at com.pfizer.lynx.reports.ContainerLabelReportBean.printLabel(ContainerLabelReportBean.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129) at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63) at javax.faces.component.UICommand.broadcast(UICommand.java:106) at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168) at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6987) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183) Caused by: java.awt.HeadlessException at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:465) at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:184) ... 29 more Anyone know how to fix this? Thanks, Bill J.
×
×
  • Create New...