我可以向导出的Excel文件添加自定义标头吗? [英] Can I add a custom header to exported Excel file?

查看:70
本文介绍了我可以向导出的Excel文件添加自定义标头吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio中创建了一个自定义查询报告,并启用了导出到Excel按钮。该页面上有一个简单的日期过滤器。

I created a custom inquiry report in Visual Studio with the export to Excel button enabled. The page has a simple date filter.

所有值均已正确导出,但是我们需要将过滤器信息添加到文档中。这应该是可能的,因为常规查询会在工作表的顶部打印参数。

All the values are exported correctly but we need to add the filter information to the document. This should be possible as Generic Inquiries print the parameters in the top of the sheet.

如何将过滤器信息添加到文档工作表中或将选择的日期添加到工作表中文件名?

How can I either add the filter info to the document sheet or add the selected date to the filename?

注意:这是针对 Acumatica 自定义的

Note: This is for an Acumatica custom inquiry page using the Acumatica Framework.

推荐答案

要将参数和结果从查询屏幕导出到Excel,您应该装饰BLC

To export both parameters and results from an inquiry screen to Excel, you should decorate your BLC with DashboardTypeAttribute or one of its successors, like TableAndChartDashboardTypeAttribute and TableDashboardTypeAttribute.

为InventorySummaryEnq BLC服务的库存摘要屏幕(IN401000)用TableAndChartDashboardType装饰,以将参数和结果导出到Excel:

The InventorySummaryEnq BLC serving Inventory Summary screen (IN401000) is decorated with TableAndChartDashboardType to export parameters and results to Excel:

[PX.Objects.GL.TableAndChartDashboardType]
public class InventorySummaryEnq : PXGraph<InventorySummaryEnq>
{       
    ...
}   

当前支持的小部件类型(DashboardType属性的参数):

Currently supported widget types (parameters of the DashboardType attribute):

0 - Table (default)
1 - Wiki article
2 - Task
6 - Table with owner and workgroup
7 - Calendar
8 - Generic Inquiry
20 - Chart

这篇关于我可以向导出的Excel文件添加自定义标头吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆