ReportExecutionService.Render2 方法

定义

处理特定报表并以指定格式呈现该报表。

public:
 cli::array <System::Byte> ^ Render2(System::String ^ Format, System::String ^ DeviceInfo, ReportExecution2005::PageCountMode PaginationMode, [Runtime::InteropServices::Out] System::String ^ % Extension, [Runtime::InteropServices::Out] System::String ^ % MimeType, [Runtime::InteropServices::Out] System::String ^ % Encoding, [Runtime::InteropServices::Out] cli::array <ReportExecution2005::Warning ^> ^ % Warnings, [Runtime::InteropServices::Out] cli::array <System::String ^> ^ % StreamIds);
public byte[] Render2 (string Format, string DeviceInfo, ReportExecution2005.PageCountMode PaginationMode, out string Extension, out string MimeType, out string Encoding, out ReportExecution2005.Warning[] Warnings, out string[] StreamIds);
member this.Render2 : string * string * ReportExecution2005.PageCountMode * string * string * string * Warning[] * String[] -> byte[]
Public Function Render2 (Format As String, DeviceInfo As String, PaginationMode As PageCountMode, ByRef Extension As String, ByRef MimeType As String, ByRef Encoding As String, ByRef Warnings As Warning(), ByRef StreamIds As String()) As Byte()

参数

Format
String

呈现报表的格式。 此参数映射到呈现扩展插件。 支持的扩展插件包括 XML、NULL、CSV、IMAGE、PDF、HTML4.0、HTML3.2、MHTML、EXCEL 和 Word。 可以通过调用 ListRenderingExtensions() 方法获取的支持扩展插件的列表。

DeviceInfo
String

一个 XML 字符串,其中包含 参数中指定的 Format 呈现扩展插件所需的特定于设备的内容。 DeviceInfo 设置必须作为 DeviceInfo XML 元素的内部元素传递。 有关特定输出格式的设备信息设置的详细信息,请参阅 将设备信息设置传递给呈现扩展插件

PaginationMode
PageCountMode

处理报表的模式。

Extension
String

[out] 与输出流对应的文件扩展名。

MimeType
String

[out] 呈现的报表的 MIME 类型。

Encoding
String

[out] 报表服务器呈现报表内容时使用的编码。

Warnings
Warning[]

[out] Warning 对象的数组,它描述在报表处理过程中出现的所有警告。

StreamIds
String[]

[out] 流标识符。 这些 ID 传递到 RenderStream(String, String, String, String, String) 方法。 可以使用它们来呈现与给定报告相关联的外部资源(图像等)。

返回

Byte[]

采用指定格式的报表的 Byte[] 数组。

注解

下表显示了有关此操作的标头和权限信息。

SOAP 标头用法 (In) TrustedUserHeaderValue

(In) ExecutionHeaderValue

(Out) ServerInfoHeaderValue
本机模式所需权限 在main报表和所有子报表上: ReadProperties ANDExecuteAndView
SharePoint 模式所需权限 在main报表和所有子报表上:<xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems>

Render2 呈现与标头中 ExecutionInfo2 标识的报表执行关联的已处理报表。 如果不存在会话快照,此方法将在满足所有凭据和参数要求) 时执行报告 (,从而创建新的会话快照。 如果由于非查询参数值已更改而需要重新处理报表,则将重新处理快照。

如果执行选项设置为缓存或执行快照,则对 的Render2调用可能会使用现有快照。

如果将报表设置为缓存,并且提供的参数值和凭据匹配,则可能会加载快照的缓存副本,而不是实际处理报表。

如果不满足凭据和参数要求,此方法将返回错误。

如果呈现扩展插件支持指定多个页,则对 的后续调用 Render2 可用于提取报表的其他页。

Render 方法的限制是无法流式传输输出,因此整个文件必须在内存中。

有关执行生命周期的讨论,请参阅 标识执行状态 ,其中包括加载和呈现报表所需步骤的说明。

适用于