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

prinsesajade

Members
  • Posts

    18
  • Joined

  • Last visited

prinsesajade'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. i found the answer to my problem.. what i did is i created 2 subreports.the first one was the subreport with the complete fields and the second report is the one without the night field(that was the field i need to hide)..then in my java class i created a condition and put the result in a map according to the team id..say for example TEAM A's products are all created in regular hours a set a boolean to true and otherwise false..then put it to map map.put(teamId, booelanValue) and put this map to my report parameters map.. params.put("MAP", map) in subreport properties --> Subreport Expression i wrote a condition that if my parameter MAP returns true load subreport 2(night fields are hidden) otherwise load subreport 1(all fields are shown)..
  2. hi!does anyone have any idea on how i can do this or is this possible? here's the scenario.. i have my main report which is a list of teams..for every team will be a subreport of the production of each team..so say for example in page 1 i have team A as the heading and its subreport, in page 2 will be team B and its subreport and so on.. in my subreport i have these fields for regular work hours and night differential..a product can be created on a regular working hour or on night..so if it is created in regular work hour (10am-6pm) the field for night differential should not be displayed..the column should be hidden.. now here's the problem..say for example in page 1, that is TEAM A, all products in that team was created in regular work hours so the night field should be hidden.. in page2, TEAM B, there are some products that are created at night so night field is not hidden.. any idea how can i do this?thank you..
  3. so the datasource of ur main and subreport are the same? still try to put ur datasource in the map..just try!hope this will help..
  4. i have this condition(see code).. this behaves by evaluating a boolean i passed as parameter to my report..if this param is true it will multiply 2 numbers else it will display 0.00..the problem is even if it is true the displayed value is still 0.00.. this is how i put my parameter in map params.put("HOLIDAY", isHoliday)... is there anything wrong with my condition?or with how i put my parameter to the map? Code:((((Boolean)$P{REPORT_PARAMETERS_MAP}.get("HOLIDAY")) != null) && (((Boolean)$P{REPORT_PARAMETERS_MAP}.get("HOLIDAY")).booleanValue() == true))?new Double((10 * 0.30)):new Double(0.00)
  5. yes it worked for me.. ur problem is the fields of ur subreport r blank? this is how i make a subreport.. i put the datasource and path of my subreport in a map..(see code below) then in ur master report create a parameter with name the same as the key u used for putting the path/datasource in the map.. ex. SUBREPORT_DIR -- classType = java.lang.String SUBREPORTDATASOURCE -- net.sf.jasperreports.engine.JRDataSource then in subreport properties in subreport expression put the variable u used for the path of ur subreport and in the connection expression put the variable u used for the datasource.. this is the best way i can explain this..hope this helps.. Code:Map<String, Object> params = new HashMap<String, Object>();params.put("SUBREPORT_DIR", urreportpathhere);params.put("SUBREPORTDATASOURCE", urdatasourcehere);JasperPrint print =JasperUtil.fillReport(mainreportpath, params, mainreportdatasource);
  6. i have just found the answer to my problem..i only have to add the same parameter (including the name) in my main report..say i have this parameter RATE in my subreport which is a map i just have to add the same paramter in my main report and in Subreport-->Properties-->Subreport Parameters..
  7. hi! can anyone help me with this or any idea? i have a main report with 3 subreports (Product, Agency1, Agency2)..this is how it works.. my first subreport (Product) have these fields Agency1Count and Agency2Count..the values of these fields will be dependent on the number of records processed in my other subreports(Agency1 and Agency2)..so if Agency1 has 12 records and 10 for Agency2 my Product subreport should display 12 for Agency1Count and 10 for Agency2Count..and here comes my problem..i don't know how i can pass these values from one subreport to another.. do u have any idea?please let me know...thanks in advance..
  8. hi! i have this report (Products.jrxml)..it has three fields name, amount/piece and rate.. Rate is filled by a parameter i passed in the report. That is a map of rates by product id. So i have it like this $P{MyParameters}.get($F{productId})..when i run my report everything is fine..all fields have contents.. here's the problem when i used this report as a subreport to another report my column for RATE are null... my main report only contains a team (ex. TEAM A, TEAM B) that will be dispalyed at the top of each page groupingmy subreport accdg to teamID..grouping by team ID is fine, working well but then the column for RATE is null... how do i pass parameters to a subreport?
  9. hi!thanks for ur reply.. maybe i wud try the second option..i was trying to do the helper class but i can't add my bean to my datasources.. thanks for ur help!
  10. hi!it's me again.. do u have any idea how i can do this? i have this report that will generate a payroll..one of the fields is taxCode (Integer).. here is my question.. say for example the value of taxCode for this certain employee is 20 i have to replace this value with a constant that wil be coming from a java class (TaxCategoryConstant)..here is my class: so if the employee's taxCode is 20, S should be displayed in the result.. have any idea on this? thank you! Code:public class TaxCategoryConstants { public static final int Z=0; public static final int S=20; public static final int HF=25; public static final int ME=32; public static final int HF1=33; public static final int HF2=41; public static final int HF3=49; public static final int HF4=57; public static final int ME1=40; public static final int ME2=48; public static final int ME3=56; public static final int ME4=64;}
  11. thanks for ur reply! i just thought of using a parameter(a counter that will count the occurence of the person in my list) from my bean and to be evaluated at runtime in my report..i used it as a condition in my field..and cha-da! all is fine! thank you for your reply!
  12. hi! i was wondering if it is possible to hide the records of a group.. i made a report and gropued them by name..here is the format of my report: Name Team Gross Net Sample1 A 100 250 Sample1 B 250 150 Samle2 C 100 100 a certain person can have many teams so he will have multiple entries in the report..I have done hiding the repeated values in a group and summing up the gross and net if a person has multiple entries like this..the total will only appear for multple entries.. Name Team Gross Net Sample1 A 100 250 B 250 150 TOTAL: 350 400 Samle2 C 100 100 my problem now here is is it possible to hide the entries(gross and net) and show only the TOTAL if a person has multiple entries like this: Name Team Gross Net Sample1 A B TOTAL: 350 400 Samle2 C 100 100 i have tried using this conditon new Boolean($V{groupCount}.intValue==1) in the Print When Expression but then the first row is still visible.. do you have any idea?can u please help me.. thank you
  13. hi im new to ireport but i hope this can help.. $F{YourFieldName} > 5000 ? doSomethingHere : "" let me give you an example: say u have a field name GROSS with type Double.if the value of gross is null the report would display 0.00 instead of null and if it is not null the report will display the value..here is how i do it: $F{GROSS} == null ? new Double(0.00) : $F{GROSS} hope this can help you!
  14. yeah i did it and it worked! i just added few more lines and cha-da! thank you so much!
×
×
  • Create New...