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

ireport plugin bug?


richard_tsai

Recommended Posts

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 by

Code:
[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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...