please help me to fix it, i really have no idea ! please
/* - To change this template, choose Tools | Templates - and open the template in the editor. */ - package pdfprint;
import com.jaspersoft.ireport.jasperserver.JServer; import
com.jaspersoft.ireport.jasperserver.ws.WSClient; import
java.util.HashMap; import java.util.*; import
net.sf.jasperreports.engine.JasperPrint; import
net.sf.jasperreports.engine.JasperReport; import
net.sf.jasperreports.engine.export.JRPrintServiceExporter; import
net.sf.jasperreports.engine.export.JRPrintServiceExporterParameter;
import net.sf.jasperreports.view.JasperViewer;
public class Pdfprint {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
try{
JServer server = new JServer();
server.setUrl("http://localhost:8080/jasperserver/services/repository");
server.setUsername("jasperadmin");
server.setPassword("jasperadmin");
ResourceDescriptor rd = new ResourceDescriptor();
rd.setUriString("/solucisv3_testing/jr_testing_print");
WSClient client = new WSClient(server);
List list = client.list(rd);
Map params = new HashMap();
params.put("Plb_Company", "Company");
params.put("Plb_Address", "Address");
params.put("Plb_Title","Title");
params.put("PCondition","SELECT * FROM v_doc_ticketing WHERE f_doc_no='MYCSB0000096'");
JasperPrint printer = client.runReport(rd, params);
JasperViewer.viewReport(printer, false,Locale.GERMAN);
JRPrintServiceExporter exporter;
exporter = new JRPrintServiceExporter();
//exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG,
Boolean.FALSE);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG,
Boolean.TRUE);
exporter.setParameter(JRPdfExporterParameter.PDF_JAVASCRIPT,"this.print({bUI:
false,bSilent: true,bShrinkToFit: true});");
exporter.exportReport(); } catch(Exception ex){ }
} }
i have some error in this line List list = client.list(rd);
error code =no suitable method found for list(pdfprint.ResourceDescriptor) method WSClient.list(String) is not applicable (actual argument pdfprint.ResourceDescriptor cannot be converted to String by method invocation conversion) method WSClient.list(com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor) is not applicable (actual argument pdfprint.ResourceDescriptor cannot be converted to com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor by method invocation conversion)
and JasperPrint printer = client.runReport(rd, params,list);
also have same error
error code = no suitable method found for runReport(pdfprint.ResourceDescriptor,Map,List) method WSClient.runReport(com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor,Map,List) is not applicable (actual argument pdfprint.ResourceDescriptor cannot be converted to com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor by method invocation conversion) method WSClient.runReport(com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor,Map) is not applicable (actual and formal argument lists differ in length)
You are passing a pdfprint.ResourceDescriptor
instead of a com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor
.
Possibly in your IDE you accidentally created a ResourceDescriptor
class in your current package instead of importing the existing one. If so, simply delete the class from your package and add an import statement for the correct one, making sure that it is on the classpath for your project.