Please help me fix it, I really do not know! Please
/ * - To change this template, select the tool. Template - and open the template in the editor. * / - Package PDF Print;
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 {/ ** * @ Ultimate Command Line Argument * / Public Static Zero Main (string [] ARG) {// TODO code application logic here {JServer Server = New JServer (try); Server.setUrl ("http: // localhost: 8080 / jasperserver / services / store"); Server.setUsername ("jasperadmin"); Server.setPassword ("jasperadmin"); Resource Descriptor rd = New Resource Descriptor (); Rd.setUriString ("/ solucisv3_testing / jr_testing_print"); WSClient Client = New WSClient (Server); List list = client.list (RD); Map Parameters = new Hashmap (); Params.put ("Plb_Company", "Company"); Params.put ("Plb_Address", "Address"); Params.put ("Plb_Title", "title"); Params.put ("PCondition", "SELECT * v_doc_ticketing from WHERE f_doc_no = 'MYCSB0000096'"); JasperPrint printer = client.runReport (RD, Parameters); JasperViewer.viewReport (printer, wrong, locale.jerman); 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 (); } Hold (Exception Pre) {}}} -
I have some error in this list list list = client.list (rd);
-
Error code = apply any appropriate method (pdfprint.ResourceDescriptor) method WSClientklist (string) list (actual argument pdfprint.ResourceDescriptor method to convert string invocation conversion it can not be done) method WSClient .list (com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor) apply (real argument pdfprint.ResourceDescriptor com.jaspersoft.jasperserver.api.metadata.xml. Domain.impl can not be changed.
-
and JasperPrint printer = client.runReport (RD, Paramet , List);
-
There is only one error
-
Error code = no appropriate method runReport (pdfprint.ResourceDescriptor, map list) method got WSClient.runReport (com.jaspersoft.jasperserver.api.metadata. Xml.domain.impl.ResourceDescriptor, map, list) is not the applicant able method WSClient.runReport (com.jaspersoft.jasperserver.api .metadata.xml (real argument pdfprint.ResourceDescriptor method can not be changed in com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor by invocation conversion). Domain.impl.ResourceDescriptor, map) is not applicable (actual and formal logic variations vary in length)
If you are passing a pdfprint.ResourceDescriptor instead of com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor . In your IDE, you have accidentally created a ResourceDescriptor class in your current package instead of importing an existing code. If so, remove the class from your package only and Add an import statement for the correct, make sure it is on the classpath for your project.
No comments:
Post a Comment