mouse_clicked(e,false);
}
});
// fill Drill Options (Name, TableName)
comboDrill.addItem(new ValueNamePair (null,""));
String sql = "SELECT t.AD_Table_ID, t.TableName, e.PrintName, NULLIF(e.PO_PrintName,e.PrintName) "
+ "FROM AD_Column c "
+ " INNER JOIN AD_Column used ON (c.ColumnName=used.ColumnName)"
+ " INNER JOIN AD_Table t ON (used.AD_Table_ID=t.AD_Table_ID AND t.IsView='N' AND t.AD_Table_ID <> c.AD_Table_ID)"
+ " INNER JOIN AD_Column cKey ON (t.AD_Table_ID=cKey.AD_Table_ID AND cKey.IsKey='Y')"
+ " INNER JOIN AD_Element e ON (cKey.ColumnName=e.ColumnName) "
+ "WHERE c.AD_Table_ID=? AND c.IsKey='Y' "
+ "ORDER BY 3";
boolean trl = !Env.isBaseLanguage(Env.getCtx(), "AD_Element");
if (trl)
sql = "SELECT t.AD_Table_ID, t.TableName, et.PrintName, NULLIF(et.PO_PrintName,et.PrintName) "
+ "FROM AD_Column c"
+ " INNER JOIN AD_Column used ON (c.ColumnName=used.ColumnName)"
+ " INNER JOIN AD_Table t ON (used.AD_Table_ID=t.AD_Table_ID AND t.IsView='N' AND t.AD_Table_ID <> c.AD_Table_ID)"
+ " INNER JOIN AD_Column cKey ON (t.AD_Table_ID=cKey.AD_Table_ID AND cKey.IsKey='Y')"
+ " INNER JOIN AD_Element e ON (cKey.ColumnName=e.ColumnName)"
+ " INNER JOIN AD_Element_Trl et ON (e.AD_Element_ID=et.AD_Element_ID) "
+ "WHERE c.AD_Table_ID=? AND c.IsKey='Y'"
+ " AND et.AD_Language=? "
+ "ORDER BY 3";
try
{
PreparedStatement pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, m_reportEngine.getPrintFormat().getAD_Table_ID());
if (trl)
pstmt.setString(2, Env.getAD_Language(Env.getCtx()));
ResultSet rs = pstmt.executeQuery();
while (rs.next())
{
String tableName = rs.getString(2);
String name = rs.getString(3);
String poName = rs.getString(4);
if (poName != null)
name += "/" + poName;
comboDrill.addItem(new ValueNamePair (tableName, name));
}
rs.close();
pstmt.close();
}
catch (SQLException e)