Jump to content

dprogrammer

Members
  • Posts

    171
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Posts posted by dprogrammer

  1. How are you linking the sub-report with the main report? Or you can try:

    -Create a parameter in sub-report, say $P{subResule}

    -Right click sub-report from the main report, go to tab 'Subreport'. Where you will see a button to add a parameter link. There you can link sub-report parameter to main report's field that contains 'Resule' value. Hope this helps.

  2. Easiest way would be to place three texts with three colors (black, orange, and red) on top of each other. Then write a suppression expression (in Print when expression box) for each something like following:

    $F{PCT} is 0 to 50 Boolean.TRUE  (Black)

    $F{PCT} 51 to 75 Boolean.TRUE (Orange)

    $F{PCT} >76 Boolean.TRUE (Red)

  3. Hi,

    Can someone share how are parameters passed from sub-report to master report? I have a variable in sub-report REPORT_COUNT. I want to pass it to main report and use it in an expression. Currently I am doing this but its not working.

    Subreport properties --> Suberport (other) tab--> Subreport return values tab, and linked the REPORT_COUNT variable of subreport with a new declared variable of master report (Destination variable)but the value is coming up blank in master report.

    Thanks in advance.

  4. I don't know why Java is so hard when it comes to type casting. I have few numeric fields of type BigDecimal. When I try to add them together and if one of them is null, the whole total also shows as null. So. I try to evaluate each field before addition like this:

    $F{QTY1}.equals(null)?0:$F{QTY1}

    The error I get is:

    Incompatible conditional operand types int and BigDecimal

    I even tried using:

    $F{QTY1}.intValue().equals(null)?0:$F{QTY1}

    but got error: Cannot invoke equals(null) on the primitive type int

    Any ideas to save my frustration?



    Post Edited by dreporter at 09/02/2009 15:52
  5. Hi everyone,

    I have a main report and a sub-report with a Xtab. I have placed the sub-report in a group header1 section of my main report and I have increased the height of the group header1 section to allow the whole sub-report to print on first page. I have another Group header2 section (second group) on main report. I have enabled 'Start on new page' option on it to force a page break after sub-report.

    Desired:  I want the first page to show only sub-report, if sub-report is empty ,I should see a blank first page. The details section should always print on next page.

    The problem: Currently when sub-report has data, then everything is fine and all things print in their correct sections. But when sub-report is empty, the details from next page print on first page, which I don't want. The page break doesn't seem to be working.

    Question: Is there a way to force a page break after the end of sub-report? OR Is there a way to keep the height of the section which contains sub-report a constant? Kind of it never shrinks?

     Forgot to mention the version of iReport is 1.2. Thanks.



    Post Edited by dreporter at 09/01/2009 15:01
  6. Hi Sedef,

    If you want to make your report cells to be smaller, just shrink the field widths and also move the vertical lines.

    Another option would be to write your query as a pivot query. Search for key word 'pivot query' and you should find many examples. Once query is designed you can just drop the fields on the report, without creating and formating cross tabs, and you should achieve your format.

     

  7. Hi, I have a string parameter that will pass a datetime string value as follows. I need to create a dynamic WHERE clause and format that datetime string value and conver it to date.

    2009-01-01"t"13:00:00  -given value in the parameter say $P{DTvalue}

    My dynamic Where clause parameter that I am adding after my Select statement:

    //Select * From TableQ   $P{DynamicDTValue}

    " Where Start_Date=to_date(" +$P{DTValue}+", 'yyyy-mm-dd"t"hh24:mi:ss')"

    The problem I am having is the double qutoes surrounding t are causing error:

    net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
    1. Syntax error on token "t", * expected
                    value = (java.lang.String)(" Where Start_Date=to_date(" +((java.lang.String)parameter_DTValue.getValue())+", 'yyyy-mm-dd"t"hh24:mi:ss')");

    I must need the double quotes to work it correctly. Any ideas how can I pass the string with double quotes to t ?

  8. Hi, I have a cross tab report with following elements:

    Two row groups, vs. Code, Name

    One column group, vs. Period

    One details, vs. Price

    I have a group on Code in my report also and xtab is in the group footer of Code and resets at each Code.

    When I run the report for one Code, it runs fine and shows expected results, but when I run it for multiple codes, it shows multiple instances for same Code, as if its ignoring grouping. For exp: If I run it for Code 1001 and 1002, I see each Code repeating multiple times and so is the xtab.

    I know i have not provided enough information as its very hard to write all details here, but if you can guess what issue I am having and you are able to suggest something, I will really appreciate it. thanks in advance.

  9. I am using split function as follows. It only works if the number of elements in a string is equal to [ ] index. But if I increase the index to [4] but keep the string same ,it throws an error "java.lang.ArrayIndexOutOfBoundsException: 4 ". Below is just a sample string and in actuality a field will be replaced with the string "abc...". Since the field may contain from 1 to several elements, I am not sure how to dynamically use split function there. Thanks in advance for your valuable input.

    ("abc;def;ghi;jkl").split(";")[0]
    +"\n\r"+("abc;def;ghi;jkl").split(";")[1]
    +"\n\r"+("abc;def;ghi;jkl").split(";")[2]
    +"\n\r"+("abc;def;ghi;jkl").split(";")[3]    -- untill here works fine with the given string
    +"\n\r"+("abc;def;ghi;jkl").split(";")[4]   -- with addition of 4 (5th line) in index it throws error

     

  10. I have a prameter that will have values like (1234,1235,1236) passed from users. I need to add single quotes to it and then pass it to my query. The single quotes should make it like : ('1234','1235','1236'). How can I do this? For now I am asking end users to enter single quotes to each values but I find it a limitation and need to find a better solution for it. Any ideas please? I am using v1.2.xx.

    Thanks,

  11. I have a parameter1 that may be blank in some cases. So I have another parameter2 which wants to check if the parameter1 is blank, then it will say 'All' else parameter1. I have tried following but its not evaluating correctly.

    $P{parameter1}.equals("")? 'ALL':$P{parameter1}

    $P{parameter1}==""? 'ALL':$P{parameter1}

    $P{parameter1}==null? 'ALL':$P{parameter1}

    Any ideas please?

×
×
  • Create New...