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

andrey87

Members
  • Posts

    4
  • Joined

  • Last visited

andrey87'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. Is it possible to assign a parameter value or a field value to the "backcolor" tag? I don't want to set a static color to my conditional style, but I receive the color from Java/database (I can pass it to the report as parameter or as field). Like this (see backcolor tag): <conditionalStyle> <conditionExpression><![CDATA[$P{valutazioneLibretto}.equals("CRITICA")]]></conditionExpression> <style mode="Opaque" backcolor=$F{myDTO}.getColor1()/> </conditionalStyle> Instead of: <style mode="Opaque" backcolor="FF00FF"/>
  2. Hello, I use the STS IDE Version: 3.9.2.RELEASE and I have installed the Jaspersoft Studio feature 6.5.1.final. When I open a .jrxml file, in the "Progress" panel of STS IDE I see a lot of process of "Finding Data Adapter". I try to close them, but they re-appear after some minutes. I don't use any data adapter in my reports (I always use the One Empty Record option). This causes a stoppage of the IDE and in some cases it causes a crash. Can I avoid this? Thanks a lot, Andrea
  3. Hello, I've designed 3 simple reports (one main report, and two subreports) with Jaspersoft Studio feature into Eclipse. Each report contains only one static text field (they have not any connection to a database). The main report contains a static text field and contains the others two sub reports. Very simple situation. This is my code: package it.jasperreports.test; import java.util.HashMap; import net.sf.jasperreports.engine.JREmptyDataSource; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperCompileManager; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.design.JasperDesign; import net.sf.jasperreports.engine.xml.JRXmlLoader; public class RunApp { // Path of main .jrxml report private final static String JRXML = "C:/ws/Test_JasperReports/src/main/java/it/jasperreports/test/report.jrxml"; // Paths of .jrxml subreports private final static String JRXML_SUB1 = "C:/ws/Test_JasperReports/src/main/java/it/jasperreports/test/subreport1.jrxml"; private final static String JRXML_SUB2 = "C:/ws/Test_JasperReports/src/main/java/it/jasperreports/test/subreport2.jrxml"; // Path of PDF output private final static String PDF = "C:/ws/Test_JasperReports/src/main/java/it/jasperreports/test/report.pdf"; public static void main(String[] args) { try { JasperDesign design = JRXmlLoader.load(JRXML); // Load in memory of the main report design JasperReport report = JasperCompileManager.compileReport(design); // Compiling the main report design into a report JasperPrint print = JasperFillManager.fillReport(report, new HashMap<>(), new JREmptyDataSource()); // Filling the report JasperExportManager.exportReportToPdfFile(print, PDF); // Exporting the report into PDF } catch (JRException e) { e.printStackTrace(); } } } When I run the code, I've this error (when the instruction JasperPrint print = JasperFillManager.fillReport is executed): net.sf.jasperreports.engine.JRException: Resource not found at: src/main/java/it/jasperreports/test/subreport1.jasper. at net.sf.jasperreports.repo.RepositoryUtil.getResourceFromLocation(RepositoryUtil.java:153) at net.sf.jasperreports.repo.RepositoryUtil.getReport(RepositoryUtil.java:112) at net.sf.jasperreports.engine.fill.JRFillSubreport.loadReport(JRFillSubreport.java:398) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateReport(JRFillSubreport.java:365) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:427) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:341) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:381) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:500) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2022) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:748) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:255) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:115) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:582) at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:414) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:121) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:983) at it.jasperreports.test.RunApp.main(RunApp.java:30) I think I've this error because the .jasper files of two subreports not exist; in fact if I try to compile the two subreports with Jaspersoft Studio, the .jasper are created and I have not the error. It could be possible to do the compilation of subreports at run-time? And, in some cases I could have only one subreport, in other cases more report: it could be possible to retrieve at run-time the list of subreports and compile them? Is it mandatory to have the physical subreports .jasper files or is it possible to compile them in memory and pass them to main report? Any idea? Thanks and regards, Andrea
×
×
  • Create New...