use of org.compiere.print.PrintDataElement in project adempiere by adempiere.
the class PrintDataExcelExporter method getPDE.
private PrintDataElement getPDE(int row, int col) {
if (m_printData.getRowIndex() != row)
m_printData.setRowIndex(row);
//
MPrintFormatItem item = m_printFormat.getItem(col);
int AD_Column_ID = item.getAD_Column_ID();
Object obj = null;
if (AD_Column_ID > 0)
obj = m_printData.getNode(Integer.valueOf(AD_Column_ID));
if (obj != null && obj instanceof PrintDataElement) {
return (PrintDataElement) obj;
}
return null;
}
use of org.compiere.print.PrintDataElement in project adempiere by adempiere.
the class LayoutEngine method createBarcodeElement.
// createImageElement
/**
* Create Barcode Element
* @param item item
* @return barcode element
*/
private PrintElement createBarcodeElement(MPrintFormatItem item) {
// Get Data
Object obj = m_data.getNode(new Integer(item.getAD_Column_ID()));
if (obj == null)
return null;
else if (obj instanceof PrintDataElement)
;
else {
log.log(Level.SEVERE, "Element not PrintDataElement " + obj.getClass());
return null;
}
// Convert DataElement to String
PrintDataElement data = (PrintDataElement) obj;
if (data.isNull() && item.isSuppressNull())
return null;
String stringContent = data.getValueDisplay(m_format.getLanguage());
if ((stringContent == null || stringContent.length() == 0) && item.isSuppressNull())
return null;
BarcodeElement element = new BarcodeElement(stringContent, item);
if (element.isValid())
return element;
return null;
}
use of org.compiere.print.PrintDataElement in project adempiere by adempiere.
the class LayoutEngine method createImageElement.
// createBoxElement
/**
* Create Image Element from item
* @param item item
* @return image element
*/
private PrintElement createImageElement(MPrintFormatItem item) {
Object obj = m_data.getNode(new Integer(item.getAD_Column_ID()));
if (obj == null)
return null;
else if (obj instanceof PrintDataElement)
;
else {
log.log(Level.SEVERE, "Element not PrintDataElement " + obj.getClass());
return null;
}
PrintDataElement data = (PrintDataElement) obj;
if (data.isNull() && item.isSuppressNull())
return null;
String url = data.getValueDisplay(m_format.getLanguage());
if ((url == null || url.length() == 0)) {
if (item.isSuppressNull())
return null;
else
// should create an empty area
return null;
}
ImageElement element = null;
if (data.getDisplayType() == DisplayType.Image) {
element = ImageElement.get(data, url);
} else {
element = ImageElement.get(url);
}
return element;
}
Aggregations