on 05-23-2014 3:31 PM
I am working on testing a web application with BOE XI V 3.1. I have the database and RAS machines setup. I have been working on changing my app to printing through the RAS. I have print preview and export working, but am running into issues printing to a printer.
On the RAS which is on a virtual machine, I have a printer setup as a local printer to a tcpip port so the VM can access a printer on our network. But when I call the clientDoc.getPrintOutputController().printReport(printOptions); I get the error message ReportSDKPrinterException: Printer name could not be set.
I have also on the side been testing using a small jsp modified from a working print preview.
Here is the jsp:
<%@ page contentType="text/html; charset=utf-8" %>
<%@
page import="com.crystaldecisions.sdk.occa.report.application.*,
com.crystaldecisions.sdk.occa.report.data.*,
com.crystaldecisions.sdk.occa.report.document.*,
com.crystaldecisions.sdk.occa.report.lib.*,
com.crystaldecisions.report.web.viewer.*"
%>
<html>
<head>
<title>Print Report</title>
</head>
<body>
<%@ include file="AlwaysRequiredSteps_UnmanagedRAS.jsp"%>
<%
// Populate parameters
clientDoc.getDataDefController().getParameterFieldController().setCurrentValue("", "TAB_ID", "Configuration");
clientDoc.getDataDefController().getParameterFieldController().setCurrentValue("", "LOGO_LOCATION", "d:\\reports\\images\\highjump.gif");
PrintReportOptions printOptions = new PrintReportOptions();
printOptions.setPrinterName("Dell");
clientDoc.getPrintOutputController().printReport(printOptions);
clientDoc.close();
%>
</body>
</html>
The code from AlwaysRequiredSteps_UnmanagedRAS.jsp is:
<%
// This file contains the required steps to open an unmanaged report from a file path accessible to the RAS Server.
// Modify this path to the location of the report on your system.
String path = "rassdk://C:\\reports\\ReportList.rpt";
// Create a new Report Application Session.
ReportAppSession ra = new ReportAppSession();
// Create a RAS service.
ra.createService("com.crystaldecisions.sdk.occa.report.application.ReportClientDocument");
// Set the RAS server to be used for the service.
ra.setReportAppServer("10.192.183.196:1566");
// Initialize RAS.
ra.initialize();
// Create the ReportClientDocument object.
ReportClientDocument clientDoc = new ReportClientDocument();
// Set the RAS server to be used.
clientDoc.setReportAppServer(ra.getReportAppServer());
// Open the report, and set the open type to Read Only.
clientDoc.open(path, OpenReportOptions._openAsReadOnly);
%>
The result I get from running this is:
HTTP Status 500 - An exception occurred processing JSP page /PrintReport.jsp at line 28
--------------------------------------------------------------------------------
type Exception report
message An exception occurred processing JSP page /PrintReport.jsp at line 28
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /PrintReport.jsp at line 28
25: PrintReportOptions printOptions = new PrintReportOptions();
26: printOptions.setPrinterName("DELL");
27:
28: clientDoc.getPrintOutputController().printReport(printOptions);
29:
30: clientDoc.close();
31: %>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
root cause
javax.servlet.ServletException: com.crystaldecisions.sdk.occa.report.lib.ReportSDKPrinterException: Printer name could not be set: DELL---- Error code:-2147215357 Error code name:internal
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)
org.apache.jsp.PrintReport_jsp._jspService(PrintReport_jsp.java:133)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
root cause
com.crystaldecisions.sdk.occa.report.lib.ReportSDKPrinterException: Printer name could not be set: DELL---- Error code:-2147215357 Error code name:internal
com.crystaldecisions.sdk.occa.report.lib.ReportSDKPrinterException.throwReportSDKPrinterException(Unknown Source)
com.crystaldecisions.sdk.occa.report.application.PrintOutputController.printReport(Unknown Source)
org.apache.jsp.PrintReport_jsp._jspService(PrintReport_jsp.java:120)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
root cause
com.crystaldecisions.sdk.occa.report.lib.ReportSDKPrinterNotFoundException: Printer name could not be set: DELL---- Error code:-2147215365 Error code name:printerNotFoundError
com.businessobjects.crystalreports.printer.bean.a.try(Unknown Source)
com.businessobjects.crystalreports.printer.bean.ReportPrinter.setPrinterName(Unknown Source)
com.businessobjects.crystalreports.printer.bean.ReportPrinter.print(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.crystaldecisions.sdk.occa.report.application.PrintOutputController.printReport(Unknown Source)
org.apache.jsp.PrintReport_jsp._jspService(PrintReport_jsp.java:120)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
root cause
java.awt.print.PrinterException: No printer named "DELL" could be found.
com.businessobjects.crystalreports.viewer.core.f$a.a(Unknown Source)
com.businessobjects.crystalreports.viewer.core.f.a(Unknown Source)
com.businessobjects.crystalreports.printer.bean.a.try(Unknown Source)
com.businessobjects.crystalreports.printer.bean.ReportPrinter.setPrinterName(Unknown Source)
com.businessobjects.crystalreports.printer.bean.ReportPrinter.print(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.crystaldecisions.sdk.occa.report.application.PrintOutputController.printReport(Unknown Source)
org.apache.jsp.PrintReport_jsp._jspService(PrintReport_jsp.java:120)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.53 logs.
--------------------------------------------------------------------------------
Apache Tomcat/7.0.53
I would really appreciate any help in figuring out how to print to the RAS.
Thanks in advance.
Hi Jason,
Could you please let us know the complete Business Objects version with Service Pack and Fix Pack?
Actually the issue you are facing was identified as a bug and was fixed in Business Objects Enterprise XI 3.1 FixPack 2.2.
Please go through the SAP Note: 1417374 - Error "Printer name could not be set" when printing using the RAS SDK.
Hope this helps.
Regards,
Rajarsh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am running Business Objects Enterprise XI 3.1 Service Pack 6. I have not installed any Fix packs. Am I correct in that fix packs are applied to their service pack level and all fix packs from previous versions are already incorporated into the current service packs.
So is Fix pack 2.2 already in Service pack 6? I assume that I would need to be installing Fix packs 6.1 through 6.4.
Thanks
Jason
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.