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

kevin.haferkamp

Members
  • Posts

    5
  • Joined

  • Last visited

kevin.haferkamp's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. With this I'll get a NPE at com.jaspersoft.webservice.data.query.WebServiceQueryExecuter.getInternalQE(WebServiceQueryExecuter.java:243) complete sample: public class JasperReportsGenerator { public static void main(String[] args) { // Instantiate Web Service Data Source Data Adapter WebServiceDataAdapterImpl wsDataAdapter = new WebServiceDataAdapterImpl(); wsDataAdapter.setName("WS DS NAME"); wsDataAdapter.setWsUri("http://localhost:8090/some/service"); wsDataAdapter.setVerb(VerbType.GET.toString()); wsDataAdapter.setLanguage(LanguageType.JSON); wsDataAdapter.setAuthType(AuthType.NONE); SimpleJasperReportsContext jasperReportsContext = new SimpleJasperReportsContext(); jasperReportsContext.setProperty("webservice", "com.jaspersoft.webservice.data.query.WebServiceQueryExecuterFactory"); jasperReportsContext.setProperty("WebServiceQuery", "com.jaspersoft.webservice.data.query.WebServiceQueryExecuterFactory"); WebServiceDataAdapterServiceFactory factory = WebServiceDataAdapterServiceFactory .getInstance(); WebServiceDataAdapterService dataAdapterService = (WebServiceDataAdapterService) factory .getDataAdapterService(jasperReportsContext, wsDataAdapter); dataAdapterService.dispose(); // Instantiate report properties map (REPORT_PARAMETERS) Map<String, Object> reportParams = new HashMap<String, Object>(); try { dataAdapterService.contributeParameters(reportParams); System.out.println("Filling Reports..."); long start = System.currentTimeMillis(); JasperFillManager.fillReportToFile("reports/SampleReport.jasper", reportParams); System.out.println("Filling time: " + (System.currentTimeMillis() - start)); System.out.println("Exporting to PDFs..."); start = System.currentTimeMillis(); File sourceFile = new File("reports/SampleReport.jrprint"); JasperPrint jasperPrint = (JasperPrint) JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pdf"); JRPdfExporter exporter = new JRPdfExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile)); SimplePdfExporterConfiguration configuration = new SimplePdfExporterConfiguration(); exporter.setConfiguration(configuration); exporter.exportReport(); System.out.println("Exporting time: " + (System.currentTimeMillis() - start)); } catch (JRException | IOException e) { System.err.println("Error in executiong the reports!"); System.err.println(e); }}[/code]
  2. Hi there! The WebService Data Source works like a charme inside the Jaspersoft Studio and in the JasperReports Server Pro. Now I try to ceate a basic Java Class which should create the report using the API. And here is my problem at all - is there any example available for generating a PDF file out of a report which uses the Web Service Data Source? I struggle with the Fill Manager... JasperFillManager.fillReportToFile("reports/SampleReport.jasper", reportParams, <And What goes here?>);I tried the WSEmptyDatasource, but this seems to be the wrong one. I used the WebServiceDataAdapterServiceFactory to contribute the Report Parameters Map and this seems to be working. I feel close to a solution but I cannot see one actually :) Thank you very much! Best regards,Kevin
  3. Changed Resolution from Open to Fixed Changed Assigned User from @User_306070 to @anonymous Thanks!
  4. Hi community, I have some trouble adding some buttons into the new dashboards designer. I would like to have just some buttons to link directly to some ad hoc views (e.g. direct access to an OLAP ad hoc view). One thing I found out, which in my humble opinion is not the 'sexiest' way, is to use the html component to render some INPUT-Tags. As far as I know the html component ist not included in the default installation and terefore this approach is not really useful. Are there any other ways to do some navigation inside of dashboards? Of course a solution with Visualize.js would be nice, too :) Thank you very much! Best Regards, Kevin
×
×
  • Create New...