CR306000 上的打印按钮可打印案例数据
Print button on CR306000 to print case data
我在 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();
}
}
我还没有测试过上面的内容,但这应该可以帮助你完成大部分工作。
我在 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();
}
}
我还没有测试过上面的内容,但这应该可以帮助你完成大部分工作。