Attempting my first PDF export...
Test Code:
Server log shows:
Using
SmartClient Version: SC_SNAPSHOT-2012-01-20_v8.2p/PowerEdition Deployment (built 2012-01-20)
Please advise, thanks.
Test Code:
Code:
package com.smartgwt.sample.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.rpc.RPCManager; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.TextItem; public class TestPDF implements EntryPoint { public void onModuleLoad() { final Canvas canvas = new Canvas(); canvas.setWidth(300); canvas.setBorder("2px solid Red"); DynamicForm formPrint = new DynamicForm(); formPrint.setWidth(200); formPrint.setHeight(100); formPrint.setTop(20); formPrint.setLeft(50); formPrint.setBorder("2px solid Black"); TextItem textItem = new TextItem(); textItem.setName("NameBo"); textItem.setTitle("Title"); textItem.setValue("Value goes here..."); formPrint.setFields(textItem); canvas.addChild(formPrint); canvas.draw(); // to view onscreen DSRequest requestProperties = new DSRequest(); requestProperties.setDownloadResult(true); RPCManager.exportContent(canvas, requestProperties); } }
Code:
=== 2012-01-23 11:26:02,264 [0-10] INFO Compression - /BuiltInDS.html: 2139 -> 957 bytes === 2012-01-23 11:26:02,358 [0-10] INFO Download - Returning 304: Not modified on conditional get of: C:\eclipse\workspace\builtinds\war\builtinds\sc\skins\Enterprise\load_skin.js === 2012-01-23 11:26:02,780 [0-10] INFO Download - Returning 304: Not modified on conditional get of: C:\eclipse\workspace\builtinds\war\builtinds\sc\skins\Enterprise\skin_styles.css === 2012-01-23 11:26:08,996 [0-10] INFO RequestContext - URL: '/builtinds/sc/IDACall', User-Agent: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)': MSIE with Accept-Encoding header, ready for compressed JS === 2012-01-23 11:26:09,011 [0-10] DEBUG XML - Parsed XML from (in memory stream): 15ms === 2012-01-23 11:26:09,027 [0-10] DEBUG RPCManager - Processing 1 requests. === 2012-01-23 11:26:09,027 [0-10] DEBUG RPCManager - Request #1 (RPCRequest) data: { appID:"isc_builtin", className:"builtin", methodName:"getPdfObject", arguments:[ "<div class='normal' ><div class='normal' ><TABLE role='presentation' ID='isc_3' WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0><COL WIDTH=100><COL><tr><TD style='margin:0px;border:0px;padding:0px;background-image:none;background-color:transparent;height:0px;overflow:hidden;padding:0px;' class=''></TD><TD style='margin:0px;border:0px;padding:0px;background-image:none;background-color:transparent;height:0px;overflow:hidden;padding:0px;' class=''></TD></TR><TR><TD $89='isc_TextItem_1' $9a='$9g' ID=isc_4 CLASS='formTitle' ALIGN='right' VALIGN='middle'><LABEL FOR=isc_7>Title</LABEL> :</TD><TD ALIGN=left CLASS='formCell' STYLE='' ID=isc_6 $89='isc_TextItem_1'><DIV isDisabledEventMask='true' style='overflow:hidden;position:absolute;width:146px;height:22px' $89='isc_TextItem_1' $9a='$9b' ID='isc_8'><SPAN STYLE='WIDTH:1600px;HEIGHT:100px;overflow:hidden;'> </SPAN></DIV><INPUT TYPE=TEXT NAME='' ID='isc_9' handleNativeEvents=false $89='isc_TextItem_1' $9a='$9b' ONINPUT='isc_TextItem_1.$43g()' READONLY=TRUE value='Value goes here...' AUTOCOMPLETE=OFF CLASS='textItem' STYLE='WIDTH:146px;HEIGHT:22px;margin-top:-1px;margin-bottom:-1px;' TABINDEX=-1></TD></TR></TABLE></div></div>", { dirDefaultSkin:"http://127.0.0.1:8888/builtinds/sc/skins/Enterprise/" } ], is_ISC_RPC_DMI:true } === 2012-01-23 11:26:09,027 [0-10] INFO IDACall - Performing 1 operation(s) === 2012-01-23 11:26:09,043 [0-10] DEBUG RPCDMI - appConfig: isc.Application.create({ rpcBindings:[ { ID:"builtin", className:"com.isomorphic.rpc.BuiltinRPC", visibleMethods:[ { name:"downloadWSDL" }, { name:"downloadClientContent" }, { name:"downloadClientExport" }, { name:"xmlToJS" }, { name:"uploadProgressCheck" }, { name:"saveFile" }, { name:"appendToFile" }, { name:"loadFile" }, { name:"deleteFile" }, { name:"loadSharedXML" }, { name:"saveSharedXML" }, { name:"getAvailableScriptEngines" }, { name:"devConsoleEvalServerScript" }, { name:"evalJava" }, { name:"getLogNames" }, { name:"getLogEntries" }, { name:"getLogThresholds" }, { name:"setLogThreshold" }, { name:"getPdfObject" } ] }, { ID:"builtin_tools", className:"com.isomorphic.tools.BuiltinRPC", visibleMethods:[ { name:"getDataSourceFromTable" }, { name:"getDataSourceJSONFromTable" }, { name:"getDataSourceFromHibernateMapping" }, { name:"getDataSourceJSONFromHibernateMapping" }, { name:"getTables" }, { name:"getFieldsFromTable" }, { name:"getBeanFields" }, { name:"getHibernateBeans" }, { name:"getDatabaseProductNameAndVersion" }, { name:"getDatabaseTableTypes" }, { name:"setAttributes" }, { name:"clearAttributes" }, { name:"getAttributes" }, { name:"getAttribute" }, { name:"getDataSourceConfigFromJavaClass" }, { args:"cName", language:"groovy", name:"getJavaSource", script:"\n if (!com.isomorphic.auth.DevModeAuthFilter.devModeAuthorized(request)) throw new Exception(\"Not Authorized\"); \n //import org.apache.bcel.Repository;\n\n try {\n return org.apache.bcel.Repository.lookupClass(cName).toString();\n } catch (Throwable e) {\n return \"Unable to reverse engineer class \"+cName+\": \"+e.getMessage();\n }\n " }, { name:"loadDataSource" }, { name:"dsFromXML" }, { name:"dsConfigFromXML" }, { name:"getDefinedDataSources" } ] }, { ID:"builtin_adminconsole", className:"com.isomorphic.tools.AdminConsole", visibleMethods:[ { name:"getDefinedDatabases" }, { name:"testDB" }, { name:"saveDBConfig" }, { name:"setDefaultDB" }, { name:"importDataSources" }, { name:"discoverJNDIDatabases" } ] } ] }) === 2012-01-23 11:26:09,043 [0-10] DEBUG RPCDMI - Invocation threw exception java.lang.NoClassDefFoundError: org/xhtmlrenderer/extend/UserAgentCallback at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.isomorphic.base.Reflection.classForName(Reflection.java:137) at com.isomorphic.base.Reflection.getClassCache(Reflection.java:470) at com.isomorphic.base.Reflection.instantiateClass(Reflection.java:188) at com.isomorphic.base.Reflection.instantiateClass(Reflection.java:172) at com.isomorphic.interfaces.InterfaceProvider.load(InterfaceProvider.java:92) at com.isomorphic.rpc.BuiltinRPC.getPdfObject(BuiltinRPC.java:823) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:950) at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:803) at com.isomorphic.rpc.RPCDMI.execute(RPCDMI.java:305) at com.isomorphic.rpc.RPCDMI.execute(RPCDMI.java:66) at com.isomorphic.rpc.RPCRequest.execute(RPCRequest.java:231) at com.isomorphic.servlet.IDACall.handleRPCRequest(IDACall.java:245) at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:152) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097) at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488) Caused by: java.lang.ClassNotFoundException: org.xhtmlrenderer.extend.UserAgentCallback at java.lang.ClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:352) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337) ... 44 more === 2012-01-23 11:26:09,043 [0-10] ERROR IDACall - Top-level servlet error: java.lang.NoClassDefFoundError: org/xhtmlrenderer/extend/UserAgentCallback at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.isomorphic.base.Reflection.classForName(Reflection.java:137) at com.isomorphic.base.Reflection.getClassCache(Reflection.java:470) at com.isomorphic.base.Reflection.instantiateClass(Reflection.java:188) at com.isomorphic.base.Reflection.instantiateClass(Reflection.java:172) at com.isomorphic.interfaces.InterfaceProvider.load(InterfaceProvider.java:92) at com.isomorphic.rpc.BuiltinRPC.getPdfObject(BuiltinRPC.java:823) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:950) at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:803) at com.isomorphic.rpc.RPCDMI.execute(RPCDMI.java:305) at com.isomorphic.rpc.RPCDMI.execute(RPCDMI.java:66) at com.isomorphic.rpc.RPCRequest.execute(RPCRequest.java:231) at com.isomorphic.servlet.IDACall.handleRPCRequest(IDACall.java:245) at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:152) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097) at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488) Caused by: java.lang.ClassNotFoundException: org.xhtmlrenderer.extend.UserAgentCallback at java.lang.ClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:352) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337) ... 44 more === 2012-01-23 11:26:09,043 [0-10] INFO Compression - /builtinds/sc/IDACall: 3732 -> 948 bytes
SmartClient Version: SC_SNAPSHOT-2012-01-20_v8.2p/PowerEdition Deployment (built 2012-01-20)
Please advise, thanks.
Comment