Report Generator for Realbasic
Home

About
Structure
Screenshots
License
Documentation
Download
Contact

Donation

Sponsor

Please contact me to become a sponsor und get your logo here

Documentation

TurboReport is working with few functions. Each function exist to times. One for Milimeter (MM) and one for Inch (INCH). The are working same. The Documentation will only handle MM functions. You only need to replace MM to INCH and can use the functions the same way.


First you have to drag the TurboReport Component on your window after adding Turboreport class to your project. Then you can use following functions:

You will need to pixel for any function! All sizes will work with MM or INCH.

General functions


createReportMM(resolution as Integer, width as double, height as double, margin_top as double, margin_left as double, margin_right as double, margin_bottom as double, header as Picture, footer as picture)

Creates a report. You can set resolution, page height (width and height), the margins for the page (margin_top,left,right,bottom), static header and static footer. When your report won't have any header or footer use nil.


finishReportMM(percent as Integer)

Call this function when your report is finish after put some contents on it. After this you can show or print that report.


showReportMM

Use this function to show the report in your window. You can set the size of the report in percent (for exmaple 50 for 50% or 150 for 150%).


printReportDialogMM

Use this function toprint the report with PrinterDialog.


printReportMM

This function prints the report without PrinterDialog.


Normal functions


writeLineMM(colour as Color, height as double)

Create a line in a needed color and needed height


writeTextMM(text as String, colour as Color, size as Integer, font as String, align as String, is_bold as boolean, is_underline as boolean, is_italic as boolean)

Draw a text to the report. Beside the text, you need to set the color, textsize, font, align und set if the text is bold, underlined for italic. You have to use all parameters.


writeBreakMM(height as double, ignore_on_pagewrap as boolean)

Create an break. It moves the y coordidate to the bottom, without any contents. When you set the second parameter false and through this functions a new page will created, the differenz of the break will start on the next page. Otherwise the new content will start on the top of the next page.


writeImageMM(image as Picture, align as String, min_puffer as double)

Draws a picture on the report in a needed alignment. You can set a min_puffer to prevent that a picture will be directly on the bottom of a page. This is important when you need text under the image. With min_puffer you can say you need this space under the image, otherwise do a pagewrap now.


TableStartMM(padding as double, border as double, border_color as Color, default as Dictionary)

Set configuration for the table. Set padding, border and border color. Set all default values for a cell to the default dictionary.

' set default table settings
default.Value("width") = 20
default.Value("halign") = "left"
default.Value("valign") = "top"
default.Value("text") = ""
default.Value("font") = "Arial"
default.Value("size") = 10
default.Value("color") = RGB(0, 0, 0)
default.Value("background") = RGB(255, 255, 255)
default.Value("is_bold") = false
default.Value("is_italic") = false
default.Value("is_underline") = false
default.Value("min_height") = 1
default.Value("border_left") = true
default.Value("border_right") = true
default.Value("border_top") = true
default.Value("border_bottom") = true


writeTableMM(columns() as Dictionary)
writeTableMM(paramarray columns as Dictionary)

Create a new line for the table. You decide if you add an array of Dictionary or any number a Dictionary to the function. The dictionary contains all information you needed. You can set all values which you used in the default configuration. When any value is not use, it will use the value from the default settings.


TableEndMM

Use this function when you are finish with your table.


writeNextpageMM

Use this function when you like wo do a page wrap manually.



XY functions


writeImageXYMM(image as Picture, x as double, y as double)

Create an picture on a needed x and y position. (Positions in MM(INCH))


writeTextXYMM(text as String, colour as Color, size as Integer, font as String, align as String, is_bold as boolean, is_underline as boolean, is_italic as boolean, x as double, y as double, max_width as double)

Draws a text on a needed position. It has the same functions as the normal function and add with x and y position. Last you can set the max width of the text. (Positions in MM(INCH))



getMaxHeightMM

Get max height of the page in MM(INCH). This is the height without headers, footer and margins.


getMaxWidthMM

Get max width of the page in MM(INCH). This is the width without margins.


getY1MM

Get the start Y position of the last element of the normal functions.


getY1XYMM

Get the start Y position of the last element of the XY functions.


getY2MM

Get the end Y position of the last element of the normal functions.


getY2XYMM

Get the end Y position of the last element of the XY functions.


followXYMM(type as string)

Set the last or highest Y position is new position for normal functions. type can be "last" or "highest".



getErrorCodeMM

Get the error code of the last function called.


getErrorDescMM

Get the error description of the last function called.


Error Codes

100 = "no error"
101 = "make no sense"
200 = "report not created yet"
201 = "report not finished yet"
300 = "unknown type"
301 = "resolution invalid"
302 = "page size invalid"
303 = "margin invalid"
304 = "height invalid"
305 = "image invalid"
306 = "align invalid"
307 = "puffer invalid"
308 = "coordinate invalid"
309 = "font invalid"
310 = "width too small"
311 = "width invalid"
400 = "parameter missing"




(c) by Compredia GmbH | Impressum