BrightSide Workbench Full Report + Source Code
org.turro.financials.document.contract.DocumentReport Class Reference
Inheritance diagram for org.turro.financials.document.contract.DocumentReport:
Collaboration diagram for org.turro.financials.document.contract.DocumentReport:

Public Member Functions

void setDocument (Document document)
 
- Public Member Functions inherited from org.turro.zkoss.print.ReportButton
 ReportButton ()
 
void setShowLabels (boolean showLabels)
 
void setShowValues (boolean showValues)
 
void afterCompose ()
 

Protected Member Functions

void print (String type)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.zkoss.print.ReportButton
boolean showValues = true
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 42 of file contract/DocumentReport.java.

Member Function Documentation

◆ print()

void org.turro.financials.document.contract.DocumentReport.print ( String  type)
protected

Reimplemented from org.turro.zkoss.print.ReportButton.

Definition at line 51 of file contract/DocumentReport.java.

51  {
52  Collection<DocumentLine> lines = document.getDocumentLines();
53  if(lines != null && lines.size() > 0) {
54  DocumentLine sample = lines.iterator().next();
55  int fractionDigits = document.getCurrency().getDefaultFractionDigits();
56  Map parameters = new HashMap();
57  Company company = CompanyWrapper.getCompanyFrom(sample);
58  Contact companyContact = (Contact) company.getIContact().getContact();
59  parameters.put("company", company);
60  parameters.put("companyContact", companyContact);
61  parameters.put("dateFormat", DateFormats.getDefaultFormat());
62  parameters.put("currencyFormat", DecimalFormats.getStringFormat(fractionDigits));
63  parameters.put("showDescendants", Boolean.TRUE);
64  Contact contractor = (Contact) document.getContract().getIContractor().getContact();
65  parameters.put("contractor", contractor);
66  parameters.put("exportFormat", type);
67  parameters.put("REPORT_RESOURCE_BUNDLE", Application.getBundle(
68  "labels",
69  ((Contact) document.getContract().getIContractor().getContact()).getLocale(),
70  ElephantContext.getSiteLocales()));
71  parameters.put("SUBREPORT_DIR", "../_reports/financials/document/");
72  parameters.put("LOGO_IMAGE", ElephantContext.getRealPath("/WEB-INF/_reports/images/doc_logo.png"));
73  String file = "/WEB-INF/_reports/financials/document/" + document.getDocumentDefinition().getName() +
74  (showValues ? "" : "NoValues") + ".jasper";
75  try {
76  ReportPrint.print(document.getDocumentDefinition().getName(),
77  lines, parameters, file, "/WEB-INF/_reports/financials/document/Document" +
78  (showValues ? "" : "NoValues") + ".jasper",
79  type, "Financials");
80  } catch (JRException ex) {
81  Logger.getLogger(DocumentReport.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
82  }
83  }
84  }
Set< DocumentLine > getDocumentLines()
Definition: Document.java:180
DocumentDefinition getDocumentDefinition()
Definition: Document.java:167
Here is the call graph for this function:

◆ setDocument()

void org.turro.financials.document.contract.DocumentReport.setDocument ( Document  document)

Definition at line 46 of file contract/DocumentReport.java.

46  {
47  this.document = document;
48  }

The documentation for this class was generated from the following file: