report_export ()

阅读(2015) 标签: 导出, 文件,

描述:

导出报表/报表组文件。

语法:

report_export(rpt, filePath)

备注:

外部库函数,此外部库的使用请参考润乾报表《程序员参考》。

将报表导出为pdfdocxxlsxxlshtmlmhtrpr文件。缺省导出rpr文件。

导出报表组文件时,仅支持@p@d@x@h选项。

参数:

rpt

ReportObject对象。

filePath

导出文件路径,可以是绝对路径也可以是相对路径。相对路径时,基准目录为配置文件中<home>节点配置的路径。

选项:

@p

导出pdf文件,默认分页。

@d

导出docx文件。

@x

导出xlsx文件,默认分页。

@h

导出html文件。

@n

导出不分页的文件,需结合@p@x一起使用。

@s

导出xls文件,需结合@x一起使用。

@m

导出mht文件,需结合@h一起使用。

@f

导出带公式的Excel文件,需结合@x@xs一起使用。

返回值:

文件导出路径

示例:

 

A

 

1

>report_config("config\\raqsoftConfigReport.xml")

 

2

=report_open("D:\\test.rpx")

 

3

=report_run(A2)

 

4

=report_export@d(A2,"D:\\test.docx")

导出test.docx文件。

5

=report_export@d(A2,"D:\\test")

同上,不写文件后缀时,可自动生成。

6

=report_export@p(A2,"D:\\test")

导出分页的test.pdf文件。

7

=report_export@xn(A2,"D:\\test")

导出不分页的test.xlsx文件。

8

=report_export@xsf(A2,"D:\\test")

导出带公式的test.xls文件。

9

=report_export@hm(A2,"D:\\test")

导出test.mht文件。

10

=report_export(A2,"D:\\test")

导出test.rpr文件。

11

=report_export@pdxh(A2,"D:\\test")

导出分页的test.pdf文件,优先级@p>@d>@x>@h