Fixes issue 9716: Set the BASE_DESIGN parameter in the ReportManager component
authorIván Perdomo <ivan.perdomo@openbravo.com>
Tue, 30 Jun 2009 11:05:57 +0200
changeset 4074 0e7e33c1eed4
parent 4073 494695dc653b
child 4075 1d333b902d58
Fixes issue 9716: Set the BASE_DESIGN parameter in the ReportManager component
src/org/openbravo/erpCommon/utility/reporting/ReportManager.java
--- a/src/org/openbravo/erpCommon/utility/reporting/ReportManager.java	Tue Jun 30 13:01:05 2009 +0530
+++ b/src/org/openbravo/erpCommon/utility/reporting/ReportManager.java	Tue Jun 30 11:05:57 2009 +0200
@@ -130,11 +130,15 @@
       JRFormatFactory jrFormatFactory = new JRFormatFactory();
       jrFormatFactory.setDatePattern(variables.getJavaDateFormat());
       designParameters.put(JRParameter.REPORT_FORMAT_FACTORY, jrFormatFactory);
-      String salesOrder=report.getCheckSalesOrder();
-      if(salesOrder!=null && salesOrder.equals("Y")){
-    	  designParameters.put("DOCUMENT_NAME", Utility.messageBD(_connectionProvider, "Sales", language)+" "+Utility.messageBD(_connectionProvider, "Invoice", language));
-      }else{
-    	  designParameters.put("DOCUMENT_NAME", Utility.messageBD(_connectionProvider, "Purchase", language)+" "+Utility.messageBD(_connectionProvider, "Invoice", language));
+      String salesOrder = report.getCheckSalesOrder();
+      if (salesOrder != null && salesOrder.equals("Y")) {
+        designParameters.put("DOCUMENT_NAME", Utility.messageBD(_connectionProvider, "Sales",
+            language)
+            + " " + Utility.messageBD(_connectionProvider, "Invoice", language));
+      } else {
+        designParameters.put("DOCUMENT_NAME", Utility.messageBD(_connectionProvider, "Purchase",
+            language)
+            + " " + Utility.messageBD(_connectionProvider, "Invoice", language));
       }
       jasperPrint = fillReport(designParameters, jasperReport);
 
@@ -278,12 +282,14 @@
 
   private HashMap<String, Object> populateDesignParameters(VariablesSecureApp variables,
       Report report) {
+    final String baseDesignPath = _prefix + "/" + _strBaseDesignPath + "/" + _strDefaultDesignPath;
     final HashMap<String, Object> designParameters = new HashMap<String, Object>();
 
     designParameters.put("DOCUMENT_ID", report.getDocumentId());
 
     designParameters.put("BASE_ATTACH", _strAttachmentPath);
     designParameters.put("BASE_WEB", _strBaseWeb);
+    designParameters.put("BASE_DESIGN", baseDesignPath);
     designParameters.put("IS_IGNORE_PAGINATION", false);
     designParameters.put("USER_CLIENT", Utility.getContext(_connectionProvider, variables,
         "#User_Client", ""));