report_export()

Read(2449) Label: output, docx,

Description:

Export a report/report group file.

Syntax:

report_export(rpt, filePath)

Note:

The external library function (See The Programmer’s Guide to RaqReport) exports the report as a pdf, docx, xlsx/xls, html/mht or rpr file; by default it outputs the report as a rpr file.

 

It supports @p, @d, @x and @h only when exporting a report group file.

Parameter:

rpt

A report object

filePath

The URL through which a report is exported, which can be an absolute path or a relative path; when it is the relative path, the base directory is the path specified in the <home> node in the configuration file

Option:

@p

Export as a pdf file, paginated by default

@d

Export as a docx file

@x

Export as an xlsx file, paginated by default

@h

Export as an html file

@n

Export as a non-paginated file; need to work with @p or @x

@s

Export as an xlsx file; need to work with @x

@m

Export as an mht file; need to work with @h

@f

Export as an Excel file with formulas; need to work with @x or @xs

Return value:

A file URL through which the report is exported

Example:

 

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")

Export as test.docx.

5

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

Same as above; automatically export as a docx file when the file extension is absent.

6

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

Export as a paginated test.pdf.

7

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

Export as a non-paginated test.xlsx.

8

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

Export as test.xls with formulas.

9

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

Export as test.mht.

10

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

Export as test.rpr.

11

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

Export as a paginated test.pdf; the order of priorities of the options is @p>@d>@x>@h.