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

miguelcadavieco

Members
  • Posts

    3
  • Joined

  • Last visited

miguelcadavieco'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. hi again, my new problem is the next: I try to send a paramater to a simple report and I can't. This is my report <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="contenedor" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="0" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <parameter name="PARAM_PRUEBA" isForPrompting="false" class="java.lang.String"> <defaultValueExpression ><![CDATA[new String ("vaya mierda")]]></defaultValueExpression> </parameter> <field name="PARAM_PRUEBA" class="java.lang.String"/> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="0" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="700" isSplitAllowed="true" > <staticText> <reportElement x="17" y="173" width="272" height="65" key="staticText-1"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Justified" verticalAlignment="Middle"> <font size="36" isBold="false"/> </textElement> <text><![CDATA[MI PRUEBA]]></text> </staticText> <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Opaque" x="15" y="245" width="76" height="12" key="textField-1"/> <box topBorder="1Point" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" bottomBorder="1Point" bottomBorderColor="#000000"/> <textElement> <font size="8" isBold="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{PARAM_PRUEBA}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="0" isSplitAllowed="true" > </band> </summary> </jasperReport> and this is my java source code. I include this code into a jdeveloper servlet JasperReport miReport; JasperReport otroReport; JasperPrint jasperPrint; Map masterParams = new HashMap(); try { miReport = JasperCompileManager.compileReport("Y:\Web\webProject\Modelos\servletJasper\public_html\WEB-INF\reports\contenedor.jrxml"); otroReport = JasperCompileManager.compileReport("Y:\Web\webProject\Modelos\servletJasper\public_html\WEB-INF\reports\report1.jrxml"); String Prueba="hola"; masterParams.put("PARAM_PRUEBA",Prueba); jasperPrint = JasperFillManager.fillReport(miReport,masterParams,new JREmptyDataSource()); byte[] pdfasbytes = JasperExportManager.exportReportToPdf(jasperPrint); ServletOutputStream outstream = response.getOutputStream(); response.setContentType("application/pdf"); response.setContentLength(pdfasbytes.length); response.setHeader("Content-disposition", "inline; filename="Report.pdf""); outstream.write(pdfasbytes); JasperExportManager.exportReportToPdfFile(jasperPrint, "Y:\Web\webProject\Modelos\servletJasper\public_html\WEB-INF\reports\simple_report.pdf"); } catch (JRException e) { e.printStackTrace(); } } Some idea: I reades the tutorial, the examples and It's simple...but i can't send a parameter to my master report. One more thing: I saw the pdf file into the web browser but don't send the parameters
  2. hello, I'm a new user of the Ireports 1.3.0 IDE and I found a lot of problems to create a report with two o more pages. I read some examples to make a report with a DB connections but the thing that I want it's simple: I have a report template and need to triplicate this report with the same files and different title, all in an unique report...I'm desperate. Some help?
  3. hello, I'm a new user of the Ireports 1.3.0 IDE and I found a lot of problems to create a report with two o more pages. I read some examples to make a report with a DB connections but the thing that I want it's simple: I have a report template and need to triplicate this report with the same files and different title, all in an unique report...I'm desperate. Some help?
×
×
  • Create New...