|
dolibarr 21.0.4
|
Class to build export files with Excel format. More...


Public Member Functions | |
| __construct ($db) | |
| Constructor. | |
| getDriverId () | |
| getDriverId | |
| getDriverLabel () | |
| getDriverLabel | |
| getDriverLabelBis () | |
| getDriverLabel | |
| getDriverDesc () | |
| getDriverDesc | |
| getDriverExtension () | |
| getDriverExtension | |
| getDriverVersion () | |
| getDriverVersion | |
| getLibLabel () | |
| getLibLabel | |
| getLibVersion () | |
| getLibVersion | |
| open_file ($file, $outputlangs) | |
| Open output file. | |
| write_header ($outputlangs) | |
| Write header. | |
| write_title ($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types) | |
| Output title line into file. | |
| write_record ($array_selected_sorted, $objp, $outputlangs, $array_types) | |
| Output record line into file. | |
| write_footer ($outputlangs) | |
| Write footer. | |
| close_file () | |
| Close Excel file. | |
| excel_clean ($newvalue) | |
| Clean a cell to respect rules of Excel file cells. | |
| column2Letter ($c) | |
| Convert a column to letter (1->A, 0->B, 27->AA, ...) | |
| setCellValue ($val, $startCell, $endCell='') | |
| Set cell value and automatically merge if we give an endcell. | |
| setBorderStyle ($thickness, $color) | |
| Set border style. | |
| setFontStyle ($bold, $color) | |
| Set font style. | |
| setAlignmentStyle ($horizontal) | |
| Set alignment style (horizontal, left, right, ...) | |
| resetStyle () | |
| Reset Style. | |
| setBlock ($startCell, $TDatas=array(), $boldTitle=false) | |
| Make a NxN Block in sheet. | |
| setBlock2Columns ($startCell, $TDatas=array(), $boldTitle=false) | |
| Make a 2xN Tab in Sheet. | |
| enableAutosize ($firstColumn, $lastColumn) | |
| Enable auto sizing for column range. | |
| setMergeCellValueByLength ($val, $startCell, $length, $offset=0) | |
| Set a value cell and merging it by giving a starting cell and a length. | |
Public Member Functions inherited from ModeleExports | |
| listOfAvailableExportFormat ($db, $maxfilenamelength=0) | |
| Load into memory list of available export format. | |
| getPictoForKey ($key) | |
| Return picto of export driver. | |
| getDriverLabelForKey ($key) | |
| Return label of driver export. | |
| getDriverDescForKey ($key) | |
| Renvoi le descriptif d'un driver export. | |
| getDriverVersionForKey ($key) | |
| Renvoi version d'un driver export. | |
| getLibLabelForKey ($key) | |
| Renvoi label of driver lib. | |
| getLibVersionForKey ($key) | |
| Return version of driver lib. | |
Public Member Functions inherited from CommonDocGenerator | |
| get_substitutionarray_user ($user, $outputlangs) | |
| Define array with couple substitution key => substitution value. | |
| getSubstitutionarrayMember ($member, $outputlangs) | |
| Define array with couple substitution key => substitution value. | |
| get_substitutionarray_mysoc ($mysoc, $outputlangs) | |
| Define array with couple substitution key => substitution value. | |
| get_substitutionarray_thirdparty ($object, $outputlangs, $array_key='company') | |
| Define array with couple substitution key => substitution value For example {company_name}, {company_name_alias}. | |
| get_substitutionarray_contact ($object, $outputlangs, $array_key='object') | |
| Define array with couple substitution key => substitution value. | |
| get_substitutionarray_other ($outputlangs) | |
| Define array with couple substitution key => substitution value. | |
| get_substitutionarray_lines ($line, $outputlangs, $linenumber=0) | |
| Define array with couple substitution key => substitution value Note that vars into substitutions array are formatted. | |
| get_substitutionarray_shipment ($object, $outputlangs, $array_key='object') | |
| Define array with couple substitution key => substitution value Note that vars into substitutions array are formatted. | |
| get_substitutionarray_each_var_object (&$object, $outputlangs, $recursive=1) | |
| Define array with couple substitution key => substitution value. | |
| fill_substitutionarray_with_extrafields ($object, $array_to_fill, $extrafields, $array_key, $outputlangs) | |
| Fill array with couple extrafield key => extrafield value Note that vars into substitutions array are formatted. | |
| printRect ($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) | |
| Rect pdf. | |
| printRoundedRect ($pdf, $x, $y, $w, $h, $r, $hidetop=0, $hidebottom=0, $style='D') | |
| Print a rounded rectangle on the PDF. | |
| getMaxAfterColsLinePositionsData () | |
| Get position in PDF after col display. | |
| resetAfterColsLinePositionsData (float $y, int $pageNumb) | |
| Used for reset afterColsLinePositions var in start of a new pdf draw line loop. | |
| setAfterColsLinePositionsData (string $colId, float $y, int $pageNumb) | |
| Used for to set afterColsLinePositions var in a pdf draw line loop. | |
| columnSort ($a, $b) | |
| uasort callback function to Sort columns fields | |
| prepareArrayColumnField ($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) | |
| Prepare Array Column Field. | |
| getColumnContentWidth ($colKey) | |
| get column content width from column key | |
| getColumnContentXStart ($colKey) | |
| get column content X (abscissa) left position from column key | |
| getColumnRank ($colKey) | |
| get column position rank from column key | |
| insertNewColumnDef ($newColKey, $defArray, $targetCol='', $insertAfterTarget=false) | |
| get column position rank from column key | |
| printStdColumnContent ($pdf, &$curY, $colKey, $columnText='') | |
| print standard column content | |
| printColDescContent ($pdf, &$curY, $colKey, $object, $i, $outputlangs, $hideref=0, $hidedesc=0, $issupplierline=0) | |
| print description column content | |
| getExtrafieldContent ($object, $extrafieldKey, $outputlangs=null) | |
| get extrafield content for pdf writeHtmlCell compatibility usage for PDF line columns and object note block | |
| getColumnStatus ($colKey) | |
| get column status from column key | |
| pdfTabTitles (&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop=0) | |
| Print standard column content. | |
| defineColumnExtrafield ($object, $outputlangs, $hidedetails=0) | |
| Define Array Column Field for extrafields. | |
| defineColumnField ($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) | |
| Define Array Column Field into $this->cols This method must be implemented by the module that generate the document with its own columns. | |
Class to build export files with Excel format.
Definition at line 38 of file export_excel2007.modules.php.
| ExportExcel2007::__construct | ( | $db | ) |
Constructor.
Reimplemented from CommonDocGenerator.
Definition at line 86 of file export_excel2007.modules.php.
References disabled.
| ExportExcel2007::close_file | ( | ) |
Close Excel file.
Reimplemented from ModeleExports.
Definition at line 440 of file export_excel2007.modules.php.
| ExportExcel2007::column2Letter | ( | $c | ) |
Convert a column to letter (1->A, 0->B, 27->AA, ...)
| int | $c | Column position |
Definition at line 476 of file export_excel2007.modules.php.
References $c.
Referenced by write_title().
| ExportExcel2007::enableAutosize | ( | $firstColumn, | |
| $lastColumn ) |
Enable auto sizing for column range.
| string | $firstColumn | first column to autosize |
| string | $lastColumn | to last column to autosize |
Definition at line 661 of file export_excel2007.modules.php.
| ExportExcel2007::excel_clean | ( | $newvalue | ) |
Clean a cell to respect rules of Excel file cells.
| string | $newvalue | String to clean |
Definition at line 460 of file export_excel2007.modules.php.
References dol_string_nohtmltag().
Referenced by write_record().
| ExportExcel2007::getDriverDesc | ( | ) |
getDriverDesc
Reimplemented from ModeleExports.
Definition at line 147 of file export_excel2007.modules.php.
| ExportExcel2007::getDriverExtension | ( | ) |
getDriverExtension
Reimplemented from ModeleExports.
Definition at line 157 of file export_excel2007.modules.php.
| ExportExcel2007::getDriverId | ( | ) |
| ExportExcel2007::getDriverLabel | ( | ) |
getDriverLabel
Reimplemented from ModeleExports.
Definition at line 125 of file export_excel2007.modules.php.
| ExportExcel2007::getDriverLabelBis | ( | ) |
getDriverLabel
Definition at line 135 of file export_excel2007.modules.php.
| ExportExcel2007::getDriverVersion | ( | ) |
getDriverVersion
Reimplemented from ModeleExports.
Definition at line 167 of file export_excel2007.modules.php.
| ExportExcel2007::getLibLabel | ( | ) |
getLibLabel
Reimplemented from ModeleExports.
Definition at line 177 of file export_excel2007.modules.php.
| ExportExcel2007::getLibVersion | ( | ) |
getLibVersion
Reimplemented from ModeleExports.
Definition at line 187 of file export_excel2007.modules.php.
| ExportExcel2007::open_file | ( | $file, | |
| $outputlangs ) |
Open output file.
| string | $file | File name to generate |
| Translate | $outputlangs | Output language object |
Reimplemented from ModeleExports.
Definition at line 201 of file export_excel2007.modules.php.
References dol_syslog().
| ExportExcel2007::resetStyle | ( | ) |
| ExportExcel2007::setAlignmentStyle | ( | $horizontal | ) |
Set alignment style (horizontal, left, right, ...)
| string | $horizontal | PhpOffice\PhpSpreadsheet\Style\Alignment |
Definition at line 562 of file export_excel2007.modules.php.
| ExportExcel2007::setBlock | ( | $startCell, | |
| $TDatas = array(), | |||
| $boldTitle = false ) |
Make a NxN Block in sheet.
| string | $startCell | starting cell |
| array<string,array<null|int|float|string>> | $TDatas array(ColumnName=>array(Row value 1, row value 2, etc ...)) | |
| bool | $boldTitle | true if bold headers |
Definition at line 586 of file export_excel2007.modules.php.
References setCellValue(), and setFontStyle().
| ExportExcel2007::setBlock2Columns | ( | $startCell, | |
| $TDatas = array(), | |||
| $boldTitle = false ) |
Make a 2xN Tab in Sheet.
| string | $startCell | A1 |
| array<string,null|int|float|string> | $TDatas array(Title=>val) | |
| bool | $boldTitle | true if bold titles |
Definition at line 626 of file export_excel2007.modules.php.
References setCellValue(), and setFontStyle().
| ExportExcel2007::setBorderStyle | ( | $thickness, | |
| $color ) |
Set border style.
| string | $thickness | style \PhpOffice\PhpSpreadsheet\Style\Border |
| string | $color | color \PhpOffice\PhpSpreadsheet\Style\Color |
Definition at line 529 of file export_excel2007.modules.php.
| ExportExcel2007::setCellValue | ( | $val, | |
| $startCell, | |||
| $endCell = '' ) |
Set cell value and automatically merge if we give an endcell.
| string | $val | cell value |
| string | $startCell | starting cell |
| string | $endCell | ending cell |
Definition at line 501 of file export_excel2007.modules.php.
Referenced by setBlock(), setBlock2Columns(), and setMergeCellValueByLength().
| ExportExcel2007::setFontStyle | ( | $bold, | |
| $color ) |
Set font style.
| bool | $bold | true if bold |
| string | $color | color \PhpOffice\PhpSpreadsheet\Style\Color |
Definition at line 547 of file export_excel2007.modules.php.
Referenced by setBlock(), and setBlock2Columns().
| ExportExcel2007::setMergeCellValueByLength | ( | $val, | |
| $startCell, | |||
| $length, | |||
| $offset = 0 ) |
Set a value cell and merging it by giving a starting cell and a length.
| string | $val | Cell value |
| string | $startCell | Starting cell |
| int | $length | Length |
| int | $offset | Starting offset |
Definition at line 678 of file export_excel2007.modules.php.
References setCellValue().
| ExportExcel2007::write_footer | ( | $outputlangs | ) |
Write footer.
| Translate | $outputlangs | Output language object |
Reimplemented from ModeleExports.
Definition at line 427 of file export_excel2007.modules.php.
| ExportExcel2007::write_header | ( | $outputlangs | ) |
Write header.
| Translate | $outputlangs | Object lang to translate values |
Reimplemented from ModeleExports.
Definition at line 246 of file export_excel2007.modules.php.
| ExportExcel2007::write_record | ( | $array_selected_sorted, | |
| $objp, | |||
| $outputlangs, | |||
| $array_types ) |
Output record line into file.
| array<string,string> | $array_selected_sorted Array with list of field to export | |
| Resource | $objp | A record from a fetch with all fields from select |
| Translate | $outputlangs | Object lang to translate values |
| array<string,string> | $array_types Array with types of fields |
Reimplemented from ModeleExports.
Definition at line 319 of file export_excel2007.modules.php.
References dol_stringtotime(), dol_substr(), dol_syslog(), excel_clean(), and jsonOrUnserialize().
| ExportExcel2007::write_title | ( | $array_export_fields_label, | |
| $array_selected_sorted, | |||
| $outputlangs, | |||
| $array_types ) |
Output title line into file.
| array<string,string> | $array_export_fields_label Array with list of label of fields | |
| array<string,string> | $array_selected_sorted Array with list of field to export | |
| Translate | $outputlangs | Object lang to translate values |
| array<string,string> | $array_types Array with types of fields |
Reimplemented from ModeleExports.
Definition at line 265 of file export_excel2007.modules.php.
References column2Letter(), and dol_syslog().