use of org.compiere.report.MReportColumnSet in project adempiere by adempiere.
the class ReportColumnSet_Copy method doIt.
// prepare
/**
* Perform process.
* @return Message
* @throws Exception
*/
protected String doIt() throws Exception {
int to_ID = super.getRecord_ID();
log.info("From PA_ReportColumnSet_ID=" + m_PA_ReportColumnSet_ID + ", To=" + to_ID);
if (to_ID < 1)
throw new Exception(MESSAGE_SaveErrorRowNotFound);
//
MReportColumnSet to = new MReportColumnSet(getCtx(), to_ID, get_TrxName());
MReportColumnSet rcSet = new MReportColumnSet(getCtx(), m_PA_ReportColumnSet_ID, get_TrxName());
MReportColumn[] rcs = rcSet.getColumns();
for (int i = 0; i < rcs.length; i++) {
MReportColumn rc = MReportColumn.copy(getCtx(), to.getAD_Client_ID(), to.getAD_Org_ID(), to_ID, rcs[i], get_TrxName());
rc.saveEx();
}
// Oper 1/2 were set to Null !
return "@Copied@=" + rcs.length;
}
Aggregations