NC56報表模板開發

NC56報表模板開發

開發步驟

  1. 在項目中先創建報表的功能類,具體功能可後面再實現
  2. 在<功能註冊>中建立功能節點
  3. 打開<自定義菜單>,新增的功能節點默認在<其他節點>,將建立的功能節點拖拽到對應的菜單下
  4. 在<報表模板初始化>建立報表模板
  5. 在<查詢模板初始化>建立查詢模板
  6. 將查詢模板和報表模板綁定在到註冊的功能節點
  7. 分配權限
    效果圖
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;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章