你可以叫「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