本文介绍了如何从应用程序加载RDL报告并以横向模式打印它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在磁盘上保存了一个由fyiReporting工具创建的RDL报告(另存为a.RDL),该RDL文件已经包含要打印的数据(2个字段).

我要:

1.从应用程序中打印报告.

2.强制将打印设置为横向模式.

我找不到将.RDL加载为文档的方法-例如,下面的代码将打印一个空文档:

I have an RDL report created by fyiReporting tool already on disk (saved as a.RDL), The RDL file already contains the data to be printed (2 fields).

I want to:

1. Print the report from an application.

2. Force the print to Landscape mode.

I did not find a method to load .RDL as a document - For example, the code below prints an empty document:

PrintDocument pd = new PrintDocument();
pd.DocumentName(parmFileName).
pd.DocumentName = "a.doc"
pd.DefaultPageSettings.Landscape=true;
pd.Print();


我猜上面的代码正在创建一个新文档,而不是加载现有文档.

我想直接从磁盘打印现有的.

请帮忙.

问候,

EK


I guess the above code is creating a new document rather than loading the existing one.

I want to print the existing one from disk directly though.

Please help.

Regards,

EK

推荐答案

PrintDocument _pd = new PrintDocument();
RdlViewer _rdlViewer = new RdlViewer();
_pd.DefaultPageSettings.Landscape = true;
_rdlViewer.ReportName = parmFileName;
_rdlViewer.SourceFile = parmFileName;
_rdlViewer.Print(_pd);



这篇关于如何从应用程序加载RDL报告并以横向模式打印它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 13:13