IDEMPIERE-2450 Enable Zoom for Record_ID on HTML Reports / thanks to Deepak Pansheriya and Adaxa for seed patch

This commit is contained in:
Carlos Ruiz 2015-02-25 09:55:49 -05:00
parent ee91d259f6
commit ac0845314c
2 changed files with 29 additions and 3 deletions

View File

@ -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

View File

@ -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,7 +661,25 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
if (cssPrefix != null)
href.setClass(cssPrefix + "-href");
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