1 package jimm.datavision.field; 2 import jimm.datavision.Report; 3 import jimm.datavision.Section; 4 import jimm.datavision.Subreport; 5 6 12 public class SubreportField extends Field { 13 14 protected Subreport subreport; 15 16 26 public SubreportField(Long id, Report report, Section section, Object value, 27 boolean visible) 28 { 29 super(id, report, section, value, visible); 30 subreport = report.findSubreport(value); 31 } 32 33 public Subreport getSubreport() { return subreport; } 34 35 43 public void setSection(Section s) { 44 if (s == null) 45 report.removeSubreport(subreport); 46 else { 47 if (report.findSubreport(subreport.getId()) == null) 50 report.addSubreport(subreport); 51 } 52 super.setSection(s); 53 } 54 55 61 public Object getValue() { 62 return subreport.getValue(); 63 } 64 65 public String dragString() { 66 return typeString() + ":" + getId(); 67 } 68 69 public String typeString() { return "subreport"; } 70 71 public String formulaString() { return "{|subreport " + getId() + "}"; } 72 73 } 74 | Popular Tags |