IDEMPIERE-1725 List of available print formats should be filtered with report view in report viewer
This commit is contained in:
parent
1024db2d14
commit
596670afd5
|
@ -595,7 +595,9 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
||||||
int AD_Window_ID = Env.getContextAsInt(Env.getCtx(), m_reportEngine.getWindowNo(), "_WinInfo_AD_Window_ID", true);
|
int AD_Window_ID = Env.getContextAsInt(Env.getCtx(), m_reportEngine.getWindowNo(), "_WinInfo_AD_Window_ID", true);
|
||||||
if (AD_Window_ID == 0)
|
if (AD_Window_ID == 0)
|
||||||
AD_Window_ID = Env.getZoomWindowID(m_reportEngine.getQuery());
|
AD_Window_ID = Env.getZoomWindowID(m_reportEngine.getQuery());
|
||||||
|
|
||||||
|
int reportViewID = m_reportEngine.getPrintFormat().getAD_ReportView_ID();
|
||||||
|
|
||||||
// fill Report Options
|
// fill Report Options
|
||||||
String sql = MRole.getDefault().addAccessSQL(
|
String sql = MRole.getDefault().addAccessSQL(
|
||||||
"SELECT * "
|
"SELECT * "
|
||||||
|
@ -605,6 +607,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
||||||
+ "AND IsActive='Y' "
|
+ "AND IsActive='Y' "
|
||||||
//End of Added Lines
|
//End of Added Lines
|
||||||
+ (AD_Window_ID > 0 ? "AND (AD_Window_ID=? OR AD_Window_ID IS NULL) " : "")
|
+ (AD_Window_ID > 0 ? "AND (AD_Window_ID=? OR AD_Window_ID IS NULL) " : "")
|
||||||
|
+ (reportViewID > 0 ? "AND AD_ReportView_ID=? " : "")
|
||||||
+ "ORDER BY Name",
|
+ "ORDER BY Name",
|
||||||
"AD_PrintFormat", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
|
"AD_PrintFormat", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
|
||||||
int AD_Table_ID = m_reportEngine.getPrintFormat().getAD_Table_ID();
|
int AD_Table_ID = m_reportEngine.getPrintFormat().getAD_Table_ID();
|
||||||
|
@ -613,9 +616,12 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pstmt = DB.prepareStatement(sql, null);
|
pstmt = DB.prepareStatement(sql, null);
|
||||||
pstmt.setInt(1, AD_Table_ID);
|
int idx = 1;
|
||||||
|
pstmt.setInt(idx++, AD_Table_ID);
|
||||||
if (AD_Window_ID > 0)
|
if (AD_Window_ID > 0)
|
||||||
pstmt.setInt(2, AD_Window_ID);
|
pstmt.setInt(idx++, AD_Window_ID);
|
||||||
|
if (reportViewID > 0)
|
||||||
|
pstmt.setInt(idx++, reportViewID);
|
||||||
rs = pstmt.executeQuery();
|
rs = pstmt.executeQuery();
|
||||||
while (rs.next())
|
while (rs.next())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue