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

diegoqueres

Members
  • Posts

    13
  • Joined

  • Last visited

diegoqueres's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. I'm developing a Jasper Report to be exported to Excel file. I have an image on one column and text data on anothers columns. I have to lock or embed a picture into a cell on XLS Jasper. I put follow properties on JRXML: <property name="net.sf.jasperreports.export.xls.ignore.graphics" value="false"/><property name="net.sf.jasperreports.export.xls.image.anchor.type" value="MoveSize"/>[/code]I put an auto-filter too. After, i generated the exported Excel file... When I'm trying to filter or alphabetize by name column, image does not follow the information in the row (see excel file on this link: Excel File Exported in Jasper Studio). I use Jasper Studio 6.4. How can i solve this problem?
  2. I'm developing a Jasper Report to be exported to Excel file. I have an image on one column and text data on anothers columns. I have to lock or embed a picture into a cell on XLS Jasper. I put follow properties on JRXML: <property name="net.sf.jasperreports.export.xls.ignore.graphics" value="false"/> <property name="net.sf.jasperreports.export.xls.image.anchor.type" value="MoveSize"/> I put an auto-filter too. After, i generated the exported Excel file... When I'm trying to filter or alphabetize by name column, image does not follow the information in the row (see excel file on this link: Excel File Exported in Jasper Studio). I use Jasper Studio 6.4. How can i solve this problem?
  3. I have customers from many countries, and for each one I need to generate a page with data on it. In my report I have a similar query: SELECT Name, Address, CodLanguage ... FROM Customers For each record of this query, I want to generate a page in Jasper Reports with customer data in their respective language (I know its language through this flag CodLanguage).I want change report language for each customer page (each record). Can i do this using report parameter locale? Or changing some variable for each record? Has anyone had a similar situation? Have any idea what can be done? Thanks!
  4. I have a subreport in my main report. This is in the detail band.The problem is it only runs for the first record of the main report. I wish it run for all records of detail band.To run it, I transfer 1 sql query parameter that feeds the detail band. In the pages of the first record, it appears, as shown in the image below: In the pages of the subsequent records, it does not perform or does not return data (I can not say).As the image below: This is the main report jrxml:<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.1.1.final using JasperReports Library version 6.1.1 --><!-- 2016-09-26T11:09:48 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="1350" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="511" leftMargin="42" rightMargin="42" topMargin="71" bottomMargin="71" uuid="55ddfd1b-0389-4716-a115-0b6966f4bd05"><property name="net.sf.jasperreports.export.xml.start.page.index" value="1"/><property name="net.sf.jasperreports.export.xml.end.page.index" value="2"/><property name="com.jaspersoft.studio.data.sql.tables" value=""/><property name="com.jaspersoft.studio.unit." value="pixel"/><property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/><property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/><property name="com.jaspersoft.studio.unit.topMargin" value="cm"/><property name="com.jaspersoft.studio.unit.bottomMargin" value="cm"/><property name="com.jaspersoft.studio.unit.leftMargin" value="cm"/><property name="com.jaspersoft.studio.unit.rightMargin" value="cm"/><property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/><property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/><property name="com.jaspersoft.studio.data.defaultdataadapter" value="SQLSRV_SQLDEV"/><parameter name="CodCand" class="java.lang.Integer" isForPrompting="false"><parameterDescription><![CDATA[]]></parameterDescription></parameter><parameter name="PAGE_INDEX" class="java.lang.Integer" isForPrompting="false"><defaultValueExpression><![CDATA[1]]></defaultValueExpression></parameter><queryString><![CDATA[ /* QUERY */ ]]></queryString><field name="Cod_cand" class="java.lang.Integer"/><field name="EstadoReg_cand" class="java.lang.Integer"/><field name="Nome_cand" class="java.lang.String"/><field name="Sigla_idiomaNav" class="java.lang.String"/><pageHeader><band height="70" splitType="Stretch"><image><reportElement x="0" y="0" width="110" height="50" uuid="db7d5ce0-2740-4b4a-b84e-d4aacac33ced"/><imageExpression><![CDATA["/home/diego.queres/Desenv/Relatórios Clientes/MyReports/Cafe com leite.JPG"]]></imageExpression></image></band></pageHeader><detail><band height="563" splitType="Stretch"><textField><reportElement x="0" y="10" width="260" height="30" uuid="ff0bc8d6-87d0-4fba-84fe-b3def51ac8f1"/><textElement><font fontName="Arial" size="18"/></textElement><textFieldExpression><![CDATA[$F{Nome_cand}]]></textFieldExpression></textField><textField><reportElement positionType="Float" x="100" y="60" width="160" height="30" uuid="dd77bdb7-560b-4054-88ea-2b14f5032b06"/><textFieldExpression><![CDATA[$F{Sigla_idiomaNav}]]></textFieldExpression></textField><staticText><reportElement positionType="Float" x="0" y="60" width="100" height="30" uuid="2a0e78b4-1fc0-428d-95fa-86c7f8e669a0"/><text><![CDATA[idioma candidato]]></text></staticText><textField isStretchWithOverflow="true"><reportElement positionType="Float" x="100" y="90" width="410" height="40" uuid="54e06bcd-be90-48ca-b861-78b39f55681c"/><textFieldExpression><![CDATA[$F{EstadoReg_cand} + "n" +"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pretium quam non odio cursus viverra. Integer dolor sapien, suscipit quis placerat eget, tincidunt at ipsum. Morbi molestie sit amet tellus non commodo. Donec vel arcu lobortis, bibendum metus vitae, varius leo. Maecenas ultrices nisi id sapien volutpat viverra. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed eget erat non felis tempus sodales in id quam. Proin suscipit porta faucibus. Etiam vitae elit facilisis, pulvinar ipsum at, facilisis ante. Nulla ac mauris erat. Curabitur sit amet metus id metus cursus lacinia eget ut orci. Nullam ornare erat nulla, pretium viverra justo hendrerit ac. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent sed nisl risus. Nulla facilisi." +"n" +"Curabitur sodales finibus arcu at condimentum. Integer at tempor mi, eu euismod dolor. Nulla facilisi. Suspendisse potenti. Nullam feugiat turpis condimentum turpis tempor sagittis. Pellentesque accumsan elementum auctor. Mauris orci dui, convallis id sagittis a, dapibus eget dui. Vivamus sit amet ante id elit malesuada porta non eget dui. Nulla nisi sem, dictum at metus eu, facilisis ornare neque. Pellentesque in lectus vel libero laoreet faucibus vel non odio. Aenean euismod neque eu nisl rutrum fringilla. In nibh enim, sollicitudin ut aliquet sit amet, pulvinar sit amet odio. Duis fringilla, odio eget fermentum eleifend, urna sem volutpat diam, at dictum elit turpis ut mauris. Vivamus rutrum turpis ut ex sodales vulputate." +"n" +"Curabitur laoreet ligula et augue tincidunt pharetra. Fusce finibus non tellus in sollicitudin. Aliquam quis venenatis tellus. Quisque leo erat, rutrum nec ex a, dictum interdum augue. In et tincidunt diam. Sed sagittis nibh id ex laoreet hendrerit. Aliquam non nunc odio. Nam dolor diam, eleifend sit amet enim vel, laoreet tincidunt nibh. Etiam vitae elementum mi. Ut ornare a sapien sit amet congue." +"n" +"Maecenas tempor cursus mauris. Mauris vehicula pharetra scelerisque. Maecenas feugiat justo purus, vel fermentum odio venenatis eu. Aliquam quis libero maximus, convallis odio a, eleifend nisi. Phasellus placerat, nulla ut rutrum sagittis, magna turpis tincidunt nisl, vel mollis libero massa ut arcu. Donec et tincidunt sem, ut pellentesque arcu. Sed laoreet ornare gravida. Nunc mauris mauris, elementum sit amet porttitor vel, feugiat ut sem. Donec ultrices quam mollis blandit facilisis. Morbi mollis semper enim, nec lobortis nisl blandit at. Ut leo magna, maximus ullamcorper finibus et, bibendum ut eros." +"n" +"Nam eros risus, lacinia semper augue sed, interdum dapibus turpis. Mauris placerat iaculis fringilla. Vestibulum ullamcorper nibh et tortor ullamcorper accumsan. In ipsum eros, consectetur non blandit non, eleifend id elit. Suspendisse non bibendum mi. Suspendisse finibus eleifend mauris. Integer rutrum, ex vitae suscipit luctus, sapien erat tincidunt dui, sit amet ultricies magna sem at ligula. Fusce dictum, dolor sed commodo rutrum, eros quam eleifend libero, nec aliquam libero risus vitae ipsum. Vivamus nec libero metus. Mauris volutpat sapien vitae tortor tincidunt semper. Integer aliquet purus a urna dictum, id vehicula ante convallis. Suspendisse dolor velit, volutpat ut mi non, faucibus lobortis nulla. Quisque sed nisi nunc."]]></textFieldExpression></textField><staticText><reportElement positionType="Float" stretchType="RelativeToBandHeight" x="0" y="90" width="100" height="40" uuid="2452709f-be5e-4c5a-bece-c54a03e532f7"/><text><![CDATA[EstadoReg_cand]]></text></staticText><break><reportElement x="0" y="550" width="509" height="1" uuid="cfd93607-c001-4860-8fe5-848979c466ce"/></break><subreport><reportElement positionType="Float" x="100" y="130" width="409" height="70" uuid="e3dea3c0-56e8-42c8-b35c-d74b42d79858"/><subreportParameter name="CodCand"><subreportParameterExpression><![CDATA[$F{Cod_cand}]]></subreportParameterExpression></subreportParameter><connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression><subreportExpression><![CDATA["/home/diego.queres/Desenv/Relatórios Clientes/MyReports/1350-formacoes.jasper"]]></subreportExpression></subreport></band></detail><pageFooter><band height="66" splitType="Stretch"><textField><reportElement x="409" y="36" width="100" height="30" uuid="422e0e4d-35f2-42eb-bfe1-c805991fd470"/><textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression></textField></band></pageFooter></jasperReport>
  5. **PROBLEM SOLUTION** I solved the problem by inserting a variable in the footer of each page with the expression: $V{REPORT_COUNT}, which have record count that is in the Detail Band: After that, the Java program do loop between the pages of JasperPrint object. So, i locate that element that tells me what page belongs to candidate. Based on this information and storing candidate index data and its pages (in a HashMap <Integer, List <Integer >> mapCandPage), I can determine the page that starts and the page ends for each candidate. And that way I can export one document for each candidate record. public static void main(String args[]) throws Exception { File relJasperArqFile = new File("Resume Candidate Template.jasper"); Connection conn = ConnectionFactory.getNewConnectionSQLDRIVER(); JasperReport jasperReport = (JasperReport) JRLoader.loadObject(relJasperArqFile); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, conn); final JRDocxExporter exporter = new JRDocxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); List listPrintPage = jasperPrint.getPages(); int candIdx = 0; int fileIdx = 0; int lastCandIdx = 0; HashMap> mapCandPage = new HashMap(); for (int pageIdx = 0; pageIdx ())); } mapCandPage.get(candIdx).add(pageIdx); if (pageIdx > 0 && candIdx != lastCandIdx) { fileIdx++; exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(new File(String.format("Candidate Resume %d.docx", fileIdx)))); SimpleDocxReportConfiguration configuration = new SimpleDocxReportConfiguration(); configuration.setStartPageIndex(mapCandPage.get(lastCandIdx).get(0)); configuration.setEndPageIndex(mapCandPage.get(lastCandIdx).get(mapCandPage.get(lastCandIdx).size() - 1)); exporter.setConfiguration(configuration); exporter.exportReport(); } lastCandIdx = candIdx; } fileIdx++; exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(new File(String.format("Candidate Resume %d.docx", fileIdx)))); SimpleDocxReportConfiguration configuration = new SimpleDocxReportConfiguration(); configuration.setStartPageIndex(mapCandPage.get(lastCandIdx).get(0)); configuration.setEndPageIndex(mapCandPage.get(lastCandIdx).get(mapCandPage.get(lastCandIdx).size() - 1)); exporter.setConfiguration(configuration); exporter.exportReport(); } public static Integer getCandIdx(JRPrintPage page) { JRPrintElement ultimoRowNumber = page.getElements().get(page.getElements().size() - 1); return Integer.parseInt(((JRTemplatePrintText) ultimoRowNumber).getFullText()); } This is a test and my code is not optimized. If anyone has suggestions or a better idea, please post here. Thank you.
  6. I'm developing a jrxml template for generate job candidate's resume. The candidates are in my database. I need to generate a Word file (.docx) for 1 record (by job candidate), as the image below: How can I make Jasper generate one file for each record of my SQL query? And export these files to Word? I saw there is a parameter called PAGE_INDEX exporter. But I did not find how to use it ... Can someone help me please? Note 1: These reports aren't generated by JasperServer. I developed a Java program to generate them and send reports by email.Note 2: The number of pages for each candidate can be different. Updating status I managed to generate one record per file. But I could only generate the file to the first record. I need to generate other files for the remaining records. I'm still with the another problem too: how to separate into separate files when the number of pages for each record (candidate entity) can change? final JRDocxExporter exporter = new JRDocxExporter(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(new java.io.File("/home/admin/resume candidate.docx"))); SimpleDocxReportConfiguration configuration = new SimpleDocxReportConfiguration(); configuration.setPageIndex(0); exporter.setConfiguration(configuration); exporter.exportReport();[/code]
  7. After many attempts, what I discovered is the Query Editor is limited to read fields if a have a complex stored procedure (like mine). As my procedure uses cursors and dynamically makes a sql query in a string, reading the procedure scheme is hampered by the Query Editor. I decided do the following: print the query SQL to the procedure output (print @sql). Then I cut and paste the query that runs (on the procedure output) in the Query Editor window (instead of the procedure call, "exec procedure ...."). Thus the Query Editor can read the fields of the query. After query editor read fields, I delete the query SQL and insert the procedure call again, "exec procedure ....". Now it worked :-)
  8. I running a sql server procedure in Jasper Reports Studio, but the Query Dialog only show one field. In the SQL SERVER Management Sudio, it works correctly. The procedure returns more than ten fields... Has anyone seen a similar case? What might be happening? Thanks!
  9. Hi Can someone help me please? I have a Line Chart and i set label expression like as follow: JRXML: <categorySeries> ......... <valueExpression><![CDATA[$V{Porcentagem}]]></valueExpression><labelExpression><![CDATA[$V{Porcentagem}.toString() + "%"]]></labelExpression></categorySeries> After that, i created one Customizer Class to create labels on each point (on lines):public class LineChartCustomizer extends JRAbstractChartCustomizer { @Override public void customize(JFreeChart chart, JRChart jasperChart) { CategoryPlot categoryPlot; LineAndShapeRenderer lineAndShapeRenderer; categoryPlot = (CategoryPlot) chart.getPlot(); lineAndShapeRenderer = (LineAndShapeRenderer) categoryPlot.getRenderer(); lineAndShapeRenderer.setBaseItemLabelsVisible(Boolean.TRUE); lineAndShapeRenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); }}[/code] I want it displayed the string configured in LabelExpression. The value followed by "%": 15%, 30% ...But the result is displayed like below: How can I do to get the right result at each point, based in Label Expression?
  10. I put this on setenv.bat file, but didn't fix the problem: set JAVA_HOME=C:JASPER~1JASPER~1.0java set JAVA_OPTS="%JAVA_OPTS% -Duser.language=pt -Duser.region=BR -Duser.country=BR "
  11. When i log in JasperServer, I choose the pt-BR locale (Brazilian Portuguese). The application interface entirely in Portuguese with this action. However, when I request a report, the date format on report view, is appearing with month names in English (January, February...), as shown below: In the report, i use the Format function to display the date on MONTH / YEAR format: <categoryExpression><![CDATA[ DATEFORMAT( $F{Mês},"MMMM/yy" ) ]]></categoryExpression> [/code] How do I fix this problem? How i display the name of the month in Portuguese (Janeiro, Fevereiro, Março)?
  12. We are currently providing PDF generation and that works fine. We want to add a DOCX generation that can easily be modified after generation.The problems we are having with DOCX documents generated with Jasper iReport include: Text not flowing properly (document divided into rows so various items sometimes get clipped or moved when they shouldn't)Elements completely disappear in the generated DOCX if they overlap or overlay another element in iReport. One image field overlapping a Text Field disappear...When will there be a solution to problems like this? As my research the problem is old: I see forums reporting the problem this for 4-5 years ...
  13. For do this with charts, make the follow steps: 1) Create new parameter on sub-dataset to receive the value from main dataset of report. Uncheck "Is for prompting" option; 2) On "Chart Wizard" window, click on "Parameters" button to open window to map the parameters: http://community-static.jaspersoft.com/sites/default/files/images/Jaspersoft%20Studio%20Professional_2014-01-21_09-07-38.png
×
×
  • Create New...