BIRT reports can be published in HTML, PDF, XLS, DOC, PPT, or Postscript formats depending on your production needs. The type of the output is specified in your in your 4gl code.
These output formats correspond to a group of rendering classes:
HTMLRenderOption
for HTML,EXCELRenderOption
for XLS,PDFRenderOption
for PDF, and RenderOption
for DOC and ODT.To specify the output format, you must perform these simple steps:
The necessary variable is defined together with other variables of your 4gl program:
DEFINE output_file HTMLRenderOption
or
DEFINE output_file PDFRenderOption
When you initialize creation of the output file, you specify its name:
CALL output_file.SetOutputFileName("birt_no_param.html")
As a result, Lycia will create the output file of the format default for the HTMLRenderOption class and give it the extension .html.
This means that if you define a variable of the HTMLRenderOption class and specify its extension as .abcde:
DEFINE output_file HTMLRenderOption
CALL output_file.SetOutputFileName("birt_no_param.abcde")
you will get a document in the HTML format which extension will be written as .abcde.
You can change the output format in your program - using the setOutputFormat ()
method:
CALL output_file.SetOutputFormat("pdf")
For example, in this case you will get an output file in the .pdf format:
DEFINE output_file HTMLRenderOption
CALL output_file.SetOutputFormat("pdf")
CALL output_file.SetOutputFileName("birt_no_param.pdf")
Thus, the SetOutputFormat ()
method overwrites the default settings of the rendering class.
To open the generated file, you need to have the corresponding software installed on your computer.
For example, if you do not have software able to open PDF files, we will not be able to view your .pdf output.