简单帐表双击打开直接SQL账表
[HotUpdate]
[Description("产品总金额打开材料")]
public class CpzjeOpenFormRpt : AbstractSysReportPlugIn
{
//public override void EntityRowDoubleClick(EntityRowClickEventArgs e)
//{
// base.EntityRowDoubleClick(e);
// var view = this.View as ISQLReportView;
// if (view == null)
// {
// return;
// }
// // 双击数据行时,打开新账表
// if (view.SelectedDataRows != null && view.SelectedDataRows.Length > 0)
// {
// var billNo = view.SelectedDataRows[0]["单据编号"].ToString();
// var showParameter = new SQLReportShowParameter();
// showParameter.FormId = "k10b1919206334052afef29d7b91cd318";
// showParameter.CustomParams["CustomFilterRow"] = "#FBillNo#,单据编号," + billNo;
// this.View.ShowForm(showParameter);
// }
//}
public override void CellDbClick(CellEventArgs Args)
{
base.CellDbClick(Args);
BillShowParameter billShowParameter = new BillShowParameter();
ReportHeader header = Args.Header;
string text = header.FieldName.ToString().Trim();
//获取行FID GetCurrentRowValue
string billno = ((ISysReportViewService)this.View).GetCurrentRowValue(text).ToString();
switch (text)
{
case "Fcpbm":
//SetBillOpenParam(billno, "UVLJ_CPYLZX", ref billShowParameter);
// ShowListForm("UVLJ_CPYLZX", billno);
var showParameter = new SQLReportShowParameter();
showParameter.FormId = "UVLJ_CPYLZX";
showParameter.CustomParams["CustomFilterRow"] = "@Fcpbm@,产品编码," + billno;
this.View.ShowForm(showParameter);
break;
}
if (billShowParameter.PKey != null && billShowParameter.PKey.Trim() != "" && billShowParameter.PKey.Trim() != "0")
{
View.ShowForm(billShowParameter);
billno = string.Empty;
billShowParameter = new BillShowParameter();
}
}
直接SQL账表:
namespace Kingdee.Bos.TestPoOrderTable
{
[Description("【产品采购入库价】接收参数"), HotUpdate]
public class CGZXJ : AbstractSysReportPlugIn
{
public override void OnLoad(EventArgs e)
{
base.OnLoad(e);
var view = this.View as ISQLReportView;
if (view == null)
{
return;
}
var customFilterRow = this.View.OpenParameter.GetCustomParameter("CustomFilterRow") as string;
if (string.IsNullOrWhiteSpace(customFilterRow))
{
return;
}
var args = customFilterRow.Split(',');
var key = args[0];
var name = args[1];
var value = args[2];
var filterRow = view.Model.FilterParameter.SQLFilterRows.FirstOrDefault(o => o.FilterField.KeyWord.EqualsIgnoreCase(key));
if (filterRow == null)
{
var sqlFilterField = new SQLFilterField();
sqlFilterField.Caption = new LocaleValue(name);
sqlFilterField.KeyWord = key;
sqlFilterField.Editor = new JSONObject();
sqlFilterField.Editor.Put("xtype", "textfield");
filterRow = new SQLFilterRow();
filterRow.FilterField = sqlFilterField;
view.Model.FilterParameter.SQLFilterRows.Add(filterRow);
}
// 给指定过滤条件赋值
filterRow.Value = value;
}
}
}