Acumatica CR306000上的打印按钮用于打印病例数据

Acumatica CR306000上的打印按钮用于打印病例数据,acumatica,Acumatica,我在CR306000上有一个自定义按钮,通过调用一个自定义报告来打印当前加载的案例信息。导航URL当前设置为: ~/Frames/ReportLauncher.aspx?ID=Inquirycase.rpx&CASEID=#### 我需要自定义编程来指定要替换的当前案例ID,但不知道在哪里以及如何引用该自定义按钮并修改其属性。请帮忙。谢谢。您可以将名为“CaseID”的报告参数添加到报告中,并使用以下代码使用AEF扩展名调用它,如下所示: public class CRCaseMain

我在CR306000上有一个自定义按钮,通过调用一个自定义报告来打印当前加载的案例信息。导航URL当前设置为:

~/Frames/ReportLauncher.aspx?ID=Inquirycase.rpx&CASEID=####

我需要自定义编程来指定要替换的当前案例ID,但不知道在哪里以及如何引用该自定义按钮并修改其属性。请帮忙。谢谢。

您可以将名为“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提供的定制项目界面生成按钮单击事件。我添加了图形扩展代码,以包括如何从按钮调用代码的示例。请注意,如果已经有“报告”菜单按钮,最好将“报告”按钮添加到此菜单按钮。我不知道这个图形/页面是否包含一个,但上面的示例包括AddMenuAction示例(如果需要)。如果您这样做,您可能需要将按钮上的PXUIField设置为visible=false非常感谢,Brendan。