*/
private void fillComboReport(int AD_PrintFormat_ID)
{
comboReport.removeActionListener(this);
comboReport.removeAllItems();
KeyNamePair selectValue = null;
// fill Report Options
String sql = MRole.getDefault().addAccessSQL(
"SELECT AD_PrintFormat_ID, Name, Description "
+ "FROM AD_PrintFormat "
+ "WHERE AD_Table_ID=? "
//Added Lines by Armen
+ "AND IsActive='Y' "
//End of Added Lines
+ "ORDER BY Name",
"AD_PrintFormat", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
int AD_Table_ID = m_reportEngine.getPrintFormat().getAD_Table_ID();
try
{
PreparedStatement pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, AD_Table_ID);
ResultSet rs = pstmt.executeQuery();
while (rs.next())
{
KeyNamePair pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
comboReport.addItem(pp);
if (rs.getInt(1) == AD_PrintFormat_ID)
selectValue = pp;
}
rs.close();
pstmt.close();
}
catch (SQLException e)
{
log.log(Level.SEVERE, sql, e);
}
StringBuffer sb = new StringBuffer("** ").append(Msg.getMsg(m_ctx, "NewReport")).append(" **");
KeyNamePair pp = new KeyNamePair(-1, sb.toString());
comboReport.addItem(pp);
if (selectValue != null)
comboReport.setSelectedItem(selectValue);
comboReport.addActionListener(this);
} // fillComboReport