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

dpriya.pratheep

Members
  • Posts

    9
  • Joined

  • Last visited

dpriya.pratheep's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. How to use conditional style in crosstab header cell I use usbdataset to display values in crosstab <style name="Background_Style"isDefault="false"> <conditionalStyle><conditionExpression><![CDATA[new Boolean($V{forecast}=="true")]]></conditionExpression><style isDefault="false"mode="Transparent"backcolor="pink"></style></conditionalStyle></style> where $V{forecast} is from <subDataset name="summaryDataSet" ><field name="Month" class="java.lang.Integer"/><field name="forecast" class="java.lang.String"/></subDataset> In crosstab <cellContents mode="Opaque" style="Background_Style"> If i use<conditionExpression><![CDATA[new Boolean("true"=="true")]]></conditionExpression> It is working fine with attached screen shot. How can use variable forecast from subdataset to style ?Read somewhere that subdataset variable can not accress outside ..If so how can do ? Any help or link to tutorial is higly appreciated.
  2. Hi I attach my bar chart Two problems 1. How to make category axis(x-axis) at 0 position of y axis ? that is between positive and negative values 2.how to set pattern(stripped lines) I use cutomizer but don't know exactly the correct property. Thanks
  3. Actually I am using iReport 2.0.2 for generating reports. The below link http://books.google.com.sg/books?id=WChn89m-MGgC&pg=PA60&lpg=PA63&ots=LX21R5Cs-o&dq=ireport+pie+chart+tutorial at page 60 for creating pie chart(Chart details)there is button Use more series to give more values .But in my chart it is missing ...I need to give more than one series in pie chart ireport...
  4. Thanks Ankur for reply Actually what I need is I have three calculated variables let us say A1,A2,A3 in ireport. I want to create pie chart with A1 in one piece of pie ,A2 in second piece of pie and A3 in third piece of pie. In bar chart we can add more than one category series(Chart properties --> chart data -->Details --> category Series then use add button more than one time) but in pie chart( chart properties --> chart Data -->Details) don't have add button for add more than one. Else can say how to create pie chart with report variables ?
  5. Hi friends, I want to create a pie chart with calculated variables from ireport jrxml file. I created bar char succesfully with series expression : "1.Budget SalesCategory expression : new Integer(1)Value expression : $V{ptd_budget_sales} like that I added four seris for four bars. I need to use same way to create pie char. but in pie chart have only one section value key expressionvalue expressionlabel expression cant give more than one. I usually pass pie char value from java datasource but now i need to take values from calculated variables only. I googled but found similar questions without answer. Please anybody help me or any link...I read somewhere that can create from csv file too.In that case how to create a csv file from report? I know to create from java but not from ireport ...any suggestion is appreciated..Thanks
  6. I need to create a chart. I am getting parameter from java . My java code public static List randomData() { List listOfCostSales = new ArrayList(); listOfCostSales.add(new CostSales(10.2,1)); listOfCostSales.add(new CostSales(20.2,2)); listOfCostSales.add(new CostSales(30.2,3)); listOfCostSales.add(new CostSales(40.2,4)); return listOfCostSales;} parameters.put("listOfCostSales", randomData()); jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,dataSource); Then In Ireport I created a chart . In main dataset I created a parameter listOfCostSales as list and cost and month. And created a subdataset Chartdata with listOfCostSales, sale, month. In chart data Connection/DataSource Expression, I used Use connection expression from the drop down and set value new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{listOfCostSales}) Parameters Map Expression$P{REPORT_PARAMETERS_MAP} Parameters cost $P{cost} and month $P{month} I don't know what is wrong with my code. I can't access elements of list. I am getting null key .. For testing Printed month and cost by drag droping. I am getting null Please help me .I am struggling with this for last two week. Almost googled most of the sites and failed to find out the answer.
  7. MYJRXML code $P{REPORT_PARAMETERS_MAP}.get( "Actual_Cost" )$P{REPORT_PARAMETERS_MAP}.get( "Actual_Sale" )$P{REPORT_PARAMETERS_MAP}.get( "Cost" )$P{REPORT_PARAMETERS_MAP}.get( "Sale" ) ................. x="105" y="258" width="439" height="208" key="element-1"/> $P{listOfCostSales} $P{REPORT_CONNECTION} "a" $P{month} $P{Cost} $P{month}
  8. I need to create chart I have one subdataset "ChartDataset" which has parameters Actual_cost,Actual_sale.Cost,Sale and month. Data to ChartDataset whould come from maindataset parameter "listOfCostSales" which is a array list from java. In chart data i gave subdataset as ChartDataset and added parameter as listOfCostSales and Expression as $P{listOfCostSales} and Category expression as $P{month} and Value expression as $P{Cost } and Connection/Data Source Exp. in Dataset Run as $P{REPORT_CONNECTION}. My piece of jave code private JasperPrint getProjectReportByActual(int projectId,String year,int period,String viewtype,String reportUser,HttpServletRequest request, String reportType) throws JRException, APSEException { //to resolve connection leak by huirong on 05/01/2012Connection conn = null;Statement stmt = null;ResultSet rs = null; try {JasperPrint jasperPrint = null;ServletContext application=getServletConfig().getServletContext(); //JRXML file processingJasperCompileManager.compileReportToFile(application.getRealPath("/reports/project_consolidated_report_actual.jrxml")); File reportFile = new File(application.getRealPath("/reports/project_consolidated_report_actual.jasper"));if (!reportFile.exists())throw new JRRuntimeException("File project_consolidated_report_actual.jasper not found."+"The report design must be compiled first.");JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath()); //getting dataString url = accessdatabaseURL;Properties props = new Properties();props.setProperty("user",accessdatabaseUser);props.setProperty("password",accessdatabasePwd);conn = DriverManager.getConnection(url, props);stmt = conn.createStatement(); Projects project=new ProjectsBiz().getProjectsById(projectId);String proName=project.getProjectCode()+" - "+project.getProjectName(); //Give the datasourse to read data from AD DB...rs = stmt.executeQuery(getQueryString(project.getProjectCode(),year,period)); JRResultSetDataSource dataSource = new JRResultSetDataSource(rs); if(reportType.equals(PROJECT_BY_ACTUAL_APSE_AD_DB)){ break; }} } else { } //TODO: to get Budget and Actual data for drawing, refer to TestHibernate to populate dataMap> monthMap = new ProjectCodeBiz().getProjectBudgetAndActualToMonth(projectId, year, period);,> AccountingCalendar ojbAccountingCalendar = new AccountingCalendarBiz().getAccountingPeriod(year,period);String fYrPeriod = period + " " + ojbBMTAccountingCalendar.getPeriodDescription(); //Report's parametersMap parameters = new HashMap();parameters.put(REPORT_TITLE, title);parameters.put(PROJECT_NAME, proName);parameters.put(PERIOD_NO, fYrPeriod);parameters.put(REPORT_GENERATOR, reportUser); parameters.put(BUDGET_LABOUR_HOUR, labourHour);parameters.put(BUDGET_LABOUR_COST, labourCost);parameters.put(BUDGET_ICO_COST, icoCost);parameters.put(BUDGET_SUBCON_COST, subconCost);parameters.put(BUDGET_OTH_PURCHASE_COST, othPhurCost);parameters.put(BUDGET_SALE, sale);int count=0;List listOfCostSales = new ArrayList(); if (monthMap != null) {Iterator monthIterator = monthMap.keySet().iterator();Integer monthKey;Double actual_Cost =0.0;Double actual_Sale =0.0;Double cost =0.0; Double sale1=0.0;Map sumMap;,>Iterator sumIterator;String sumKey; while(monthIterator.hasNext()){monthKey = (Integer) monthIterator.next();parameters.put("months1", monthKey);sumMap = monthMap.get(monthKey);logger.debug("monthKey"+monthKey);sumIterator = sumMap.keySet().iterator(); while(sumIterator.hasNext()){sumKey = (String) sumIterator.next();count = count + 1;BigDecimal value = (BigDecimal)sumMap.get(sumKey); if (sumKey.equals("Actual_Cost"))actual_Cost = ObjectUtils.round(value).doubleValue(); if (sumKey.equals("Actual_Sale"))actual_Sale = ObjectUtils.round(value).doubleValue(); if (sumKey.equals("Cost"))cost = ObjectUtils.round(value).doubleValue(); if (sumKey.equals("Sale"))sale1 = ObjectUtils.round(value).doubleValue(); } listOfCostSales.add(new CostSales(actual_Cost, actual_Sale,cost,sale1,monthKey));} } // JRBeanCollectionDataSource beanToWrap = new JRBeanCollectionDataSource(listOfCostSales);// // logger.debug("listOfCostSales"+beanToWrap);parameters.put("listOfCostSales", listOfCostSales);} jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,dataSource); return jasperPrint; and JRXML code ....................................................... $P{REPORT_PARAMETERS_MAP}.get( "Actual_Cost" ) $P{REPORT_PARAMETERS_MAP}.get( "Actual_Sale" ) $P{REPORT_PARAMETERS_MAP}.get( "Cost" ) $P{REPORT_PARAMETERS_MAP}.get( "Sale" ) <>
  9. I am using java and I Report and new to Ireport. Values to I report are passed through java. I handled only single values not array or group of values . Now I want to create a chart. with month on x-axis and running(auto increment) values on y-axis. Data are in Map in java , so i can pass Map to Ireport through parameters.How can use this to chart. I saw example are for SQ L query . My java code Map> monthMap = ,>new ProjectCodeBiz().getProjectBudgetAndActualToMonth(projectId, year, period); if (monthMap != null) { Iterator monthIterator = monthMap.keySet().iterator(); ,> Integer monthKey; Map sumMap; ,>,> Iterator sumIterator; ,>,> String sumKey; while(monthIterator.hasNext()){ monthKey = (Integer) monthIterator.next(); parameters.put(MONTH, monthKey); sumMap = monthMap.get(monthKey); sumIterator = sumMap.keySet().iterator(); while(sumIterator.hasNext()){ sumKey = (String) sumIterator.next(); BigDecimal value = (BigDecimal)sumMap.get(sumKey); parameters.put(sumKey, ObjectUtils.round(value)); } } } //Filling the reports with data jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,dataSource); Usually i retrieve values like this in Ireport CDATA[$P{REPORT_PARAMETERS_MAP}.get( "report_title" ) for parameters and CDATA[$F{cp_labour_hour}for datasource. sample output is Month: 1 Key: Actual_Cost Value: 910.00 Key: Actual_Sale Value: 0.00 Key: Cost Value: 87300.00 Key: Sale Value: 97991.25 ..... Month: 17 Key: Actual_Cost Value: 910.00 Key: Actual_Sale Value: 0.00 Key: Cost Value: 92740.00 Key: Sale Value: 104095.75 Please anybody help me how to retrieve data from map? or If map can not handle in ireport any other way to handle this. My x-axis is for month should like this M 1, M 2, M 3 .... and y-axis 100,200,300 etc. what should i use for Series expression, X Value expression and Y value expression in i report chart properties? Using graph for four keys so X Y map is OK right? Please give me suggestions... Note: data are from two sources, that is why i am using parameter and data source. Thanks in advance
×
×
  • Create New...