Installation note : In order to save reports as pictures, XFRX requires two additional libraries to be installed:
If you are not planning to export reports as pictures, you can download a special version of XFRXLIB.FLL (http://www.eqeus.com/files/xfrxlib-nogdiplus.zip), which doesn't require the two dlls mentioned above.
Syntax:
XFRXWriter::SavePicture(tcFilename, tcType, tnFrom [, tnTo [, tnBpp [,
tnJPEGQuality [, tnThumbnailWidth [, tnThumbnailHeight] ] ] ] ])
Parameters:
tcFilename
The name of the file to be generated.
tcType
The format of the picture to be saved. Currently supported
options are: BMP, GIF, JPEG, PNG, TIFF.
tnFrom
The page number to be saved. If TIFF format is being
saved, the parameter specifies the first page to be saved.
tnTo
If TIFF format is being saved, the parameter specifies the
last page to be saved. Ignored otherwise.
tnBpp
Bits per pixel. Currently supported values are 16 or 24.
tnJPEGQuality
Specifies the JPEG compression quality. The range is from 1 -
the lowest quality to 100 - the best quality. The default value is 0 - default
quality. Ignored for other output types.
tnThumbnailWidth
The width of the output picture in pixels.
tnThumbnailHeight
The height of the output picture in pixels.
If this sounds complicated, please have a look at the example, it is actually
quite simple:
loSession=EVALUATE([xfrx("XFRX#INIT")])
*
* nothing is sent as the file name, so only a memory cursor is created
*
lnRetVal =loSession.SetParams(,,,,,,"XFF")
If lnRetVal = 0
loSession.ProcessReport("invoices")
local loXFF
*
* the finalize method returns a XFFWriter object reference,
* which will used to save the pictures
*
loXFF = loSession.finalize()
LOCAL lnI, lnJpegQuality
lnJpegQuality = 80
*
* loXFF.pagecount contains the number of pages if the report that
* was just generated
*
* we are now going to save all pages one by one as separate jpeg pictures
*
FOR lnI = 1 TO loXFF.pagecount
loXFF.savePicture("page"+ALLTRIM(STR(lnI))+".jpg","jpg",lnI,lnI,24,lnJpegQuality)
ENDFOR
MESSAGEBOX("Pictures saved.")
Endif
do locClass with "DE"
which will create the XFRXLIB_DE class library.
Translate the two dialog classes in the class library.Example: this.cntXFRX.setLanguage("DE")
Please note we have added a new library that is required for XFRX to run: XFRXLIB.FLL. Please copy XFRXLIB.FLL to the same directory where HNDLIB.DLL and ZLIB.DLL are.
We'd like to apologize for the 'vertical lines printed slanted' bug. If you're using version 8.0 and have vertical lines in your reports, we recommend upgrading to 8.1.
|
|
XFRX can now optionally generate bookmarks (outlines) into the result document.
Please see Creating
bookmarks (document outline) section in XFRX manual to see how to
define a bookmark.
To enable bookmarks in the HTML output, call
loSession.SetOtherParams("PRINT_BOOKMARKS",.t.)
before calling loSession.ProcessReport()
With bookmarks enabled, XFRX will generate three HTML pages: the main page defining the page frames, the bookmark page and the page with the report output. |
|
When XLS document is generated, vertical and horizontal coordinates of objects
are adjusted - if the difference between two coordinates is smaller than a
certain value, the coordinates are 'aligned'. This approach significantly
reduces the number of rows and columns in the generated document. Now it is possible to define this minimal different. The greater the number is, the lesser number of rows/columns is generated, but if the number is too big, fields might get overlapped and could be left out. Call SetOtherParams method with "HORIZONAL_ADJUSTMENT" or "VERTICAL_ADJUSTMENT" to define the minimal horizontal and/or vertical difference. Example:
loSession.SetOtherParams("HORIZONTAL_ADJUSTMENT",1000) && default value = 76
loSession.SetOtherParams("VERTICAL_ADJUSTMENT",1000) && default value = 180
|
| Pictures now can be rotated the same way as text fields. Please see Object rotation in PDF chapter in the manual to see how to define the rotation. |
The generation process in progress can be canceled by setting the global
variable gnStopXFRX to 1. For example, you can, for example, use it this way:
ON KEY LABEL Esc gnStopXFRX = 1 |
When the generated documents are very long, Word application has problem with
the conversion - it takes very long to convert it. To avoid this problem, XFRX
now can split the generated document into more smaller documents. To set this
up, call SplitDocument() method before calling ProcessReport():
loSession.SplitDocument(tnPages)tnPagesp is the number of pages each of the resulting documents would have. |
To define the page range, call setPageRange() method before calling calling
ProcessReport(). There are two possible ways how to call the setPageRange()
method:
|
You can define the page size of the generated document. The user-defined page
size will override the page size stored in the report. To define the
user-defined page size, call setPaperSize() method with paper width and paper
height as parameters:
setPaperSize(nUDPaperWidth, nUDPaperHeight)The unit is Inch * 10000. |
When generating HTML documents, XFRX makes the page a bit shorter by default
(by 1.65 inches). This is because when printing from the Internet Explorer, two
lines are added to the page - at the top and bottom of the page - as header and
footer. By calling ShrinkHeight() method, you can either suppress this
behaviour by calling:
ShrinkHeight(0)or set your own value by which the page will be shrinked. The unit is Inch * 10000, so to make the page shorter by 2 inches, call: ShrinkHeight(20000)The value sent by ShrinkHeight() method is applied to all output types, not just HTML. |