Libreoffice Report Builder Grafico

download Libreoffice Report Builder Grafico

of 10

Transcript of Libreoffice Report Builder Grafico

  • 8/20/2019 Libreoffice Report Builder Grafico

    1/24

    Base Handbook

    Chapter 6

    Reports

  • 8/20/2019 Libreoffice Report Builder Grafico

    2/24

    Copyright

    This document is Copyright © 2013 by its contributors as listed below. You may distribute it andormodi!y it under the terms o! either the "#$ "eneral %ublic &icense'http(www.gnu.orglicensesgpl.html)* +ersion 3 or later* or the Creati+e Commons ,ttribution&icense 'http(creati+ecommons.orglicensesby3.0)* +ersion 3.0 or later.

    ,ll trademarks within this guide belong to their legitimate owners.

    Contributors

    -obert "rokop!Ha/el -ussman

    ost &angeean Hollis eber

    ochen chi!!ers

    Feedback

    %lease direct any comments or suggestions about this document to(documentationglobal.libreo!!ice.org .

    Caution4+erything you send to a mailing list* including your email address and any otherpersonal in!ormation that is in the mail* is publicly archi+ed and can not be deleted.

    Acknowledgments

    This chapter is based on an original "erman document and was translated by Ha/el -ussman.

    Publication date and software version

    %ublished 22 ,pril 2013. Based on &ibre5!!ice 3.6.

    Note for Mac users

    ome keystrokes and menu items are di!!erent on a 7ac !rom those used in indows and &inu8.The table below gi+es some common substitutions !or the instructions in this chapter. 9or a moredetailed list* see the application Help.

    Windows or Linux Mac equivalent Effect  

    Tools > ptions menu

    selection

    !ibreffice > Preferences ,ccess setup options

    Right-click Control+click   5pens a conte8t menu

    Ctrl (Control)   z (Command) $sed with other keys

    F5 Shift  :z:F5 5pens the #a+igator

    F11   z:T  5pens the tyles and 9ormatting window

    Docmentation for !i"re#ffice is a$aila"le at  http%&&'''li"reofficeorg&get-help&docmentation

    http://www.gnu.org/licenses/gpl.htmlhttp://creativecommons.org/licenses/by/3.0/mailto:[email protected]:[email protected]://www.libreoffice.org/get-help/documentationhttp://www.libreoffice.org/get-help/documentationhttp://www.libreoffice.org/get-help/documentationhttp://www.gnu.org/licenses/gpl.htmlhttp://creativecommons.org/licenses/by/3.0/mailto:[email protected]

  • 8/20/2019 Libreoffice Report Builder Grafico

    3/24

    Contents

    Copyright """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" #

    Contributors ............................................................................................................................... 2

    9eedback ................................................................................................................................... 2

    ,cknowledgments ...................................................................................................................... 2%ublication date and so!tware +ersion ....................................................................................... 2

    Note for Mac users """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" #

    Creating reports using the $eport %uilder """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" &

    The user interface of the $eport %uilder """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" &

    "eneral properties o! !ields ...................................................................................................... 11pecial properties o! graphical controls ............................................................................... 13;ncorporating charts into the report ...................................................................................... 1<

    =ata properties o! !ields ........................................................................................................... 16

    Functions in the $eport %uilder """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" '(4ntering !ormulas ..................................................................................................................... 1>

    $ser?de!ined !unctions ............................................................................................................. 22

    9ormula entry !or a !ield ........................................................................................................... 23

    Conditional print ....................................................................................................................... 23

    Conditional !ormatting .............................................................................................................. 23

    Reports

  • 8/20/2019 Libreoffice Report Builder Grafico

    4/24

    Creating reports using the $eport %uilder

    -eports are used to present data in a way that makes it readily understood by people withoutknowledge o! the database. -eports can(

    @ %resent data in easy?to?read tables

    @ Create charts !or displaying data

    @ 7ake it possible to use data !or printing labels

    @ %roduce !orm letters such as bills* recall notices* or noti!ications to people Aoining or lea+ingan association

    To create a report reuires care!ul preparatory work on the underlying database. $nlike a !orm* areport cannot include subreports and thus incorporate additional data sources. #either can a reportpresent di!!erent data elements than those that are a+ailable in the underlying data source* as a!orm can do using list bo8es.

    -eports are best prepared using ueries. ;n this way all +ariables can be determined. ;n particular*i! sorting within the report is reuired* always use a uery that makes pro+ision !or sorting. Thismeans that ueries in direct & mode should be a+oided under these conditions. ;! you must use

    a uery o! this type in your database* you can carry out the sort by !irst creating a +iew !rom theuery. uch a +iew can always be sorted and !iltered using the graphical user inter!ace '"$;) o!Base.

    Caution

    hen using the -eport Builder* you should !reuently sa+e your work during editing.;n addition to sa+ing within the -eport Builder itsel! a!ter each signi!icant step* youshould also sa+e the whole database.

    =epending on the +ersion o! &ibre5!!ice that you are using* the -eport Builder cansometimes crash during editing.

    The !unctionality o! completed reports is not a!!ected e+en i! they were created underanother +ersion* in which the problem does not occur.

    The user interface of the $eport %uilder

    To start the -eport Builder !rom within Base* use $eports > Create $eport in )esign *iew.

    The initial window o! the -eport Builder '9igure 1) shows three parts. 5n the le!t is the currentdi+ision o! the report into %age header* =etail* and %age !ooterD in the middle are thecorresponding areas where the content will be enteredD and* to the right* the properties o! theseregions are shown.

    ,t the same time the ,dd !ields dialog is displayed. This dialog corresponds to the one in !orm

    creation. ;t creates !ields with their corresponding !ield labels.ithout content !rom the database* a report has no proper !unction. 9or this reason* the dialogopens at the =ata tab. Here you can set the content o! the reportD in the e8ample it is the*ie'  E ReportRecall table. ,s long as Analy+e ,-! command is set to ,es* the report can besubAected to sorting* grouping* and !iltering. , +iew has been chosen !or the basis o! this report* sono !ilter will be appliedD it has already been included in the uery underlying the +iew.

    Reports

  • 8/20/2019 Libreoffice Report Builder Grafico

    5/24

    Figre 1% .nitial 'indo' of Report /ilder 

    Two output !ormats !or reports are a+ailable !or selection( #DF Te0t docment  'a riter document)or #DF Spreadsheet  'a Calc document). ;! you Aust want a tabular +iew o! your data* the Calcdocument should de!initely be chosen !or your report. ;t is signi!icantly !aster to create and is alsoeasier to !ormat subseuently* as there are !ewer options to consider and columns can easily bedragged to the reuired width a!terward.

    By de!ault* the -eport Builder looks !or its data source in the !irst table in the database. Thisensures that at least a test o! the !unctions is possible. , data source has to be chosen be!ore thereport can be pro+ided with !ields.

    The -eport Builder pro+ides a lot o! additional buttons* so the table on the ne8t page shows thebuttons with their descriptions. The buttons !or aligning elements are not !urther described in thischapter. They are use!ul !or uick adAustment o! !ields in a single area o! the -eport Builder* but inprinciple e+erything can be done by direct editing o! !ield properties.

    The ser interface of the Report /ilder 5

  • 8/20/2019 Libreoffice Report Builder Grafico

    6/24

    Buttons for editing content Buttons for aligning elements

    ust as with !orms* it is help!ul to use the appropriate na+igator. o* !or e8ample* a careless click atthe start o! the -eport Builder can make it di!!icult to !ind the properties o! the data !or the report.uch data may only be reachable through the report na+igator. &e!t?click on Report  and theproperties o! the report are once more accessible.

    6 Reports

  • 8/20/2019 Libreoffice Report Builder Grafico

    7/24

    ;nitially the na+igator shows* in addition to the +isible sections o! the document '%age header*"roups* =etail* and %age !ooter)* the possibility o! including !unctions. "roups can be used* !ore8ample* to assign all media being recalled to the person who has borrowed them* to a+oidmultiple recall notices. =etail areas show the records belonging to a group. 9unctions are used !orcalculations such as sums.

    To obtain use!ul output in the abo+e e8ample* the content o! the +iew must be reproduced with

    suitable grouping. 4ach reader should be linked to the recall notices !or all o! their loaned ando+erdue media.

    *iew > ,orting and .rouping or the corresponding button starts the grouping !unction.

    Figre % Sorting and 2roping

    Here grouping and sorting are by the Reader3ame !ield. ,dditional !ields could also be included

    in the table abo+e. 9or e8ample* i! you also want to group and sort by the !oanDate !ield* choosethis as the second line.

    =irectly under the table* se+eral grouping actions are a+ailable !or selection. You can mo+e a groupup or down the list or completely remo+e it. ,s only one group is necessary !or the planned report*9igure 2 shows only the Delete symbol at the e8treme right o! the group actions as a+ailable.

    The Sorting property is sel!?e8planatory.

    hen the entry was created* the le!t side o! the -eport Builder immediately showed a new di+ision.#e8t to the !ield description Reader3ame you can now see 4eader . This section is !or the groupheader in the report. The header might contain the name o! the person who will recei+e the recallnotice. ;n this case there is no group !ooter. uch a !ooter could contain the !ine due* or the placeand current date and a space !or the signature o! the person sending the notice.

    The ser interface of the Report /ilder  

  • 8/20/2019 Libreoffice Report Builder Grafico

    8/24

    By de!ault there is a new group !or each +alue. o i! the Reader3ame changes* a new group isstarted. ,lternati+ely you can group by initial letter. ;n the case o! a recall notice* howe+er* this would put all readers with the same initial together in one group. chmidt* chul/e* and chulte would recei+e a common recall notice* which would be uite pointless in this e8ample.

    hen grouping by initial letter* you can additionally speci!y how many letters later the ne8t groupshould begin. 5ne can imagine !or e8ample a grouping !or a small telephone directory. ,ccording

    to the si/e o! the contact list* one might imagine a grouping on e+ery second initial letter. o , andB would !orm the !irst group* then C and =* and so on.

    , group can be set either to be kept together with the !irst details section* or* as !ar as possible* asa complete group. By de!ault* this option is set to 3o . 9or recall notices* you would probably wantthe group to be arranged so that a separate page is printed !or each person who is to recei+e arecall letter. ;n another menu* you can choose that each group 'in this case* each reader name) be!ollowed by a page break be!ore dealing with the ne8t +alue.

    ;! you ha+e chosen to ha+e a group header and perhaps a group !ooter* these elements will appearas sections in the report na+igator under the corresponding !ieldname Reader3ame. Here too youha+e the possibility o! using !unctions* which will then be limited to this group.

    To add !ields* use the dd field  !unction* as with !orms. Howe+er in this case* the label and the !ieldcontents are not tied together. Both can be independently mo+ed* changed in si/e and dragged todi!!erent sections.

    Figre % Report design for e0ample recall notice

    9igure 3 shows the report design !or the recall notice. ;n the page header is the heading &ibre5!!ice &ibrary* inserted as a label !ield. Here you could also ha+e a letterhead with a logo* since theincorporation o! graphics is possible. The !act that this le+el is called 7age header does not implythat there is no space abo+e it. That depends on the page settingsD i! an upper margin has been

    set* it lies abo+e the page header.

    8 Reports

  • 8/20/2019 Libreoffice Report Builder Grafico

    9/24

    Reader3ame header  is the header !or the grouped and sorted data. ;n the !ields that are tocontain data* the names o! the corresponding data !ields are shown in light gray. o* !or e8ample*the +iew underlying the report has a !ield named ,ddress* containing the complete address o! therecipient with street and town. To put this into a single !ield reuires line breaks in the uery. Youcan use CHAR(13) to create them.

    48ample(

    SELECT "FirstName"||' '||"LastName"||CHAR(13)||"Street"||' '||"No"||CHAR13||"Postcode"||' '||"Town" FR! "FirstName"

    The 9T#D,() !ield represents a built?in !unction* which inserts the current date into this position.

    ;n Reader3ame header * in addition to the salutation* we see the column headings !or the!ollowing table +iew. These elements should appear only once* e+en i! se+eral media are listed.

    ;n the background o! these column headers is a gray rectangle* which also ser+es as a !rame !orthe data.

    The details area is repeated as o!ten as there are separate records with the same Reader3ame data. Here are listed all media that ha+e not been returned on time. There is another rectangle inthe background to !rame the contents. This rectangle is !illed with white rather than gray.

    Note

    ;n principle &ibre5!!ice pro+ides !or the possibility o! adding hori/ontal and +erticallines. These are displayed in design mode. ,t present they do not appear when thereport is complete.

    These lines ha+e the !urther disad+antage that they are interpreted only as hairlines.They can be reproduced better i! rectangles are used. et the background o! therectangle to black and the si/e to* !or e8ample* 1Fcm wide and 0.03cm high. This will create a hori/ontal line with a thickness o! 0.03cm and a length o! 1Fcm.

    The Reader3ame footer  closes the letter with a greeting !ormula and an area !or the signature.The !ooter is so de!ined that an additional page break will occur a!ter this area. ,lso* contrary to thede!ault setup* it is speci!ied that this area should be kept together in all cases. ,!ter all* it wouldlook rather odd i! many recall notices had the signature on a separate page.

    :eep together  re!ers here to the page break. ;! you want the content o! a record to be kept togetherindependently o! the break* this is only possible at present i! the record is not read in as =etails butis used as the basis !or a grouping. You can choose :eep together 9 ,es* but it does not workD the=etails area becomes separated. You ha+e to put the content o! =etails in a separate group tokeep it together.

    , built?in !unction is used !or calculating the total !ines.

    The ser interface of the Report /ilder ;

  • 8/20/2019 Libreoffice Report Builder Grafico

    10/24

    Below is what an actual recall notice would look like. The details area contains 6 media that thereader has taken out on loan. The group !ooter contains the total !ine due.

    Note

    -eports !or single records can also e8tend o+er more than one page. The si/e o! thereport is uite separate !rom the page si/e. Howe+er* stretching the details area o+ermore than one page can lead to !aulty breaks. Here the -eport Builder still hasproblems in calculating the spacing correctly. ;! both grouping areas and graphicalelements are included* this may result in unpredictable si/es !or certain areas.

    o !ar indi+idual elements can be mo+ed to positions outside the si/e o! a singlepage only with the mouse and cursor keys. The properties o! the elements alwayspro+ide the same ma8imum distance !rom the upper corner o! any area that lies onthe !irst page.

    1< Reports

  • 8/20/2019 Libreoffice Report Builder Grafico

    11/24

    .eneral properties of fields

    There are only three types o! !ield !or the presentation o! data. ;n addition to te8t !ields 'which*contrary to their name* can also contain numbers and !ormatting)* there is also a !ield type that cancontain images !rom the database. The chart !ield displays a summary o! data.

    ,s with !orms* !ields are gi+en names. By de!ault* the name is that o! the underlying database !ield.

    , !ield can be set to be in+isible. This may seem a bit pointless in the case o! !ields but is use!ul !orgroup headers and !ooters* which may be reuired to carry out other !unctions o! the grouping without containing anything that needs to be displayed.

    ;! 7rint repeated $ales is deacti+ated* display o! the !ield is inhibited when a !ield with the samecontent is loaded directly be!ore. This !unctions correctly only !or data !ields that contain te8t.#umeric !ields or date !ields ignore the deacti+ation instruction* &abel !ields are completely !adedout when deacti+ated* e+en i! they occur only once.

    ;n the -eport Builder the display o! certain content can be inhibited by using Conditional 7rint=0pression or the +alue o! the !ield can be used as a base !or !ormatting te8t and background.7ore on conditional e8pressions is gi+en in GConditional print on page 23.

    The setting !or the mouse wheel has no e!!ect because report !ields are not editable. ;t seems to bea le!to+er !rom the !orm de!inition dialog.

    The 7rint >hen 2rop Change !unction could not be reproduced in reports either.

    ;! the background is not de!ined as transparent* a background color can be de!ined !or each !ield.

    The other entries deal with the internal content o! the !ield in uestion. This co+ers the !ont '!or !ontcolor* !ont weight* and so on* see 9igure

  • 8/20/2019 Libreoffice Report Builder Grafico

    12/24

    Figre % Fonts% Character Settings

    Figre 5% Formatting nm"ers

    1 Reports

  • 8/20/2019 Libreoffice Report Builder Grafico

    13/24

    Special properties of graphical controls

    , graphical control can contain graphics !rom both inside and outside the database. $n!ortunatelyit is not possible at present to store a graphic such as a logo permanently in Base. There!ore it isessential that the graphic is a+ailable in the search path* e+en when you are presented with thechoice o! embedding rather than linking images and the !irst !ield Set p as link  can be set 'literally

    closed) to a corresponding planned !unctionality. This is one o! se+eral !unctions that are planned!or Base and are in the "$; but ha+e not actually been implemented yetIso the buttons andcheckbo8es ha+e no e!!ect.

    ,lternati+ely* o! course* a graphic can be stored in the database itsel! and so becomes a+ailableinternally. But in that case* it must be accessible through one o! the !ields in the uery underlyingthe report.

    To take up an e0ternal graphic? use the selection button beside the 2raphic !ield to load it. To loada graphical database !ield* speci!y the !ield under the Data tab.

    The +ertical alignment setting does not seem to ha+e any e!!ect during the design stage. hen youcall up the report* howe+er* the graphic appears in the correct position.

    hen scaling* you can select 3o* :eep aspect ratio* or tom Si@e. This corresponds to thesettings !or a !orm(

    @ 3o( The image is not !itted to the control. ;! it is too large* a cropped +ersion is shown. Theoriginal image is not a!!ected by this.

    @ :eep aspect ratio( The image is !itted to the control but not distorted.

    @  tomatic si@e( The image is !itted to the control and in some cases may be distorted.

    The ser interface of the Report /ilder 1

  • 8/20/2019 Libreoffice Report Builder Grafico

    14/24

    Incorporating charts into the report 

    You can insert charts into a report by using the corresponding control or with /nsert > $eportcontrols > Chart. , chart is the only way to reproduce data that is not !ound in the data sourcespeci!ied !or the report. , chart can there!ore be seen as a kind o! subreport* but also as a !ree?standing component o! the report.

    You must draw the place !or the chart using the mouse. ;n the general properties* in addition to the!amiliar !ields* you can choose a Chart tApe 'see the corresponding types in Calc). ;n addition* youcan set a ma8imum number o! records !or the pre+iew* which will gi+e an impression o! how thechart will !inally look.

    Charts can be !ormatted in the same way as in Calc 'double?click on the chart). 9or !urtherin!ormation* see the description in the !i"re#ffice Calc 2ide.

    The chart is linked in the =ata section with the necessary data !ields. Here* in a 7edia Top 10 liste8ample* the chart shows the !reuency with which particular media are borrowed. The uery4ditor is used to create a suitable & command* as you would do !or a listbo8 in a !orm. The !irstcolumn in the uery will be used to pro+ide the labels !or the +ertical bars in the chart* while thesecond column yields the total number o! loan transactions* shown in the height o! the bars.

    ;n the e8ample abo+e* the chart shows +ery little at !irst* since only limited test loans were carriedout be!ore the & command was issued.

    The chart on the ne8t page* !rom the membership database o! a society '"erman(7itgliederstatistik)* has been prepared !rom a uery that needs to be entered in direct & mode*as the graphical user inter!ace does not understand it. 9or this reason 3o '"erman( #ein) hasbeen chosen !or nalA@e SB! command * a choice that e8cludes any !iltering and sorting with theinternal tools o! the -eport Builder. These !ields are there!ore grayed out. ;n the data properties o!the chart* -uery '"erman( ,b!rage) has been entered.

    9ields are linked together in the same way as !or a main !orm with a sub!orm. ;n the report itsel!*the age distributions o! male and !emale members are listed in tabular !orm. They are grouped bygender. 4ach group is gi+en its own chart. o that the chart only contains data !or the correctgender* the 2ender  !ield '"erman( "eschlecht) in the report is linked to the 2ender in the chart.

    1 Reports

  • 8/20/2019 Libreoffice Report Builder Grafico

    15/24

    Figre 6% !inked fields for a chart? same as in forms This e0ample is not translated? "ecase the

    report is nt part of the e0ample data"ase

    Note

    The creation o! charts works at present only in Jersions 3.3.8 and 3.

  • 8/20/2019 Libreoffice Report Builder Grafico

    16/24

    The Conter counts only the records that will occur either in the group or in the report as a whole. ;!the counter is inserted into the =etails area* each record will be pro+ided with a running number.The numbering will apply only to records in the group or in the whole report.

    9inally the detailed ser-defined Fnction is a+ailable. ;t may happen that the -eport Builder itsel!chooses this +ariant* i! a calculation has been reuested* but !or some reason it cannot correctlyinterpret the data source.

    Functions in the $eport %uilder

    The -eport Builder pro+ides a +ariety o! !unctions* both !or displaying data and !or settingconditions. ;! these are not su!!icient* user?de!ined !unctions can be created using simplecalculation steps* which are particularly use!ul in group !ooters and summaries.

    0ntering formulas

    The -eport Builder is based on the %entaho -eport Builder. , small part o! its documentation is at  http(wiki.pentaho.comdisplay-eportingL.:-eport:=esigner:9ormula:48pressions.

    , !urther source is the peci!ications !or the 5pen9ormula tandard(http(www.oasis?open.orgcommitteesdownload.php1>M2>open!ormula?spec?200>0221.html

    Basic principles(

    9ormulas start with an euals sign.   =

    -e!erences to data !ields are placed in suarebrackets.

    [Field name]

    ;! the data !ields contain special characters'including spaces)* the !ield name must also beenclosed in uotes.

    ["This fieldname should be inquotes"]

    Te8t entry must always be in double uotes.   "Text ent!"

    The !ollowing operators are allowed. :* ?*

    N '7ultiplication)* '=i+ision)*O 'di+ide the preceding number by 100)*P '-aise to the power o! the !ollowing number)*Q 'concatenate te8t)*

    The !ollowing relationships are possible.   = #$ # #= $ $=

    -ound brackets are allowed.   ( )

    =e!ault error message.   %A '#ot a+ailable)

    4rror message !or an empty !ield that wasde!ined as a number.

    %a% '%erhaps Knot a numberKR)

    16 Reports

    http://wiki.pentaho.com/display/Reporting/9.+Report+Designer+Formula+Expressionshttp://www.oasis-open.org/committees/download.php/16826/openformula-spec-20060221.htmlhttp://wiki.pentaho.com/display/Reporting/9.+Report+Designer+Formula+Expressionshttp://wiki.pentaho.com/display/Reporting/9.+Report+Designer+Formula+Expressionshttp://www.oasis-open.org/committees/download.php/16826/openformula-spec-20060221.html

  • 8/20/2019 Libreoffice Report Builder Grafico

    17/24

    ,ll !ormula input applies only to the current record. -elationships with pre+ious or !ollowing recordsare there!ore not possible.

    #e8t to the date !ield is a button with three dots whene+er a !ormula can be entered. This buttonstarts the 9unction i/ard.

    Howe+er there are !ar !ewer !unctions than in Calc. 7any !unctions do ha+e Calc eui+alents.There the i/ard calculates the result o! the !unction directly.

    The 9unction i/ard does not always work per!ectly. 9or instance* te8t entries are not taken up with double uotes. Howe+er* only entries with double uotes are processed when starting the!unction.

    The !ollowing !unctions are a+ailable(

    Function Description

    Date and ime Functions

    &AT' %roduces a +alid date !rom numeric +alues !or the year* the monthand the day.

    &AT'&F(D, E #3T4 E ,=R)

    -eturns the total years* months or days between two date +alues.

    &AT'A*+' Con+erts an ,merican date entry in te8t !orm 'uoted) into a date+alue. The ,merican +ariant that is produced can then bere!ormatted.

    &A, -eturns the day o! the month !or a gi+en date.=,Y'S=ate !ield)

    Fnctions in the Report /ilder 1  

  • 8/20/2019 Libreoffice Report Builder Grafico

    18/24

    &A,- -eturns the number o! days between two dates.

    H.+R -eturns the hours o! a gi+en time in 2

  • 8/20/2019 Libreoffice Report Builder Grafico

    19/24

    ATA% Calculates the arctangent o! a number.'since &5 3.6)

    ATA%4 Calculates the arctangent o! an 8?coordinate and a y?coordinate.'since &5 3.6)

    A'RA5' "i+es the a+erage o! the entered +alues. 'occurs twice in the &53.3.< 9ormula i/ard)

    A'RA5'A "i+es the a+erage o! the entered +alues. Te8t is treated as /ero.'since &5 3.6)

    C.- ,rgument is the angle in radians whose cosine is to be calculated.'since &5 3.6)

    ''% -ounds a positi+e number up or a negati+e number down to thene8t e+en integer.

    '26 Calculates the e8ponential !unction 'Base XeX).

    'since &5 3.6)

    *% Calculates the natural logarithm o! a number.'since &5 3.6)

    *.517 Calculates the logarithm o! a number 'Base X10X).'since &5 3.6)

    /A2 -eturns the ma8imum o! a series o! numbers.

    /A2A -eturns the ma8imum +alue in a row. ,ny te8t is set to /ero.

    /% -eturns the smallest o! a series o! +alues.

    /%A -eturns the minimum +alue in a row. ,ny te8t is set to /ero.

    /.& -eturns the remainder !or a di+ision when you enter the di+idendand di+isor.

    .&& -ounds a positi+e number up or a negati+e number down to thene8t odd integer.

    6 "i+es the +alue o! the number XX.'since &5 3.6)

    6.0'R -aises the base to the power o! the e8ponent.

    'ince &5 3.6)

    -% Calculates the sine o! a number.'since &5 3.6)

    -8RT Calculates the suare root o! a number.'since &5 3.6)

    -+/ ums a list o! numeric +alues

    -+/A ums a list o! numeric +alues. Te8t and Yes#o !ields are allowed.$n!ortunately this !unction 'still) ends with an error message.'since &5 3.6)

    AR Calculates the +ariance* starting !rom a sample.'since &5 3.6)

    Fnctions in the Report /ilder 1;

  • 8/20/2019 Libreoffice Report Builder Grafico

    20/24

    ext functions

    '2ACT hows i! two te8t strings are e8actly eual.

    F%& "i+es the o!!set o! a te8t string within another string.

    *'FT The speci!ied number o! characters o! a te8t string are reproducedstarting !rom the le!t.

    *'% "i+es the number o! characters in a te8t string.

    *.0'R Con+erts te8t to lower case.

    /'--A5' 9ormats the +alue into the gi+en output !ormat.'since &5 3.6)

    /& The speci!ied number o! characters o! a te8t string are reproducedstarting !rom a speci!ied character position.

    R'6*AC' -eplaces a substring by a di!!erent substring. The starting positionand the length o! the substring to be replaced must be gi+en.

    R'6T-epeats te8t a speci!ied number o! times.

    R5HT The speci!ied number o! characters o! a te8t string are reproducedstarting !rom the right.

    -+-TT+T' -eplaces speci!ic parts o! a gi+en te8t string by new te8t.,dditionally you can speci!y which o! se+eral occurrences o! thetarget string are to be replaced.

    T -eturns the te8t* or an empty te8t string i! the +alue is not te8t '!ore8ample a number).

    T'2T Con+ersion o! numbers or times into te8t.

    TR/ -emo+es leading spaces and terminal spaces* and reduces multiplespaces to a single space.

    +%CHAR Con+erts a $nicode decimal number into a $nicode character. 9ore8ample* 1L> becomes XZX 'XZX has the he8adecimal +alue 00C in decimals without leading /eros).

    +%C.&' Con+erts a $nicode character into a $nicode decimal number.XZX becomes 1L>.

    +66'R -eturns a te8t string in upper case.

    +R*'%C.&' Con+erts a gi+en te8t into one that con!orms to a +alid $-&. ;! noparticular standard is speci!ied* ;5?MM6L?1 is !ollowed..

    Information functions

    CH..-' The !irst argument is an inde8* !ollowed by a list o! +alues. The +aluerepresented by the inde8 is returned.CH..-'(49"A::le"9"6ea"9"anana") returns 6ea.CH..-'([a;e

  • 8/20/2019 Libreoffice Report Builder Grafico

    21/24

    C.+%T*A% Counts the empty !ields in a region.

    HA-CHA%5'& Checks i! the named column has changed. Howe+er no in!ormationabout the column is pro+ided.

    %&'2 orks with regions 'since &5 3.6).

    -*A% Tests i! the !ield is #$&& 'empty).

    -'RR -eturns T-$4 i! the entry has an error other than #,.-'RR(1?7) gi+es TR+'

    -'RR.R &ike ;4--* e8cept that #, also returns T-$4.

    -''% Tests i! a number is e+en.

    -*.5CA*(.ST!#2)

    Tests i! this is a Yes#o +alue.-*.5CA*(TR+'()) or -*.5CA*(FA*-'()) yield TR+'*Te8t +alues such as -*.5CA*("TR+'") yield FA*-'.

    -%A Tests i! the e8pression is an error o! type #,.

    -%.%T'2T Tests i! the +alue is not te8t.-%+/'R Tests i! something is numeric.

    -%+/'R(1) yields TR+'* -%+/'R("1") yields FA*-'

    -.&& Tests i! a number is an odd number.

    -R'F Tests i! something is a !ield re!erence.-R'F([Fieldname]) yields TR+'* -R'F(1) yields FA*-'.

    -T'2T Tests i! the content o! the !ield is te8t.

    %A(3*)

    -eturns the error code %A.

    A*+' 'since &5 3.6)

    "ser defined 

    C-ARRA, Con+erts CJ te8t into an array. 'since &5 3.6)

    C-T'2T Con+erts an array into CJ te8t. 'since &5 3.6)

    %.R/A*@'ARRA, 'since &5 3.6)

    %+** -eturns #$&&.

    6AR-'&AT' Con+erts te8t into a date. $ses the imple=ate9ormat. -euires adate in te8t as described in this date !ormat. 48ample(

    %,-4=,T4'KL.10.2012KDKdd.77.yyyyK) yields the internally usablenumber !or the date. 'since &5 3.6)

    Document information

    A+TH.R ,uthor* as read !rom the Tools 1 ptions 1 !ibreffice 1 2serdata . This is not there!ore the actual author but the current user o!the database.

    TT*' -eturns the title o! the report.

    Fnctions in the Report /ilder 1

  • 8/20/2019 Libreoffice Report Builder Grafico

    22/24

    2ser3defined functions

    You can use user?de!ined !unctions to return speci!ic intermediate results !or a group o! records. ;nthe abo+e e8ample* a !unction o! this sort was used to calculate the !ines in theReader3ameFooter  area.

    ;n the -eport #a+igator the !unction is displayed under Reader3ame group. By right?clicking on

    this !unction* you can de!ine additional !unctions by name.

    The properties o! the !unction Smme2e"ehr!eser3ame are shown abo+e. The !ormula addsthe !ield Charge to the +alue already stored in the !unction itsel!. The initial +alue is the +alue o! theCharge !ield on the !irst tra+erse o! the group. This +alue is stored in the !unction under the !unctionname and is reused in the !ormula* until the loop is ended and the group !ooter is written.

    Deep tra$ersing seems to ha+e no !unction !or now* unless charts are being treated here assubreports.

    ;! 7re e$alation is acti+ated !or the !unction* the result can also be placed in the group header.5therwise the group header contains only the corresponding +alue o! the !irst !ield o! the group.

    $ser?de!ined !unctions can also re!erence other user?de!ined !unctions. ;n that case you mustensure that the !unctions used ha+e already been created. %re?calculation in !unctions that re!er toother !unctions must be e8cluded.

    #S$m!ar*sC&ass + (#C&assN$m,er-1)

    re!ers to the Class group The content o! the arks !ield is summed and the sum !or all the recordsis returned. The sum o! the marks is di+ided by the sum o! the records. To get the correct number*1 must be added as shown with GClass3m"erH . This will then yield the a+erage marks.

      Reports

  • 8/20/2019 Libreoffice Report Builder Grafico

    23/24

    Formula entry for a field

    $sing )ata > )ata field you can enter !ormulas that a!!ect only one !ield in the =etails area.

    F(#,oo&ean.%ie&d"/es""No")

    sets the allowable +alues to KYesK or K#oK instead o! T-$4 and 9,&4.

    Conditional print

    The general properties o! group headers* group !ooters* and !ields include a Conditional 7rint=0pression !ield. 9ormulas that are written in this !ield in!luence the content o! a !ield or the displayo! an entire region. Here* too* you can make use o! the 9unction i/ard.

    #Fie&dname0"tr$e"

    causes the content o! the named !ield to be displayed only i! it is true.

    7any !orms o! conditional display are not !ully determined by the speci!ied properties. 9or instance*

    i! a graphical separator line is to be inserted a!ter the tenth place o! a list o! competition results* youcannot simply use the !ollowing conditional display command !or the graphic(

    #P&ace01

    This command does not work. ;nstead the graphic will continue to appear in the Details sectiona!ter each subseuent record.

    ;t is sa!er to bind the conditional display to a grop footer rather than to the graphic* i! this is nototherwise needed. The line is positioned in the grop footer . Then the line does actually appeara!ter the 10th place* when !ormulated as abo+e. But in that case the content that would pre+iouslyha+e appeared in the Details section must be stored in the grop header .

    Conditional formattingConditional !ormatting can be used* !or e8ample* to !ormat a calender so that weekends are showndi!!erently. Choose Format > Conditional formatting and enter(

    EE2A/(#ate)01

    and the corresponding !ormatting !or undays.

    ;! you use [48pression is\ in conditional !ormatting* you can enter a !ormula. ,s is usual in Calc*se+eral conditions can be !ormulated and are e+aluated seuentially. ;n the abo+e e8ample* !irstunday is tested !or* then aturday. 9inally there might be a uery about the content o! the !ield.o !or e8ample the content [Holiday\ would lead to a di!!erent !ormat.

    Fnctions in the Report /ilder

  • 8/20/2019 Libreoffice Report Builder Grafico

    24/24

    NoteThe -eport Builder is a plug?in. ;! additional uncorrectable errors occur '!ormulas notimplemented* too long te8t shown as an empty !ield* and so on)* it is sometimesnecessary to delete parts o! the report or simply create it a!resh.

    Reports