NC56报表模板开发
开发步骤
- 在项目中先创建报表的功能类,具体功能可后面再实现
- 在<功能注册>中建立功能节点
- 打开<自定义菜单>,新增的功能节点默认在<其他节点>,将建立的功能节点拖拽到对应的菜单下
- 在<报表模板初始化>建立报表模板
- 在<查询模板初始化>建立查询模板
- 将查询模板和报表模板绑定在到注册的功能节点
- 分配权限
import nc.ui.jzfdc.report.PMLinkQueryData;
import nc.ui.jzfdc.report.buttonactoin.IReportButton;
import nc.ui.pm.pub.report.PMReportQueryConditionDLG;
import nc.ui.pm.pub.report.PMReportUI;
import nc.ui.pub.beans.MessageDialog;
import nc.ui.uap.sf.SFClientUtil;
import nc.vo.ml.NCLangRes4VoTransl;
import nc.vo.pub.CircularlyAccessibleValueObject;
import nc.vo.pub.query.ConditionVO;
import nc.vo.querytemplate.TemplateInfo;
/**
* 自由报表开发
* @author mickkong
* @since 2018年9月5日
*
*/
public class ClientUI extends PMReportUI {
public PMReportQueryConditionDLG getQueryDlg2() {
if (queryConditionDLG == null) {
TemplateInfo tempinfo = new TemplateInfo();
tempinfo.setPk_Org(_getCorpID());
tempinfo.setCurrentCorpPk(_getCorpID());
tempinfo.setFunNode(_getModelCode());
tempinfo.setUserid(_getUserID());
tempinfo.setQueryType(getQueryType());
queryConditionDLG = new PMReportQueryConditionDLG(this, null, tempinfo);
queryConditionDLG.setVisibleAdvancePanel(false);
}
return queryConditionDLG;
}
/**
* 查询
*/
public void onQuery() {
if (getQueryDlg2().showModal() == 2) {
return;
}
ConditionVO[] condiVOs = getQueryDlg2().getQryCondEditor().getGeneralCondtionVOs();
StringBuilder querySql = new StringBuilder();
String whereSql = m_qrydlg.getWhereSQL();
vos = getVOBySql(querySql.toString());
if ((vos == null) || (vos.length <= 0)) {
MessageDialog.showHintDlg(this, NCLangRes4VoTransl.getNCLangRes().getStrByID("H103090501", "UPPH103090501-000001"),
NCLangRes4VoTransl.getNCLangRes().getStrByID("H103090501", "UPPH103090501-000002"));
getReportBase().getBillModel().setBodyDataVO(null);
return;
}
setBodyVO(vos, true);
}
/**
* 打印
*/
public void onPrint() {
super.onPrint();
}
/**
* 穿透
*/
public void onPenerate() {
int selectedRow = getReportBase().getBillTable().getSelectedRow();
if (selectedRow == -1) {
MessageDialog.showHintDlg(this, "提示", "请选择需要穿透的数据!");
return;
}
CircularlyAccessibleValueObject selectedVO = vos[selectedRow];
String pk = (String) selectedVO.getAttributeValue("pk");
String vbilltype = (String) selectedVO.getAttributeValue("vbilltype");
PMLinkQueryData linkData = new PMLinkQueryData();
linkData.setBillID(pk);
linkData.setBillType(vbilltype);
if ("9261".equals(vbilltype)) {
//付款申请单 的功能节点:H1030701
SFClientUtil.openLinkedQueryDialog("H1030701", this, linkData);
} else if ("9262".equals(vbilltype)) {
//特殊费用单 的功能节点:H1030702
SFClientUtil.openLinkedQueryDialog("H1030702", this, linkData);
}
}
/**
* 按钮显示
*/
public int[] getReportButtonAry() {
m_buttonArray = new int[] { IReportButton.QueryBtn.intValue(), IReportButton.PrintBtn.intValue() };
return m_buttonArray;
}
public String getPene2NodeInfo() {
return "H103090603";
}
public String _getModelCode() {
return "H103090603";
}
public String getTitle() {
return "自由报表开发";
}
public CircularlyAccessibleValueObject[] getVos() {
return vos;
}
public void setVos(CircularlyAccessibleValueObject[] vos) {
this.vos = vos;
}
public String getPk_project() {
return pk_project;
}
public void setPk_project(String pk_project) {
this.pk_project = pk_project;
}
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
public String getPk_billtype() {
return pk_billtype;
}
public void setPk_billtype(String pk_billtype) {
this.pk_billtype = pk_billtype;
}
public String getVapplyreason() {
return vapplyreason;
}
public void setVapplyreason(String vapplyreason) {
this.vapplyreason = vapplyreason;
}
private PMReportQueryConditionDLG queryConditionDLG;
private CircularlyAccessibleValueObject[] vos;
private String pk_project;
private String month;
private String pk_billtype;
private String vapplyreason;
}