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

zilex

Members
  • Posts

    3
  • Joined

  • Last visited

zilex's Achievements

Newbie

Newbie (1/14)

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

Recent Badges

0

Reputation

  1. Thank you so much, this was killing me for hours, couldn't even pinpoint that the problem was in the variables
  2. I solved this by setting all components in column header their "key" property like this "header1","header2","header3" etc... In detail band I set one component which I know for sure that will be shown "key" property= "detailExsists" Then in java code when I get JasperPrint object I iterate all objects on every page and check if there is a component which "key" property is "detailExists", if I don't find it that means that there is no detail on this page and I remove all components with "key" properties "header1","header2" etc... from that page. This method still takes space for the page header band (its height) but it at least it's empty... Here's my code: JasperPrint report = myPrint; boolean detailFound = false; for (Iterator<JRPrintPage> i = report.getPages().iterator(); i .hasNext();) { detailFound = false; JRPrintPage page = i.next(); for (Object o : page.getElements()) { JRPrintElement element = (JRPrintElement) o; if (element.getKey() != null && element.getKey().contains("detailExists")) detailFound = true; } if (!detailFound) { Iterator<Object> itt = page.getElements().iterator(); while (itt.hasNext()) { JRPrintElement element = (JRPrintElement) itt.next(); if (element.getKey() != null && element.getKey().contains("header")) { itt.remove(); } } } Post Edited by zilex at 05/21/2012 10:17 Post Edited by zilex at 07/07/2012 08:35
  3. Hello everyone, I have one problem, I'm getting some text into a textfield via parameter, the problem is that textfield doesn't respect carriage returns inserted in text, I tried setting textfield markup to html and then putting this in textField's value "$P{value}.replaceAll("\n","<br>")" or "$P{value}.replaceAll(System.getProperty("line.separator"),"<br>")" but it doesn't detect any line.separators.. Edit... I figured it out, there really was no line separators in parameter value, since there was ".replaceAll("\n"," ")" in java class from which the parameter was sent... Solved... Post Edited by zilex at 02/20/2012 14:23
×
×
  • Create New...