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

walmillard

Members
  • Posts

    49
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by walmillard

  1. If you want to print all the <det> level data you would set your xpath to/order/det/det

    or ./order/det

    nItem is an attribute of <det>. so to inspect it you need to use @nItem

    eg  ./oder/det[@nItem != null]

    luck

    W



    Post Edited by walmillard at 03/07/2011 23:02
  2. Do you know the Condition ahead of time or is it based on the data?

    Each report data element (inc subreports) have a "print when expression" that have be set to a Boolean condition to include or exclude the element from the report.

    Boolean.TRUE will print it Boolean.FALSE will exclude it.

    the code will print $F{MyField} only when it has the value 1.

    Post some example data?

    Code:


    Post Edited by walmillard at 01/31/2011 05:20
  3. If you set the background colour of all the objects you are printing to a colour you can see, you should be able to run the report again and see which object is causing the page break. Once you find the object it should just be a matter of resizing it so it dosent cause a blank page.

    GL

    W



    Post Edited by walmillard at 01/30/2011 23:52
  4.  

    Your output table is unclear.

    However if you Group the elements you want to print it should be quite ezy to print the attributes of each person in squad order.

    You could set your xml datasource to /teams/squad/person

    Then have Squad "name" with a description of ../@name

    and have person "name with a description of /@name and the other attributes "field1" "field" and "field" are defined similarly.

    Set the Group Expression to the name field of the respective element.

    If you want to print all the duplicated data in the example then it may be a bit more tricky

     

    W

     

  5. Are you embedding the <style> tags or are you setting the font properties using the ireport controls? ie

    Attention <style pdfFontName="Helvetica-Bold">Customers</style>

    will print "Customers" in Helvetice-Bold regardless of the iReport font settings used to print Attention.

    ensure you have the "Is styled text" setting checked.

    Note also that "MS Windows" fonts are slightly astray from other platforms.

    luck

  6. You might find if you set your $P{} "Default Value Expression" value to your test path so that it will, when combined with the string part make up the whole absolute path correctly the right clicking will work.

     

    iReport will check the file name given in the subreport expression with the relative root of the master report then with the absolute path of the master report. Becuase you use a sundirectory in the string part (of the path to your subreport) this will fail in your case.

     

    i use a similar expression however my $P{} is the whole path. so while you may need something like

    "c:\\projects" (or what ever comes before "/templates") to make an absolute path.

     

    i only need an empty string ie "" and iReport finds my subs.

     

    luck!

     

    ALSO NOTE "\\" is the delimited MS Windows separator "\" or backslash. You may need to check that if you are running on Non Windows OS.

     



    Post Edited by walmillard at 09/29/2009 02:18



    Post Edited by walmillard at 09/29/2009 02:19



    Post Edited by walmillard at 09/29/2009 02:23
  7. You could, if they are mutually exclusive print them like this.

    $F{Address}!=null?$F{Address}:$F{Addr}

    this will print Address if it is not null otherwise it will print $F{Addr}.

     

    Your report must know when datasource1 is active? You could also use a varable or a parameter to swap the fields withing the element.

    ie $V{DS1}.booleanValue()?$F{Address}:$F{Addr}

    DS1 is set to TRUE when you have Datasource1 active. You would need some logic to set this.

     

    Also you could have a variable $V{THE_ADDRESS} then assign it something like this...

    $F{Address}!=null?$F{Address}:$F{Addr}!=null?$F{Addr}:null

    then just use the $V{THE_ADDRESS} on your report. NOTE if they are both null u will still get a null.

    Ofcourse if your SQL returns a value into $F{Address} or $F{Addr} that is not a vaild addres, and is not null either, then you will need to check for that content instead of null... say when its an empty string.

     

    luck!



    Post Edited by walmillard at 09/29/2009 00:12



    Post Edited by walmillard at 09/29/2009 00:13
  8. Try adding a null condition to the output... in the case below the Field element will print the value of the COMP varable in case of CAT_PERC_1 == null

    $V{CAT_PERC_1}==null? new Double($V{COMP_PERC_1}.doubleValue()): new Double($V{COMP_PERC_1}.doubleValue() + $V{CAT_PERC_1}.doubleValue())

    Luck!

    Code:
    $V{CAT_PERC_1}==null? new Double($V{COMP_PERC_1}.doubleValue()): new Double($V{COMP_PERC_1}.doubleValue() + $V{CAT_PERC_1}.doubleValue())
  9. I have a Field CustomerName that contains an & character which is delimted in the XML data to & The CustomerName data displays correctly in the report EXCEPT when it is printed as part of a <style> tag set. IE

    "<style pdfFontName=\"Helvetica-Bold\">Customer : </style>" + $F{CustomerName}

    The Customer Data prints ok including the &. But then the <style> tags etc are visible in the report. Its almost like the & breaks the <style></style> tag set?

    The Field on the report has the "Is Styled Text" box checked. But makes no difference.

    Removing the <Style> tags all prints OK. See attached. the xPath for the xml data file is /data

    I have posted in the iReport forum those guys sent me here.

    Thx

    WalMillard

    Code:
    "<style pdfFontName=\"Helvetica-Bold\">Customer : </style>" + $F{CustomerName}
  10. Here are my files. the xml xPath is /data

    as u can see the green field breaks the <style></style> tags when the "&" field follows.

    will post over in the other forum.

    Cheers

    Walmillard



    Post Edited by walmillard at 09/23/2009 01:00
  11. I am wondering if this (bug??) has been addressed:

    I have a Field CustomerName that contains an & character which is delimted in the XML data to & The CustomerName data displays correctly in the report EXCEPT when it is printed as part of a <style> tag set. IE

    "<style pdfFontName=\"Helvetica-Bold\">Customer : </style>" + $F{CustomerName}

    The Customer Data prints ok including the &. But then the <style> tags etc are visible in the report. Its almost like the & breaks the <style></style> tag set?

    The Field on the report has the "Is Styled Text" box checked. But makes no difference.

    Removing the <Style> tags all prints OK.

     

    Code:

    I get an Error on "Filling Report" which is:

    [Fatal Error] :1:73: The entity name must immediately follow the '&' in the entity reference.

    Perhaps it is in my Jasper lib not in iReport?

    [edit] Simply checking the " Is Syled Text " box will cause the Fatal Error!

     

     



    Post Edited by walmillard at 09/22/2009 05:29



    Post Edited by walmillard at 09/22/2009 06:19
  12. Check the "Evaluation Time" of the field.

    also if your xml data is /some/data/name and the other names are in /some/other/name then u have a deeper issue. You might want to post some files? .jrxml and .xml data?

    Luck!



    Post Edited by walmillard at 09/17/2009 05:09
  13. Each Field element has an "Evaluation Time" property that will determin the value printed. The classic example is PAGE_NUMBER.

    If you have 2 fields Both Printing PAGE_NUMBER you set one to "Now" to print the current page and the other to "Report" to print the total number of pages hence you can print

    Page 1 of 100

    using the same variable with different evaluation times.

    So you would need to declare variables to hold the current page and total and set the "Reset Type" then use these in your evaluation. Sould be doable.

    Also the "summary" band prints once as the last page of a report.

    Luck!

  14. If your page is white and the elements on your page a all white it is impossible to determin where the limit of the element boundry is and where the text within the element finishes. Setting the bacground color of the Static text elements and/or Field elements that are on your report you will see EXACTLY where each is finishing and where each break a page.

    You can also change the size and shape of the Field elements. Add some Bands to the report and set the "Split Allowed" properties to reflect where you report elements should be grouped and where they should all break into a new page together.

    Luck

     

  15. This is standard Java "In Line" IF THEN ELSE Statement

    The syntax is

    IF Condition ? Eval to TRUE : Eval to FALSE

    The key parts are the "?" and the ":" Question Mark after the Boolean condition. Colon between the TRUE/FALSE results.

    You can also nest these statements together eg

    IF Condition1 ? Result 1 TRUE : IF Condition 2 ? Result 2 TRUE : Result 3 FALSE

    In anser to your Question you need ELSE! add : and a False result.

    $F{TR}!=43?$F{Product}:F${TR}

    You may need to structure your Logic to account for BOTH true and false results.

    Luck!

  16. "NULL" is a String. null is the Java unassigned object. IF youre field is a Booelan Try this

    $F{BooleanFoo} == null?Boolean.TRUE:$F{BooleanFoo} == Boolean.TRUE?Boolean.TRUE:Boolean.FALSE

    If you want the null to be Boolean.FALSE then you need to change the Boolean.TRUE to Boolean.FALSE

    if the field is null you will get a true in lowercase in the field.

    If you have a string use this:

    $F{BooleanFoo} == null?"Boolean is TRUE":$F{BooleanFoo} == Boolean.TRUE?"Boolean is also TRUE":"Boolean is FALSE"

    if you have uppercase String NULL in the field or the dataset is returning this uppercase String as null then you need to change the IF condition to "NULL" ie

    $F{BooleanFoo} == "NULL"?...

    However if this is the case $F{BooleanFoo} will need to be declared as Type String in your report Field list.

    Luck!

     

  17. You might find that if you set the background color of the objects you are printing so you can clearly see which are causing the page metics to error. You might find there is some white space that is wrapping the page in error.

    Post some files?

  18. If the new Date() function returns the users current date/time then you can use the gettimezoneOffset() function to convert it. Otherwise pass a date opject as a parameter from your server to the (client) report.

    Java.util.TimeZone

    To get the GMT offset you can use an expression like :

    "Time Zone : " + new Date().getTimezoneOffset()

    Luck!

  19. Are you are Passing the system REPORT_COUNT in your subereport to a Parameter or Variable declared in your sunreport and then passing that value back to your master report? some things to check...

    I suggest you first add a Field object to your subreport and print that count value so you can see that the actual count number is correct/what you are expecting.

    Add another Field to your Master report as the result parameter/Varable to ensure that the number returning from the subreport is the same.

    Then you may need to check the "Evaluation Time" property of the return parameter and the Reset Type on the Varable as this can determine the result.

    Also you may want to check that you are not trying to determine the value of the return value before the subreport has set it.

    Luck!

  20. In your subreport open the properties of the $F{CONNECTION_NAME} element within the Detail band and change the "Evaluation Time" property to "Now".

    Should fix it

    Luck!

     



    Post Edited by walmillard at 09/11/2009 02:29
×
×
  • Create New...