|
dolibarr 25.0.0-alpha
|
Set of functions for reporting. More...
Go to the source code of this file.
Functions | |
| report_header ($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='') | |
| Show header of a report. | |
| reportGetLogoPath ($mysoc) | |
| Return the readable path of our company logo for a report, or '' if none. | |
| reportGetCompanyLines ($outputlangs, $mysoc) | |
| Return our company info lines (without the name) for a report header. | |
| reportPdfInit ($outputlangs, $title, $subject, $orientation='P') | |
| Create a PDF instance for a report, with first page added. | |
| reportPdfCompanyHeader ($pdf, $outputlangs, $mysoc, $margin, $fontsize) | |
| Print our company logo (left) and company info (right) at top of a report PDF page. | |
| reportFileName ($title, $name, $ext) | |
| Return a report export file name. | |
| reportPeriodLabel ($outputlangs, $datestart, $dateend) | |
| Return the label of a filtered period. | |
| reportSheetTitle ($label) | |
| Return a valid worksheet title from a free label. | |
| reportXlsxInit ($outputlangs, $title, $sheetlabel) | |
| Create a spreadsheet for a report. | |
| reportXlsxCompanyHeader ($sheet, $outputlangs, $mysoc, $firstcol, $lastcol) | |
| Write logo (left) and company info (right) at top of a report worksheet. | |
| reportXlsxOutput ($spreadsheet, $filename) | |
| Send a report spreadsheet to the browser as an xlsx download. | |
| reportExportButtons ($param, $idprefix, $enabled=1) | |
| Return the PDF and XLSX export buttons of a report page. | |
Set of functions for reporting.
Definition in file report.lib.php.
| report_header | ( | $reportname, | |
| $notused, | |||
| $period, | |||
| $periodlink, | |||
| $description, | |||
| $builddate, | |||
| $exportlink = '', | |||
| $moreparam = array(), | |||
| $calcmode = '', | |||
| $varlink = '' ) |
Show header of a report.
| string | $reportname | Name of report |
| string | $notused | Not used |
| string | $period | Period of report |
| string | $periodlink | Link to switch period |
| string | $description | Description |
| integer | $builddate | Date generation |
| string | $exportlink | Link for export or '' |
| array<string,mixed> | $moreparam Array with list of params to add into form | |
| string | $calcmode | Calculation mode |
| string | $varlink | Add a variable into the address of the page |
Definition at line 45 of file report.lib.php.
References dol_get_fiche_end(), dol_get_fiche_head(), and dol_print_date().
| reportExportButtons | ( | $param, | |
| $idprefix, | |||
| $enabled = 1 ) |
Return the PDF and XLSX export buttons of a report page.
They call the current page with action exportpdf and exportxlsx.
| string | $param | URL parameters to keep, starting with '&' |
| string | $idprefix | Prefix of the button ids |
| int | $enabled | 1 to enable buttons, 0 to show them disabled |
Definition at line 462 of file report.lib.php.
References dolGetButtonTitle(), and newToken().
| reportFileName | ( | $title, | |
| $name, | |||
| $ext ) |
Return a report export file name.
| string | $title | Report title (translated) |
| string | $name | Subject of the report (thirdparty name...), '' for none |
| string | $ext | File extension |
Definition at line 315 of file report.lib.php.
References dol_sanitizeFileName().
| reportGetCompanyLines | ( | $outputlangs, | |
| $mysoc ) |
Return our company info lines (without the name) for a report header.
Content follows the same setup as the source address of PDF documents. Hook reportBuildCompanyLines can replace the lines: return 1 with results['lines'].
Definition at line 181 of file report.lib.php.
References $mysoc, dol_syslog(), and pdf_build_address().
Referenced by reportPdfCompanyHeader(), and reportXlsxCompanyHeader().
| reportGetLogoPath | ( | $mysoc | ) |
Return the readable path of our company logo for a report, or '' if none.
| Societe | $mysoc | Our company |
Definition at line 147 of file report.lib.php.
References $conf, $mysoc, dol_syslog(), and getDolGlobalInt().
Referenced by reportPdfCompanyHeader(), and reportXlsxCompanyHeader().
| reportPdfCompanyHeader | ( | $pdf, | |
| $outputlangs, | |||
| $mysoc, | |||
| $margin, | |||
| $fontsize ) |
Print our company logo (left) and company info (right) at top of a report PDF page.
| TCPDF | PDF instance | |
| Translate | $outputlangs | Output language |
| Societe | $mysoc | Our company |
| float | $margin | Page margin |
| int | $fontsize | Default font size |
Definition at line 277 of file report.lib.php.
References $mysoc, getDolGlobalString(), pdf_getHeightForLogo(), reportGetCompanyLines(), and reportGetLogoPath().
| reportPdfInit | ( | $outputlangs, | |
| $title, | |||
| $subject, | |||
| $orientation = 'P' ) |
Create a PDF instance for a report, with first page added.
| Translate | $outputlangs | Output language |
| string | $title | Document title |
| string | $subject | Document subject |
| 'P'|'L' | $orientation 'P' for portrait, 'L' for landscape |
Definition at line 222 of file report.lib.php.
References $mysoc, getDolGlobalString(), pdf_getFormat(), pdf_getInstance(), pdf_getPDFFont(), and pdf_getPDFFontSize().
| reportPeriodLabel | ( | $outputlangs, | |
| $datestart, | |||
| $dateend ) |
Return the label of a filtered period.
| Translate | $outputlangs | Output language |
| int|'' | $datestart Start date (timestamp), '' for none | |
| int|'' | $dateend End date (timestamp), '' for none |
Definition at line 331 of file report.lib.php.
References dol_print_date().
| reportSheetTitle | ( | $label | ) |
Return a valid worksheet title from a free label.
| string | $label | Label |
Definition at line 350 of file report.lib.php.
References dol_substr().
Referenced by reportXlsxInit().
| reportXlsxCompanyHeader | ( | $sheet, | |
| $outputlangs, | |||
| $mysoc, | |||
| $firstcol, | |||
| $lastcol ) |
Write logo (left) and company info (right) at top of a report worksheet.
| \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $sheet | Worksheet |
| Translate | $outputlangs | Output language |
| Societe | $mysoc | Our company |
| string | $firstcol | First column of the info block |
| string | $lastcol | Last column of the info block |
Definition at line 394 of file report.lib.php.
References $mysoc, getDolGlobalString(), reportGetCompanyLines(), and reportGetLogoPath().
| reportXlsxInit | ( | $outputlangs, | |
| $title, | |||
| $sheetlabel ) |
Create a spreadsheet for a report.
Caller must check class ZipArchive exists before.
| Translate | $outputlangs | Output language |
| string | $title | Document title |
| string | $sheetlabel | Label used for the worksheet title |
Definition at line 366 of file report.lib.php.
References reportSheetTitle().
| reportXlsxOutput | ( | $spreadsheet, | |
| $filename ) |
Send a report spreadsheet to the browser as an xlsx download.
| \PhpOffice\PhpSpreadsheet\Spreadsheet | $spreadsheet | Spreadsheet |
| string | $filename | File name (UTF-8) |
Definition at line 435 of file report.lib.php.
References dol_sanitizeFileName().