Jump to content

cezar_apulchro

Members
  • Posts

    20
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

cezar_apulchro's Achievements

  1. I created a report in JasperSoft studio that use a table, in this report I created a three parameters in my "Dataset and Query Dialog screen", in this same screen I've my select condition but this is not working that is: " SELECT * FROM my_table WHERE col1 = $P{param1} AND col2 = $P{param2} AND col3 = $P{param3}". I open the report in my JasperSoft cliking in preview button, after type the parameters an blank page is generated. Like I sayed this problem occur only in the use of table in the report, in another report configured with the same parameters using same table this problem don't occur the report is generated fine. How to solve this proble? Thanks in advanced by any assistance.
  2. I solved the problem, solution: 1 - create new report 2 - in main report open the Dataset and Query Dialog 3 - in the screen opened put the sql command 4 - click in the parameter button to create your parameters 5 - ok button 6 - configure your table into main report 7 - into Dataset and Query Dialog screen type only the sql select Thanks adn best regards.
  3. I'm trying to create a Jaspersoft report table with parameters but I've problems to do this, I don't having error in the creation of the report simply don't show my data of my db. I will try to pass the how I did step by step: 1 - new report in my project 2 - choice the template, define the name and finished. 3 - in the band summary I drag and drop the pallette table 4 - after customizing the table I click in the button of "Dataset and Query dialog" 5 - in this screen I put the "SELECT * FROM my_table" 6 - in this same screen I choice parameters button to create my parameters. 7 - I click in add button and edit button 8 - in the screen opened I type the name of my parameter in the field name 9 - and ok button to create the parameter. A|fter to create the parameters I open the "Dataset and Query dialog" again and I complete the mysql select with my parameters: "SELECT * FROM mytable WHERE colA = $P{paramCmpA} AND colB = $P{paramCmpB} AND colC = $P{paramCmpC}" I'll say agai my report is generated with blank page. I googled and don't find any reference of jaspersoft table with parameters. Thanks in advanced for any assistance.
  4. I believe I was not very clear in my explanation of the problem, I will explain the problem again. I created my report using the fonts of jaspersoft for example Sans Serif, after created the reports I copied my jrxml files to my netbeans project and then I create the war file of my application, this war file was deployed in tomcat web server wich is installed on Debian OS where is my ec2 instance of aws. I don't have problem with fonts in jaspersoft I have problem when I try to call my reports in the browser, when I call my reports in my localhost the reports is generated fine. Thanks.
  5. I created a report in jaspersoft, I've an application in java that execute this report, my application run on linux debian the problem is that I am receiving error of fontconfig. I did the installation of libconfig1 in my linux but the problem still ocurring, what I must to do to fix this error?
  6. when was occured this problem I find your answer in this link https://community.jaspersoft.com/questions/960276/netsfjasperreportsengineutiljrloaderloadobject I changed to loadObjectFromFile but the problem still the same.
  7. Sorry, I wrong title question. My problem is: "java.lang.NoSuchMethodError: net.sf.jasperreports.engine.util.JRLoader.loadObjectFromFile(Ljava/lang/String;)Ljava/lang/Object;"
  8. Hi, trying to create a report using jasperstudio I created an new servlet, but my problem still the same. I have find this servlet in Youtube site but I'm getting an erro. Above my Servlet: /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.itc_systems_web_mw0; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.util.HashMap; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.JasperRunManager; import net.sf.jasperreports.engine.util.JRLoader; /** * * @author Cezar Apulchro */ public class ListAgendaEletro_S05 extends HttpServlet { public Connection conectar; /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { geraRelatorio(request, response); } catch (JRException ex) { Logger.getLogger(ListAgendaEletro_S05.class.getName()).log(Level.SEVERE, null, ex); } } protected void geraRelatorio(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, JRException { String erro = ""; String dataexame = null; String pathJasper = getServletContext().getRealPath("/WEB-INF/Reports/ListEletro_P63.jasper"); File arquivo = new File(pathJasper); HashMap<String, Object> parameters = new HashMap<String, Object>(); byte[] bytes = null; ServletContext contexto = getServletContext(); dataexame = request.getParameter("dtaagenda"); parameters.put("paramData", dataexame); try { JasperReport relatorio = (JasperReport) JRLoader.loadObjectFromFile( contexto.getRealPath(pathJasper)); bytes = JasperRunManager.runReportToPdf(relatorio, parameters, conectar); } catch (JRException e) { erro = e.getMessage(); System.out.println("Erro: " + erro); } finally { if (bytes != null) { response.setContentType("application/pdf"); response.setContentLength(bytes.length); ServletOutputStream outStream = response.getOutputStream(); outStream.write(bytes); outStream.flush(); outStream.close(); } else { RequestDispatcher reqDisp = request.getRequestDispatcher("Agenda_Eletro_WM01.jsp"); request.setAttribute("Erro: ", erro); reqDisp.forward(request, response); } } } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> } And the error: java.lang.NoSuchMethodError: net.sf.jasperreports.engine.util.JRLoader.loadObjectFromFile(Ljava/lang/String;)Ljava/lang/Object; at com.itc_systems_web_mw0.ListAgendaEletro_S05.geraRelatorio(ListAgendaEletro_S05.java:104) at com.itc_systems_web_mw0.ListAgendaEletro_S05.doPost(ListAgendaEletro_S05.java:79) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283) at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) at java.lang.Thread.run(Thread.java:748) Environment: IDE: Netbeans 8.2 Server: Glassfish 4.1.1 Repository Maven Thanks in advance. Cezar Apulchro
  9. Hi, I have created a new report in JasperSoft Studio, now I have defined mysql db as source data. When I press preview button, all my fields defined in my sql "SELECT" are show in the manner that I need. But the error now is: " java.lang.ClassCastException: cannot assign instance of net.sf.jasperreports.engine.base.JRBaseStaticText to field net.sf.jasperreports.engine.base.JRBaseParagraph.paragraphContainer of type net.sf.jasperreports.engine.JRParagraphContainer in instance of net.sf.jasperreports.engine.base.JRBaseParagraph" I can't understend what happen, I'm totally lost.
  10. Your last contact you say, seems to be missing pring-beans artifact. I believe that is my problem. when I have created desktop reports using ireports I have defined the path of my bean class. in jaspersoft studio I can't define the path of my bean class. I'm defining the fields by 'add' and 'edit' button in 'java bean' of Dataset and Query Dialog screen. Is right?
  11. After removing org.springframework.beans-3.1.2.release and spring-core-1.0.2 I'm getting java.lang.ClassNotFoundException: org.springframework.beans.factory.support.BeanDefinitionRegistry In my jasperreport I have defined the fields Nome, Sexo, data_Nascimento, telefone_Residencial and these fields are defined in "Dataset and Query Dialog" too. My report is very simple, these fields, title and one field of parameter to receive date.
  12. Hi hozawa, thank you for your assistance. After change the version of jar I'm getting a new error that is: "java.lang.NoClassDefFoundError: org/springframework/beans/factory/support/BeanDefinitionRegistry"
  13. I saw in the internet forums that this problem is some libs out off classpath then I have set up the classpath, below is my libs: jasperreport-6.7.0.jar jasperreport-fonts-6.7.0.jar jasperreport-javaflow-6.7.0.jar this first 3 libs was downloaded from jaspersoft site, "jasperreport library", the next libs was downloaded by search in the internet forums because the ocurred errors. classmate-0.8.0.jar commons-annotations-1.0.0.jar commons-beanutils-1.9.2.jar commons-collections-20040616.jar commons-collections-3.2.1.jar commons-dbcp-1.2.2.jar commons-fileuplod-1.3.jar commons-io-2.4.jar commons-logging-1.2.1.1.jar commons-math-1.0.jar commons-pool-1.6.jar commons-digester3-3.2.jar The last lib was downloaded by http://commons.apache.org/proper/commons-digester/download_digester.cgi how JasperReports Ultimate Guide say, but my problem still the same. Who can help me. Thanks in advance. Cezar Apulchro. My class: public class GeradorDeRelatorios { public void geraPDF(String reportLoc, Map parametros, OutputStream saida) throws JRException { try { JasperReport jasper = JasperCompileManager.compileReport(reportLoc); JasperPrint printR = JasperFillManager.fillReport(jasper, parametros, new JREmptyDataSource()); JRExporter exporter = new JRPdfExporter(); JasperExportManager.exportReportToPdfStream(printR, saida); exporter.exportReport(); } catch(JRException e) { throw new RuntimeException("Erro ao gerar relatório", e); } } } My servlet: protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { botaoacao = request.getParameter("acaobotao"); Map parametros = new HashMap(); if("LstEletro".equals(botaoacao)) { try { PacientesDAO_W01 pcdao = new PacientesDAO_W01(); DadosPaciente dpaciente = new DadosPaciente(); dpaciente = pcdao.lstEletroDia(); sendNome = dpaciente.getNome(); sendSexo = dpaciente.getSexo(); sendDNascimento = dpaciente.getData_Nascimento(); sendTelefone = dpaciente.getTelefone_Residencial(); System.out.println("Nome: " + sendNome); parametros.put("Nome", sendNome); parametros.put("Sexo", sendSexo); parametros.put("data_Nascimento", sendDNascimento); parametros.put("telefone_Residencial", sendTelefone); } catch (Exception e) { e.printStackTrace(); } } ServletContext context = getServletContext(); String reportLoc = "/ITCWEB/ListAgenda_Eletro_W001.jrxml"; GeradorDeRelatorios geraPDF = new GeradorDeRelatorios(); try { geraPDF.geraPDF(reportLoc, parametros, response.getOutputStream()); } catch (JRException ex) { Logger.getLogger(ListAgenda_Eletro_S002.class.getName()).log(Level.SEVERE, null, ex); } }
×
×
  • Create New...