From ac0845314c091c296954286d0ce235ef70dfd7c8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Feb 2015 09:55:49 -0500 Subject: [PATCH] IDEMPIERE-2450 Enable Zoom for Record_ID on HTML Reports / thanks to Deepak Pansheriya and Adaxa for seed patch --- .../org/compiere/print/PrintDataElement.java | 9 +++++++- .../src/org/compiere/print/ReportEngine.java | 23 +++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/PrintDataElement.java b/org.adempiere.base/src/org/compiere/print/PrintDataElement.java index bbbc78d75c..ea2ef64e9a 100644 --- a/org.adempiere.base/src/org/compiere/print/PrintDataElement.java +++ b/org.adempiere.base/src/org/compiere/print/PrintDataElement.java @@ -39,7 +39,7 @@ public class PrintDataElement implements Serializable /** * */ - private static final long serialVersionUID = 2177482817458457236L; + private static final long serialVersionUID = -2121125127301364735L; /** * Print Data Element Constructor @@ -129,6 +129,13 @@ public class PrintDataElement implements Serializable return m_foreignColumnName; } + /** + * Set ForeignName + * @return name + */ + public void setForeignColumnName(String foreignColumnName) { + m_foreignColumnName = foreignColumnName; + } /** * Get Node Value diff --git a/org.adempiere.base/src/org/compiere/print/ReportEngine.java b/org.adempiere.base/src/org/compiere/print/ReportEngine.java index ca3f98851f..e3936059da 100644 --- a/org.adempiere.base/src/org/compiere/print/ReportEngine.java +++ b/org.adempiere.base/src/org/compiere/print/ReportEngine.java @@ -72,6 +72,7 @@ import org.compiere.model.MPaySelectionCheck; import org.compiere.model.MProject; import org.compiere.model.MQuery; import org.compiere.model.MRfQResponse; +import org.compiere.model.MTable; import org.compiere.model.PrintInfo; import static org.compiere.model.SystemIDs.*; @@ -660,8 +661,26 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) if (cssPrefix != null) href.setClass(cssPrefix + "-href"); - extension.extendIDColumn(row, td, href, pde); - + if (item.getColumnName().equals("Record_ID")) { + Object tablePDE = m_printData.getNode("AD_Table_ID"); + if (tablePDE != null && tablePDE instanceof PrintDataElement) { + int tableID = -1; + try { + tableID = Integer.parseInt(((PrintDataElement)tablePDE).getValueAsString()); + } catch (Exception e) { + tableID = -1; + } + if (tableID > 0) { + MTable mTable = MTable.get(getCtx(), tableID); + String foreignColumnName = mTable.getTableName() + "_ID"; + pde.setForeignColumnName(foreignColumnName); + extension.extendIDColumn(row, td, href, pde); + } + } + } else { + extension.extendIDColumn(row, td, href, pde); + } + } else {