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

Javix

Members
  • Posts

    17
  • Joined

  • Last visited

Recent Profile Visitors

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

Javix'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. Is it possible a report to have 1 page in portrait and the other one in Landscape ? I searched everywhere and tried all possible solutions with a subreport, but it doesn't work as I would like to.
  2. Hi, I changed the detail section size for zero. I put 2 group headers(see the attached jrxml file). But: 1. Even in this case I'm still limited in page size(A4). 2. Even if when creating the second group I checked "Start on new page" check box, my second group never starts on the new page. I am asking myself what is that check box for if it does nothing??? 3. Event if change the report page height manually in the jrxml file (1600 for ex.), it makes just my page longer but doesn't put a page break that I woulf like to. Any suggestions, Admin ? Thank you in advance.
  3. I changed manually the details section height value in the jrxml file. In this case I got an error(of course, it was expected, because I didn't change the page margins): Code: net.sf.jasperreports.engine.design.JRValidationException: Report design not valid : 1. The detail section, the page and column headers and footers and the margins do not fit the page height. at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:260) at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:144) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:220) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:153) So I don't see any solution for the problem. And you, Admin ?
  4. Ok, than you very much for your help. You know, I tried iText by Lowagie and it makes it possible to insert a new empty page where ever you want: Code: writer.setPageEmpty(ignore_empty); document.newPage(); writer.setPageEmpty(ignore_empty); document.newPage(); document.add(new Paragraph("Hello World"«»)); document.newPage(); writer.setPageEmpty(ignore_empty); document.newPage(); By default, to start a new page([document.newPage()] iText checks the value of 'ignore_empty' variable, - true by default). If we set it to false, a new empty page will be created. I know that it is a little different. Nevertheless it works fine. JasperReports includes iText.jar. Why not use the same technics? Post edited by: Javix, at: 2007/12/14 11:18 Post edited by: Javix, at: 2007/12/14 11:20
  5. I knew that it was running fine in uReport. My task is to get this report on 2 pages. Just for that example I put not enough text in the repport. But in reality, just try to add some more static text elements in the space available, you will never get it on 2 pages. If I put a page break via Menu 'edit-insert page break', it will just insert a page break element in the details section without giving any possibility to enlarge it. That is what I don't understand. Either I should replace al my static text elements by text field elements (dynamic) and indicate them as streched, and in this case iReport will add a new page if there is not enough space, either there is another solution that I don't know.
  6. OK, I am sending you my jrxml file (attached). Thank you. [file name=test-30ca6871886eaa70f466b152752b3015.jrxml size=5725]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/test-30ca6871886eaa70f466b152752b3015.jrxml[/file]
  7. I tried the section "Bands larger than one page" of the urlyou had posted. I tried it. I didn't understand. I created an empty document in iReport. I reduced for zero all the sections besides 'details'.Than I added 2 groups: page1group and page2group. For the second group (page2group)I checked the option "Start on a new page". As there is no condition to start a group, I put nothing. I reduced the "details" section for the minimum. Just to test if it works I added some static texts to both groups. But I was always limited to drag any of the groups to get it longer. iReport always checked the page (A4 in my case) size and didn't allow me to get it longer. As result - I got everything on the only page, of course. What did I wrong ?
  8. Hi Admin! I seached for a long time to solve this problem but none of the solutions proposed on the forum worked. I need to print a type letter that MUST always have 2 pages. If I insert a page break on the first page I don't have enough space to put all the elements of the second page, because the I cannot drag any longer the detail section of the first page. How can I do that, please. There is no condition to begin the second page, just some part of the letter text must be on the 1st page and some on the 2nd one.
  9. As I use a standard A4 letter size, my report margins hava already ben set. And in this case you can get the details section longer until the max size (height) of the letter. It is no more possible to drag it down!:( And I should have 2 identical pages A4.
  10. I've already tried this. It works. But I don't have enough space in the details section (of the 1-st page where the page break cross-line was put) for my text elements to be put on the 2-nd page. It's not possible to get it longer. How can I do?
  11. Hi, but I didn't understand at all what you mean, may be you use an automatic language translator?;) So, I'll explain it again in more details. I would like to prepare a template to be used for standard letters I'll address to clients. And this letter must always have 2 pages(that is the desire of my client for the formatting). That's why no need to talk about title, summary or anything else. Best regards, Hope someone will help me to resolve this problem. Post edited by: Javix, at: 2007/12/13 07:41
  12. I need to have to my report on 2 pages. How can I do it, please. I've already tried to use: 1.a subreport(in this case I understand nothing, how to do, etc.). 2.Via a menu option 'Edit-Insert page/column break in my report. But in this case I don't have enogh space to add my report components because the only page that I have is not long enough. Thank you!
  13. Thanks a lot, it works!!!:) It's a pitty that there is nothing explained of that in the book.
  14. I found a solution. You should do like this: Code: $F{receiverStreet} + " " + ($F{receiverHouseBox}!=null? $F{receiverHouseBox}:""«»)
  15. Hi everyone! I use JasperReports 2.0.2 and I tried to use a scriplet example from the book to set a variable value like this: Code: public class TestScriplet extends JRDefaultScriptlet { /* * (non-Javadoc) * * @see net.sf.jasperreports.engine.JRDefaultScriptlet#afterReportInit() */ public void afterReportInit() throws JRScriptletException { setVariableValue("someVar", new String( "This value was modified by the Scripet"«»)); } } My jrxml file: Code:[code] <?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="testScriplet" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" scriptletClass="scriplets.TestScriplet" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="2" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <variable name="someVar" class="java.lang.String" resetType="Report" calculation="Nothing"> <initialValueExpression><![CDATA["This is the initial variable value"]]></initialValueExpression> </variable> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="50" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="50" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="30" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="100" isSplitAllowed="true" > <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="60" y="20" width="440" height="20" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$V{someVar}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="30" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="50" isSplitAllowed="true" > </band> </pageFooter> <lastPageFooter> <band height="50" isSplitAllowed="true" > </band> </lastPageFooter> <summary> <band height="50" isSplitAllowed="true" > </band> </summary> </jasperReport> And my main class: Code:[code] package generation; 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; public class FirstReportExportPDF { /** * @param args */ public static void main(String[] args) { JasperReport jasperReport; JasperPrint jasperPrint; try { jasperReport = JasperCompileManager .compileReport("src/mail/testScriplet.xml"«»); jasperPrint = JasperFillManager.fillReport(jasperReport, null, new JREmptyDataSource()); JasperExportManager.exportReportToPdfFile(jasperPrint, "src/reports/scripletReport.pdf"«»); System.out.println("Done !"«»); } catch (JRException e) { e.printStackTrace(); } } } And why in my report the variable "someVar" is null ??:S
×
×
  • Create New...