richard_tsai Posted February 9, 2007 Share Posted February 9, 2007 Hi! there, We are working on creating custom report with Custom JR data source by JasperServer1.1+iReport1.2.8. My report can work fine in JasperServer, but not by Run Report Unit in iReport. iReport plugin always say "No JasperPrint". I found WSClient tried to fetch FileContent with key jasperPrint, but, actually, JasperServer returned FileContent with key attachment. I modified WSClient.java as following. It works anyway. Code:public JasperPrint runReport(ResourceDescriptor descriptor, java.util.Map parameters) throws Exception {List args = new ArrayList(1);args.add(new Argument(Argument.RUN_OUTPUT_FORMAT, Argument.RUN_OUTPUT_FORMAT_JRPRINT));Map s = runReport(descriptor, parameters, args);FileContent content = null; if (s != null && !s.isEmpty()) { content = (FileContent) s.get(""«»); if (content==null) { Object key = s.keySet().iterator().next(); content = (FileContent) s.get(key); } } if (content == null) { throw new Exception("No JasperPrint"«»); } InputStream is = new ByteArrayInputStream(content.getData()); JasperPrint print = (JasperPrint) JRLoader.loadObject(is); return print; } I wonder maybe Code:[code]content = (FileContent) attachments.get("jasperPrint"«»);could be replaced byCode:[code]content = (FileContent) attachments.get(attachments.keySet().iterator().next());Post edited by: richard_tsai, at: 2007/02/09 03:20 Link to comment Share on other sites More sharing options...
lucianc Posted February 12, 2007 Share Posted February 12, 2007 This should have been posted on the JasperServer forum. Try reposting your question there, you would get the right audience. Regards,Lucian Link to comment Share on other sites More sharing options...
richard_tsai Posted February 14, 2007 Author Share Posted February 14, 2007 Lucian, Thanks! 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