4. Excel Reports
2 minute read
Every excel report needs a column “A”, which will be deleted after the report is created. This column has to be filled with the table structure like this:
(You can use for every table a header, a dataline area and a footer.)
Example column A:
| Code | Description |
|---|---|
| !Table (name=”Suppliers”) | Start table |
| !Header | Start header-area |
| !Line | Line for output |
| !Line (condition=”UserVars.UserBool22”) | Show line if UserBool22 = True |
| !EndHeader | End header-area |
| !Table (name=”Profiles” foreignKey = “SupplierID” sortFields=”Profiles.ArticleNo DESC”) | New table with key and sort order |
| !Header | Start header-area |
| !Line | Line for output |
| !EndHeader | End header-area |
| !DataLine | Start dataline area |
| !Line | Prints 1 line per databaserow |
| !EndDataLine | End dataline |
| !Footer | Open footer area |
| !Line | Line for output |
| !EndFooter | Close footer area |
| !EndTable | Close table profiles |
| !EndTable | Close table suppliers |
Examples for cells in data lines
| Code | Description |
|---|---|
| !(Terms.Elevation) | Fields are always between !() You can printout every field from the reportvariables and from the tables which are connected in column A. |
| !(str$(Profiles.Length_Output,0,0)) !( Fstr$( A_Glass.Strength_Output,Masks.mm_0 )) | Str$() can be used to format a value string / Str$(value, amount min length, amount digits) Example: Str$(1,23456789,0,2) = 1,23 Fstr$() can be used with format masks (look table ReportVariables) |
| !(Cond$(Profiles.Status=0, ‘ohne Status’)) | Example: Cond$(1 = 1, ‘coated’, ‘uncoated’) = coated |
| =D4*E4 | Use normal excel formulars to calculate |
| !(loadRtfFile$(ReportOfferTexts.Description)) | The option loadRtfFile$ loads a string with directory + filename and convert this rtf to a standard text. |
| !(P;A_Profiles.Picture12_File, A_Profiles.Picture12_WidthMM,0) | If you like to show pictures, please use P; with the path or filed of the picture. Separate Width and Height value with Comma. Excample: !(P;C:\OrgaTemp...\Picture1_File.jpg, 20,20) |
| If you want to set fonts, fontsize, decimal places, backgrounds, sum, … use Excel. | |
| There is a small problem, if you want to use formulas like: =WENN(V15>0;100-(V15100/W15);0) Flexel will change them to: IF(V15>0,100-(U15/W15),0) and they will not work. Please use: =WENN(V15>Summe(0);100-(V15100/W15);0) | |