报表的显示界面代码如下:
/**
* output package name
*/
package com.kingdee.eas.custom.client;
import java.awt.event.*;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import org.apache.log4j.Logger;
import com.kingdee.bos.ctrl.kdf.table.IRow;
import com.kingdee.bos.BOSException;
import com.kingdee.bos.ui.face.CoreUIObject;
import com.kingdee.bos.ctrl.kdf.table.ISortManager;
import com.kingdee.bos.ctrl.kdf.table.KDTable;
import com.kingdee.bos.dao.query.SQLExecutorFactory;
import com.kingdee.eas.custom.MaterialLittleInfo;
import com.kingdee.eas.custom.SupplierArchiveInfo;
import com.kingdee.eas.framework.report.ICommRptBase;
import com.kingdee.eas.framework.report.client.CommRptBaseConditionUI;
import com.kingdee.eas.framework.report.util.RptParams;
import com.kingdee.jdbc.rowset.IRowSet;
/**
* output class name
*/
public class TestStatement extends AbstractTestStatement implements ISortManager
{
private static final Logger logger = CoreUIObject.getLogger(TestStatement.class);
// Tnumber Tname TCreditCode Taddress TBUSLICDATE TSupStatus TrealName Tphone TcataLoginId TcataLoginName TparentId TparentName
private static final String[] rowcont={"Tnumber","Tname","TCreditCode","Taddress","TBUSLICDATE","TSupStatus","TrealName","Tphone","TcataLoginId","TcataLoginName","TparentId","TparentName"};
/**
* output class constructor
*/
public TestStatement() throws Exception
{
super();
}
/**
* output storeFields method
*/
public void storeFields()
{
super.storeFields();
}
/**
* output actionPageSetup_actionPerformed
*/
public void actionPageSetup_actionPerformed(ActionEvent e) throws Exception
{
super.actionPageSetup_actionPerformed(e);
}
/**
* output actionExitCurrent_actionPerformed
*/
public void actionExitCurrent_actionPerformed(ActionEvent e) throws Exception
{
super.actionExitCurrent_actionPerformed(e);
}
/**
* output actionHelp_actionPerformed
*/
public void actionHelp_actionPerformed(ActionEvent e) throws Exception
{
super.actionHelp_actionPerformed(e);
}
/**
* output actionAbout_actionPerformed
*/
public void actionAbout_actionPerformed(ActionEvent e) throws Exception
{
super.actionAbout_actionPerformed(e);
}
/**
* output actionOnLoad_actionPerformed
*/
public void actionOnLoad_actionPerformed(ActionEvent e) throws Exception
{
super.actionOnLoad_actionPerformed(e);
}
/**
* output actionSendMessage_actionPerformed
*/
public void actionSendMessage_actionPerformed(ActionEvent e) throws Exception
{
super.actionSendMessage_actionPerformed(e);
}
/**
* output actionCalculator_actionPerformed
*/
public void actionCalculator_actionPerformed(ActionEvent e) throws Exception
{
super.actionCalculator_actionPerformed(e);
}
/**
* output actionExport_actionPerformed
*/
public void actionExport_actionPerformed(ActionEvent e) throws Exception
{
super.actionExport_actionPerformed(e);
}
/**
* output actionExportSelected_actionPerformed
*/
public void actionExportSelected_actionPerformed(ActionEvent e) throws Exception
{
super.actionExportSelected_actionPerformed(e);
}
/**
* output actionRegProduct_actionPerformed
*/
public void actionRegProduct_actionPerformed(ActionEvent e) throws Exception
{
super.actionRegProduct_actionPerformed(e);
}
/**
* output actionPersonalSite_actionPerformed
*/
public void actionPersonalSite_actionPerformed(ActionEvent e) throws Exception
{
super.actionPersonalSite_actionPerformed(e);
}
/**
* output actionProcductVal_actionPerformed
*/
public void actionProcductVal_actionPerformed(ActionEvent e) throws Exception
{
super.actionProcductVal_actionPerformed(e);
}
/**
* output actionExportSave_actionPerformed
*/
public void actionExportSave_actionPerformed(ActionEvent e) throws Exception
{
super.actionExportSave_actionPerformed(e);
}
/**
* output actionExportSelectedSave_actionPerformed
*/
public void actionExportSelectedSave_actionPerformed(ActionEvent e) throws Exception
{
super.actionExportSelectedSave_actionPerformed(e);
}
/**
* output actionKnowStore_actionPerformed
*/
public void actionKnowStore_actionPerformed(ActionEvent e) throws Exception
{
super.actionKnowStore_actionPerformed(e);
}
/**
* output actionAnswer_actionPerformed
*/
public void actionAnswer_actionPerformed(ActionEvent e) throws Exception
{
super.actionAnswer_actionPerformed(e);
}
/**
* output actionRemoteAssist_actionPerformed
*/
public void actionRemoteAssist_actionPerformed(ActionEvent e) throws Exception
{
super.actionRemoteAssist_actionPerformed(e);
}
/**
* output actionPopupCopy_actionPerformed
*/
public void actionPopupCopy_actionPerformed(ActionEvent e) throws Exception
{
super.actionPopupCopy_actionPerformed(e);
}
/**
* output actionHTMLForMail_actionPerformed
*/
public void actionHTMLForMail_actionPerformed(ActionEvent e) throws Exception
{
super.actionHTMLForMail_actionPerformed(e);
}
/**
* output actionExcelForMail_actionPerformed
*/
public void actionExcelForMail_actionPerformed(ActionEvent e) throws Exception
{
super.actionExcelForMail_actionPerformed(e);
}
/**
* output actionHTMLForRpt_actionPerformed
*/
public void actionHTMLForRpt_actionPerformed(ActionEvent e) throws Exception
{
super.actionHTMLForRpt_actionPerformed(e);
}
/**
* output actionExcelForRpt_actionPerformed
*/
public void actionExcelForRpt_actionPerformed(ActionEvent e) throws Exception
{
super.actionExcelForRpt_actionPerformed(e);
}
/**
* output actionLinkForRpt_actionPerformed
*/
public void actionLinkForRpt_actionPerformed(ActionEvent e) throws Exception
{
super.actionLinkForRpt_actionPerformed(e);
}
/**
* output actionPopupPaste_actionPerformed
*/
public void actionPopupPaste_actionPerformed(ActionEvent e) throws Exception
{
super.actionPopupPaste_actionPerformed(e);
}
/**
* output actionToolBarCustom_actionPerformed
*/
public void actionToolBarCustom_actionPerformed(ActionEvent e) throws Exception
{
super.actionToolBarCustom_actionPerformed(e);
}
/**
* output actionCloudFeed_actionPerformed
*/
public void actionCloudFeed_actionPerformed(ActionEvent e) throws Exception
{
super.actionCloudFeed_actionPerformed(e);
}
/**
* output actionCloudShare_actionPerformed
*/
public void actionCloudShare_actionPerformed(ActionEvent e) throws Exception
{
super.actionCloudShare_actionPerformed(e);
}
/**
* output actionCloudScreen_actionPerformed
*/
public void actionCloudScreen_actionPerformed(ActionEvent e) throws Exception
{
super.actionCloudScreen_actionPerformed(e);
}
/**
* output actionXunTongFeed_actionPerformed
*/
public void actionXunTongFeed_actionPerformed(ActionEvent e) throws Exception
{
super.actionXunTongFeed_actionPerformed(e);
}
/**
* output actionRefresh_actionPerformed
*/
public void actionRefresh_actionPerformed(ActionEvent e) throws Exception
{
super.actionRefresh_actionPerformed(e);
}
/**
* output actionQuery_actionPerformed
*/
public void actionQuery_actionPerformed(ActionEvent e) throws Exception
{
super.actionQuery_actionPerformed(e);
}
/**
* output actionPrint_actionPerformed
*/
public void actionPrint_actionPerformed(ActionEvent e) throws Exception
{
super.actionPrint_actionPerformed(e);
}
/**
* output actionPrintPreview_actionPerformed
*/
public void actionPrintPreview_actionPerformed(ActionEvent e) throws Exception
{
super.actionPrintPreview_actionPerformed(e);
}
/**
* output actionChart_actionPerformed
*/
public void actionChart_actionPerformed(ActionEvent e) throws Exception
{
super.actionChart_actionPerformed(e);
}
@Override
protected RptParams getParamsForInit() {
// TODO Auto-generated method stub
try {
return this.getQueryDialogUserPanel().getCustomCondition();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return new RptParams();
}
@Override
protected CommRptBaseConditionUI getQueryDialogUserPanel() throws Exception {
// TODO Auto-generated method stub
return new TestFiltration();
}
@Override
protected ICommRptBase getRemoteInstance() throws BOSException {
// TODO Auto-generated method stub
return null;
}
@Override
protected KDTable getTableForPrintSetting() {
// TODO Auto-generated method stub
return this.kDTable1 ;
}
@Override
protected void query() {
// TODO Auto-generated method stub
this.kDTable1.removeRows();
this.kDTable1.setEditable(false);
IRowSet iRowSet;
// Tnumber Tname TCreditCode Taddress TBUSLICDATE TSupStatus TrealName Tphone TcataLoginId TcataLoginName TparentId TparentName
String sql="select os.CFFnumber Tnumber,os.CFFname Tname,os.CFCreditCode TCreditCode, os.CFFaddress Taddress, os.CFFBUSLICDATE TBUSLICDATE,(case os.CFFSupStatus when '1' then '临时' when '2' then '合格' when '3' then '冻结'else '0' end) TSupStatus,"+
"ocr.CFRealName TrealName,ocr.CFPhone Tphone,"+
"mbig.CFFnumber TcataLoginId,mbig.CFFname TcataLoginName,"+
"msub.CFFnumber TparentId,msub.CFFname TparentName"+
" from CT_CUS_SupplierArchive as os "+
" inner join CT_CUS_SupplierArchiveEntries as ocr on os.FID=ocr.FParentID"+
" inner join CT_CUS_SupplierArchiveEntries2 as om on os.FID=om.FParentID"+
" inner join CT_CUS_MaterialLittle as msub on om.CFParentIdID=msub.FID"+
" inner join CT_CUS_MaterialBig as mbig on om.CFCataLoginIdID=mbig.FID where 1=1";
SupplierArchiveInfo testNum=(SupplierArchiveInfo) params.getObject("tnumber");
MaterialLittleInfo TestLillterNum=(MaterialLittleInfo) params.getObject("tparentId");
if(this.params.getObject("tFBUSLICDATE")!=null){
SimpleDateFormat data=new SimpleDateFormat("yyyy-MM-dd");
String TestDate=data.format(this.params.getObject("tFBUSLICDATE"));
if(!"".equals(TestDate)){
sql+=" and os.CFFBUSLICDATE='"+TestDate+"'";
}
}
if(testNum!=null){
sql+=" and os.CFFnumber='"+testNum+"'";
}
if(TestLillterNum!=null){
sql+=" and msub.CFFnumber='"+TestLillterNum+"'";
}
System.out.println("================"+sql);
try {
kDTable1.checkParsed();
//执行sql语句
iRowSet = SQLExecutorFactory.getRemoteInstance(sql).executeSQL();
while (iRowSet.next()) {
IRow irow=this.kDTable1.addRow();
for(int i=0;i<rowcont.length;i++){
if(iRowSet.getObject(rowcont[i])!=null || "".equals(iRowSet.getObject(rowcont[i]))){
//把值添加到界面
irow.getCell(i).setValue(iRowSet.getObject(rowcont[i]));
}
}
}
} catch (BOSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void sort(int arg0) {
// TODO Auto-generated method stub
}
@Override
public void sort(int arg0, int arg1) {
// TODO Auto-generated method stub
}
}
报表的过滤条件
/**
* output package name
*/
package com.kingdee.eas.custom.client;
import java.awt.event.*;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import org.apache.log4j.Logger;
import com.kingdee.bos.ctrl.kdf.table.IRow;
import com.kingdee.bos.BOSException;
import com.kingdee.bos.ui.face.CoreUIObject;
import com.kingdee.bos.ctrl.kdf.table.ISortManager;
import com.kingdee.bos.ctrl.kdf.table.KDTable;
import com.kingdee.bos.dao.query.SQLExecutorFactory;
import com.kingdee.eas.custom.MaterialLittleInfo;
import com.kingdee.eas.custom.SupplierArchiveInfo;
import com.kingdee.eas.framework.report.ICommRptBase;
import com.kingdee.eas.framework.report.client.CommRptBaseConditionUI;
import com.kingdee.eas.framework.report.util.RptParams;
import com.kingdee.jdbc.rowset.IRowSet;
/**
* output class name
*/
public class TestStatement extends AbstractTestStatement implements ISortManager
{
private static final Logger logger = CoreUIObject.getLogger(TestStatement.class);
// Tnumber Tname TCreditCode Taddress TBUSLICDATE TSupStatus TrealName Tphone TcataLoginId TcataLoginName TparentId TparentName
private static final String[] rowcont={"Tnumber","Tname","TCreditCode","Taddress","TBUSLICDATE","TSupStatus","TrealName","Tphone","TcataLoginId","TcataLoginName","TparentId","TparentName"};
/**
* output class constructor
*/
public TestStatement() throws Exception
{
super();
}
/**
* output storeFields method
*/
public void storeFields()
{
super.storeFields();
}
/**
* output actionPageSetup_actionPerformed
*/
public void actionPageSetup_actionPerformed(ActionEvent e) throws Exception
{
super.actionPageSetup_actionPerformed(e);
}
/**
* output actionExitCurrent_actionPerformed
*/
public void actionExitCurrent_actionPerformed(ActionEvent e) throws Exception
{
super.actionExitCurrent_actionPerformed(e);
}
/**
* output actionHelp_actionPerformed
*/
public void actionHelp_actionPerformed(ActionEvent e) throws Exception
{
super.actionHelp_actionPerformed(e);
}
/**
* output actionAbout_actionPerformed
*/
public void actionAbout_actionPerformed(ActionEvent e) throws Exception
{
super.actionAbout_actionPerformed(e);
}
/**
* output actionOnLoad_actionPerformed
*/
public void actionOnLoad_actionPerformed(ActionEvent e) throws Exception
{
super.actionOnLoad_actionPerformed(e);
}
/**
* output actionSendMessage_actionPerformed
*/
public void actionSendMessage_actionPerformed(ActionEvent e) throws Exception
{
super.actionSendMessage_actionPerformed(e);
}
/**
* output actionCalculator_actionPerformed
*/
public void actionCalculator_actionPerformed(ActionEvent e) throws Exception
{
super.actionCalculator_actionPerformed(e);
}
/**
* output actionExport_actionPerformed
*/
public void actionExport_actionPerformed(ActionEvent e) throws Exception
{
super.actionExport_actionPerformed(e);
}
/**
* output actionExportSelected_actionPerformed
*/
public void actionExportSelected_actionPerformed(ActionEvent e) throws Exception
{
super.actionExportSelected_actionPerformed(e);
}
/**
* output actionRegProduct_actionPerformed
*/
public void actionRegProduct_actionPerformed(ActionEvent e) throws Exception
{
super.actionRegProduct_actionPerformed(e);
}
/**
* output actionPersonalSite_actionPerformed
*/
public void actionPersonalSite_actionPerformed(ActionEvent e) throws Exception
{
super.actionPersonalSite_actionPerformed(e);
}
/**
* output actionProcductVal_actionPerformed
*/
public void actionProcductVal_actionPerformed(ActionEvent e) throws Exception
{
super.actionProcductVal_actionPerformed(e);
}
/**
* output actionExportSave_actionPerformed
*/
public void actionExportSave_actionPerformed(ActionEvent e) throws Exception
{
super.actionExportSave_actionPerformed(e);
}
/**
* output actionExportSelectedSave_actionPerformed
*/
public void actionExportSelectedSave_actionPerformed(ActionEvent e) throws Exception
{
super.actionExportSelectedSave_actionPerformed(e);
}
/**
* output actionKnowStore_actionPerformed
*/
public void actionKnowStore_actionPerformed(ActionEvent e) throws Exception
{
super.actionKnowStore_actionPerformed(e);
}
/**
* output actionAnswer_actionPerformed
*/
public void actionAnswer_actionPerformed(ActionEvent e) throws Exception
{
super.actionAnswer_actionPerformed(e);
}
/**
* output actionRemoteAssist_actionPerformed
*/
public void actionRemoteAssist_actionPerformed(ActionEvent e) throws Exception
{
super.actionRemoteAssist_actionPerformed(e);
}
/**
* output actionPopupCopy_actionPerformed
*/
public void actionPopupCopy_actionPerformed(ActionEvent e) throws Exception
{
super.actionPopupCopy_actionPerformed(e);
}
/**
* output actionHTMLForMail_actionPerformed
*/
public void actionHTMLForMail_actionPerformed(ActionEvent e) throws Exception
{
super.actionHTMLForMail_actionPerformed(e);
}
/**
* output actionExcelForMail_actionPerformed
*/
public void actionExcelForMail_actionPerformed(ActionEvent e) throws Exception
{
super.actionExcelForMail_actionPerformed(e);
}
/**
* output actionHTMLForRpt_actionPerformed
*/
public void actionHTMLForRpt_actionPerformed(ActionEvent e) throws Exception
{
super.actionHTMLForRpt_actionPerformed(e);
}
/**
* output actionExcelForRpt_actionPerformed
*/
public void actionExcelForRpt_actionPerformed(ActionEvent e) throws Exception
{
super.actionExcelForRpt_actionPerformed(e);
}
/**
* output actionLinkForRpt_actionPerformed
*/
public void actionLinkForRpt_actionPerformed(ActionEvent e) throws Exception
{
super.actionLinkForRpt_actionPerformed(e);
}
/**
* output actionPopupPaste_actionPerformed
*/
public void actionPopupPaste_actionPerformed(ActionEvent e) throws Exception
{
super.actionPopupPaste_actionPerformed(e);
}
/**
* output actionToolBarCustom_actionPerformed
*/
public void actionToolBarCustom_actionPerformed(ActionEvent e) throws Exception
{
super.actionToolBarCustom_actionPerformed(e);
}
/**
* output actionCloudFeed_actionPerformed
*/
public void actionCloudFeed_actionPerformed(ActionEvent e) throws Exception
{
super.actionCloudFeed_actionPerformed(e);
}
/**
* output actionCloudShare_actionPerformed
*/
public void actionCloudShare_actionPerformed(ActionEvent e) throws Exception
{
super.actionCloudShare_actionPerformed(e);
}
/**
* output actionCloudScreen_actionPerformed
*/
public void actionCloudScreen_actionPerformed(ActionEvent e) throws Exception
{
super.actionCloudScreen_actionPerformed(e);
}
/**
* output actionXunTongFeed_actionPerformed
*/
public void actionXunTongFeed_actionPerformed(ActionEvent e) throws Exception
{
super.actionXunTongFeed_actionPerformed(e);
}
/**
* output actionRefresh_actionPerformed
*/
public void actionRefresh_actionPerformed(ActionEvent e) throws Exception
{
super.actionRefresh_actionPerformed(e);
}
/**
* output actionQuery_actionPerformed
*/
public void actionQuery_actionPerformed(ActionEvent e) throws Exception
{
super.actionQuery_actionPerformed(e);
}
/**
* output actionPrint_actionPerformed
*/
public void actionPrint_actionPerformed(ActionEvent e) throws Exception
{
super.actionPrint_actionPerformed(e);
}
/**
* output actionPrintPreview_actionPerformed
*/
public void actionPrintPreview_actionPerformed(ActionEvent e) throws Exception
{
super.actionPrintPreview_actionPerformed(e);
}
/**
* output actionChart_actionPerformed
*/
public void actionChart_actionPerformed(ActionEvent e) throws Exception
{
super.actionChart_actionPerformed(e);
}
@Override
protected RptParams getParamsForInit() {
// TODO Auto-generated method stub
try {
return this.getQueryDialogUserPanel().getCustomCondition();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return new RptParams();
}
@Override
protected CommRptBaseConditionUI getQueryDialogUserPanel() throws Exception {
// TODO Auto-generated method stub
return new TestFiltration();
}
@Override
protected ICommRptBase getRemoteInstance() throws BOSException {
// TODO Auto-generated method stub
return null;
}
@Override
protected KDTable getTableForPrintSetting() {
// TODO Auto-generated method stub
return this.kDTable1 ;
}
@Override
protected void query() {
// TODO Auto-generated method stub
this.kDTable1.removeRows();
this.kDTable1.setEditable(false);
IRowSet iRowSet;
// Tnumber Tname TCreditCode Taddress TBUSLICDATE TSupStatus TrealName Tphone TcataLoginId TcataLoginName TparentId TparentName
String sql="select os.CFFnumber Tnumber,os.CFFname Tname,os.CFCreditCode TCreditCode, os.CFFaddress Taddress, os.CFFBUSLICDATE TBUSLICDATE,(case os.CFFSupStatus when '1' then '临时' when '2' then '合格' when '3' then '冻结'else '0' end) TSupStatus,"+
"ocr.CFRealName TrealName,ocr.CFPhone Tphone,"+
"mbig.CFFnumber TcataLoginId,mbig.CFFname TcataLoginName,"+
"msub.CFFnumber TparentId,msub.CFFname TparentName"+
" from CT_CUS_SupplierArchive as os "+
" inner join CT_CUS_SupplierArchiveEntries as ocr on os.FID=ocr.FParentID"+
" inner join CT_CUS_SupplierArchiveEntries2 as om on os.FID=om.FParentID"+
" inner join CT_CUS_MaterialLittle as msub on om.CFParentIdID=msub.FID"+
" inner join CT_CUS_MaterialBig as mbig on om.CFCataLoginIdID=mbig.FID where 1=1";
SupplierArchiveInfo testNum=(SupplierArchiveInfo) params.getObject("tnumber");
MaterialLittleInfo TestLillterNum=(MaterialLittleInfo) params.getObject("tparentId");
if(this.params.getObject("tFBUSLICDATE")!=null){
SimpleDateFormat data=new SimpleDateFormat("yyyy-MM-dd");
String TestDate=data.format(this.params.getObject("tFBUSLICDATE"));
if(!"".equals(TestDate)){
sql+=" and os.CFFBUSLICDATE='"+TestDate+"'";
}
}
if(testNum!=null){
sql+=" and os.CFFnumber='"+testNum+"'";
}
if(TestLillterNum!=null){
sql+=" and msub.CFFnumber='"+TestLillterNum+"'";
}
System.out.println("================"+sql);
try {
kDTable1.checkParsed();
//执行sql语句
iRowSet = SQLExecutorFactory.getRemoteInstance(sql).executeSQL();
while (iRowSet.next()) {
IRow irow=this.kDTable1.addRow();
for(int i=0;i<rowcont.length;i++){
if(iRowSet.getObject(rowcont[i])!=null || "".equals(iRowSet.getObject(rowcont[i]))){
//把值添加到界面
irow.getCell(i).setValue(iRowSet.getObject(rowcont[i]));
}
}
}
} catch (BOSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void sort(int arg0) {
// TODO Auto-generated method stub
}
@Override
public void sort(int arg0, int arg1) {
// TODO Auto-generated method stub
}
}
效果如下: