BF [ 1761891 ] Included print format with report view attached issue

http://sourceforge.net/tracker/index.php?func=detail&aid=1761891&group_id=176962&atid=879332
This commit is contained in:
teo_sarca 2007-07-27 10:11:09 +00:00
parent 54a8771182
commit 5537e69a4e
1 changed files with 11 additions and 5 deletions

View File

@ -23,11 +23,13 @@ import org.compiere.model.*;
import org.compiere.util.*;
/**
* Data Engine.
* Creates SQL and laods data into PrintData (including totals/etc.)
* Data Engine.
* Creates SQL and laods data into PrintData (including totals/etc.)
*
* @author Jorg Janke
* @version $Id: DataEngine.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
* @author Jorg Janke
* @version $Id: DataEngine.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
*
* @author Teo Sarca, SC ARHIPAC SERVICE SRL - BF [ 1761891 ]
*/
public class DataEngine
{
@ -79,7 +81,7 @@ public class DataEngine
//
if (format.getAD_ReportView_ID() != 0)
{
String sql = "SELECT t.AD_Table_ID, t.TableName, rv.Name "
String sql = "SELECT t.AD_Table_ID, t.TableName, rv.Name, rv.WhereClause "
+ "FROM AD_Table t"
+ " INNER JOIN AD_ReportView rv ON (t.AD_Table_ID=rv.AD_Table_ID) "
+ "WHERE rv.AD_ReportView_ID=?"; // 1
@ -92,6 +94,10 @@ public class DataEngine
{
tableName = rs.getString(2); // TableName
reportName = rs.getString(3);
// Add WhereClause restriction from AD_ReportView - teo_sarca BF [ 1761891 ]
String whereClause = rs.getString(4);
if (!Util.isEmpty(whereClause))
query.addRestriction(whereClause);
}
rs.close();
pstmt.close();