你可以叫“CaseID”报表参数添加到您的报告中并使用AEF扩展这样使用下面的代码调用它:
public class CRCaseMaintExtension : PXGraphExtension<CRCaseMaint>
{
public override void Initialize()
{
base.Initialize();
//if adding to an existing menu button do that here...
// Example:
//Base.Inquiry.AddMenuAction(this.CustomReportButton);
}
public PXAction<CRCase> CustomReportButton;
[PXButton]
[PXUIField(DisplayName = "Custom Report", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
public virtual IEnumerable customReportButton(PXAdapter adapter)
{
if (Base.Case.Current != null)
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["CaseID"] = Base.Case.Current.CaseID.ToString();
//enter in your report id/number here
string reportNumber = "Inquirycase";
//opens the report using the defined parameters
throw new PXReportRequiredException(parameters, reportNumber, "Custom Report");
}
return adapter.Get();
}
}
我没有测试以上,但这应该最让你那里的路。
感谢您的回复。我了解您提供的代码,但不知道如何从定制项目界面Acumatica提供的按钮点击事件。 – Woody
我添加了图形扩展代码以包含如何从一个按钮调用代码的示例。请注意,如果已经有报告菜单按钮,最好将报告按钮添加到此菜单按钮。我不知道这个图形/页面是否包含一个,但是如果需要的话,上面的这个例子包含了AddMenuAction示例。如果你这样做,你可能需要在你的按钮上设置你的PXUIField为visible = false – Brendan
非常感谢,Brendan。 – Woody