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

sanbez

Members
  • Posts

    296
  • 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

Everything posted by sanbez

  1. Try to set in subreport: When No Data = "All Sections, No Details" In iReport: in ReportInspector choose report, rihgt click mouse, choose Properties->When No Data
  2. Another way (it's more easy): define summary variable with ResetType = Report
  3. Check you java-code on presence parameter IS_IGNORE_PAGINATION (or set it on false): params.put("IS_IGNORE_PAGINATION", false); JasperPrint reportOut = JasperFillManager.fillReport(report, params, dataset); and check Page Height in reportProperties in iReport. May be it is so big? Post Edited by sanbez at 03/20/2012 14:53
  4. 1. Make variable $V{YEAR} (if your sql is not contain this, or use field F{YEAR}. I am check only with variable, but i think that using field is also will be work). 2. In Table Dataset add Group with group expression $V{YEAR}. After that iReport itself will make "group1 Group Header" and "group1 Group Footer" (see Report Inspector window). 3. Make variable $V{sum_by_year} in Table Dataset (calculation="Sum", reset type="Group") 4. Choose column in "group1 Group footer" and add cell (right mouse button) 5. Drag $V{sum_by_year} into created cell (to Designer window). 6. Be happy :) Best regards Post Edited by sanbez at 03/17/2012 14:39
  5. I am know about panel of band properties. But all parts of table component (contain Table Header, Column Header, Detail, Column Footer and Table Footer - it is composition of Table, it is not a bands of report!) must be placed only in one band. I can't drag only table footer into other band. Any ideas?
  6. subj I have one report with boolean parameter "increase". Output when increase=false Date1 Val1 Date2 Val2 Date3 Val3 Sum Val1+Val2+Val3 Output when increase=true Date1 Val1 Date2 Val1+Val2 Date3 Val1+Val2+Val3 I make 3 columns (Date, Val (increase=false), ValIncr(increase=true) ). "Column print when" on table Header work perfectly. But where "Table footer print when"? :) In second format I want hide table footer (with "summary") of table component. Can I make it by only one condition? Now I set "Print when expression" on all fields :(
  7. Yes, I am understand. But in your question mixed two problems: 1. conditional export bands (depends from data in report) 2. various export for different export format I am suggest solution only one problem. IMHO It is necessary for you to solve these problems separately. Best regards
  8. May be try return boolean variable from subreport into variable of main report and set Print When Expression on band of master report as $V{variable_name_in_main_report} ? But I'am not sure...
  9. See DataSource expression in R1250.jrxml for calling subreport Sorry for double post Post Edited by sanbez at 02/22/2012 15:44
  10. Hi! DataSource expression for subreport must return JRDataSource object to fill subreport. If you have only one value in title, subreport is not nessesary. Declare parameter D_FROM as java.util.Date in jrxml, pass it (it's already done: myParams.put("D_FROM", new Date(2010, 2, 15)); ) and print it's text field $P{D_FROM) in main report. Forum for russion language is one of: http://www.sql.ru/forum/actualtopics.aspx?bid=57 http://www.sql.ru/forum/actualtopics.aspx?bid=38
  11. Additional explanations: You may use even empty dataSource for main report: JRDataSource dataSource = new JREmptyDataSource(); and solve any problems on params and subreports 1. Make subreport (subreport.jrxml) 2. Modify main report (main.jrxml), inserting subreport into detail (or summary? band) 3. Define parameter1 as java.util.collection for main report 4. Pass list to parameter1 of main report (in java-code). 5. For element "subreport" of main report define dataSource expression: new YourClass($P{parameter1}) 6. Implements JRDataSource interface in YourClass where getFieldValue returns field as they named (and with this types as in subreport. see 1.Make subreport) If this is not clear, please put screenshot of desired report The way to solution your problems may be various for different "structure" of your report
  12. In my first message i wrote about DataSource expression for subreport and JRDataSource interface for this class. My example: for subreport datasource expression in main report: --- cut new R1250DataSource($F{ascueGroup}, $P{startDate}, $P{endDate}) --- end cut where $F{ascueGroup} - field from main report, $P{startDate}, $P{endDate} - params of main report In your case you may use map as parameter of constructor for dataSource for subreport And for iterate on collection in subreport you must inmplements JRDataSource interface (realize methods next() and getFieldValue()) (@see net.sf.jasperreports.engine.JRDataSource ) --- my code for example public class R1250DataSource implements JRDataSource { private PredictedExpense currentPredictedExpense; private Iterator<PredictedExpense> iterator; // constructor public R1250DataSource(Group group, Date startDate, Date endDate) throws JRException { List<PredictedExpense> values = new ArrayList<PredictedExpense>(); try { .... vaues.add(new PredictedExpense(...)); } catch (NullPointerException e) { throw new JRException(e); } iterator = values.iterator(); } @Override public boolean next() throws JRException{ boolean result = iterator.hasNext(); if (result) { currentPredictedExpense = iterator.next(); } return result; } @Override public Object getFieldValue(JRField jrf) throws JRException { ExpenseMeasureChannel counterIndication = currentPredictedExpense.getCounterIndication(); if (jrf.getName().equals("pointName")) { return counterIndication.getAccountPointName(); } if (jrf.getName().equals("counterName")) { return counterIndication.getCounterName(); } ... return null; } and in subreport define fields with names "pointName", "counterName", ... Good luck
  13. salvuzzo87 Wrote: I need to spend 3 collections with the parameters, you can not connect to the database? >> I need to spend 3 collections with the parameters Use 3 params and 3 subreports :) you can not connect to the database? I don't understand. In my reports all information is saved in collections. I am don't need connect to database
  14. HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("yourparam1", value1); .... if (reportFormat.equals(ReportFormat.EXCEL)) { parameters.put("IS_IGNORE_PAGINATION", true); } ... But it is only before fillReport
  15. I am using JRBeanCollectionDataSource. In some case I declare parameter of main report as java.util.Collection and pass my collection into this parameter, for example "srcDataSource". In subreport expression "new MyClassDataSource($P{srcDataSource})" and MyClassDataSource must implements JRDataSource interface. May be you try expression new JRBeanArrayDataSource($P{srcDataSource}) ?
  16. Hi, All In my crosstab report last column is "especial". Summary for this column must by calculated as Average instead Sum in all other columns. How to realize this behaviour? Can I write clever incrementer with parameter? (for example $V{COLUMN_NUMBER)) Data from this column is not included in summary for row (it's already realized). DataSource for report is JRBeanCollectionDataSource. I am "manually " add last column data into DataSource, but I don't know how to do "last step" in this report :( Thanks for any assistance
  17. I don't understood your questions exactly. If you want to display parameter-collection in report, you mast make subreport with DataSource expression like this: new YourClassNameDataSource($P{paramCollectionName}) where $P{paramCollectionName) - parameter of main report and class YourClassNameDataSource must implements JRDataSource interface
  18. Try to add SUBREPORT_DIR param from main report to subreport Screenshot attached
  19. In iReport choose menu item Window/Palette. And then drag needed "type" element into report detail (header, summary,... and so on) section
  20. In my reports I display data with different detalization (short, extended, full). When i use "summary values" in first line of master report (and subreport is placed below this summary), then all fields of master report is stretched ony to band height minus 1. It work identical in JR 4.0.2, 4.1.2 Is it a bug? How I can to stretch first field in my report to full band height? I spent a lot of time to bypass similar problems... :( Examples of reports and jrxml is attached Thanks
  21. Problem solved by transformation current report to subreport, which return InputSum and OutputSum values into main report. In main report for sum fields set "Relative to Band Height".
  22. Hi All ! Can I display only one summary value (Stretched!!! ) in detail section? JR (iReport) version 4.1.2 I need display report data as in screen: Could anyone help me? jrxml attached. Post Edited by sanbez at 12/06/2011 07:01
  23. What version of JR? I replace stored procedure with simple sql and I haven't empty rows on JR 4.0.2 and 4.1.2. I'am even set net.sf.jasperreports.export.xls.remove.empty.space.between.rows=false on report. Empty string is not displayed in any case. Will you see blank line again on attachment report?
×
×
  • Create New...