dolibarr  21.0.0-alpha
Public Member Functions | List of all members
ExportExcel2007 Class Reference

Class to build export files with Excel format. More...

Inheritance diagram for ExportExcel2007:
Inheritance graph
[legend]
Collaboration diagram for ExportExcel2007:
Collaboration graph
[legend]

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 getDriverId ()
 getDriverId More...
 
 getDriverLabel ()
 getDriverLabel More...
 
 getDriverLabelBis ()
 getDriverLabel More...
 
 getDriverDesc ()
 getDriverDesc More...
 
 getDriverExtension ()
 getDriverExtension More...
 
 getDriverVersion ()
 getDriverVersion More...
 
 getLibLabel ()
 getLibLabel More...
 
 getLibVersion ()
 getLibVersion More...
 
 open_file ($file, $outputlangs)
 Open output file. More...
 
 write_header ($outputlangs)
 Write header. More...
 
 write_title ($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types)
 Output title line into file. More...
 
 write_record ($array_selected_sorted, $objp, $outputlangs, $array_types)
 Output record line into file. More...
 
 write_footer ($outputlangs)
 Write footer. More...
 
 close_file ()
 Close Excel file. More...
 
 excel_clean ($newvalue)
 Clean a cell to respect rules of Excel file cells. More...
 
 column2Letter ($c)
 Convert a column to letter (1->A, 0->B, 27->AA, ...) More...
 
 setCellValue ($val, $startCell, $endCell='')
 Set cell value and automatically merge if we give an endcell. More...
 
 setBorderStyle ($thickness, $color)
 Set border style. More...
 
 setFontStyle ($bold, $color)
 Set font style. More...
 
 setAlignmentStyle ($horizontal)
 Set alignment style (horizontal, left, right, ...) More...
 
 resetStyle ()
 Reset Style. More...
 
 setBlock ($startCell, $TDatas=array(), $boldTitle=false)
 Make a NxN Block in sheet. More...
 
 setBlock2Columns ($startCell, $TDatas=array(), $boldTitle=false)
 Make a 2xN Tab in Sheet. More...
 
 enableAutosize ($firstColumn, $lastColumn)
 Enable auto sizing for column range. More...
 
 setMergeCellValueByLength ($val, $startCell, $length, $offset=0)
 Set a value cell and merging it by giving a starting cell and a length. More...
 
- Public Member Functions inherited from ModeleExports
 listOfAvailableExportFormat ($db, $maxfilenamelength=0)
 Load into memory list of available export format. More...
 
 getPictoForKey ($key)
 Return picto of export driver. More...
 
 getDriverLabelForKey ($key)
 Return label of driver export. More...
 
 getDriverDescForKey ($key)
 Renvoi le descriptif d'un driver export. More...
 
 getDriverVersionForKey ($key)
 Renvoi version d'un driver export. More...
 
 getLibLabelForKey ($key)
 Renvoi label of driver lib. More...
 
 getLibVersionForKey ($key)
 Return version of driver lib. More...
 
- Public Member Functions inherited from CommonDocGenerator
 get_substitutionarray_user ($user, $outputlangs)
 Define array with couple substitution key => substitution value. More...
 
 getSubstitutionarrayMember ($member, $outputlangs)
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_mysoc ($mysoc, $outputlangs)
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_thirdparty ($object, $outputlangs, $array_key='company')
 Define array with couple substitution key => substitution value For example {company_name}, {company_name_alias}. More...
 
 get_substitutionarray_contact ($object, $outputlangs, $array_key='object')
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_other ($outputlangs)
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_lines ($line, $outputlangs, $linenumber=0)
 Define array with couple substitution key => substitution value Note that vars into substitutions array are formatted. More...
 
 get_substitutionarray_shipment ($object, $outputlangs, $array_key='object')
 Define array with couple substitution key => substitution value Note that vars into substitutions array are formatted. More...
 
 get_substitutionarray_each_var_object (&$object, $outputlangs, $recursive=1)
 Define array with couple substitution key => substitution value. More...
 
 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. More...
 
 printRect ($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
 Rect pdf. More...
 
 columnSort ($a, $b)
 uasort callback function to Sort columns fields More...
 
 prepareArrayColumnField ($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
 Prepare Array Column Field. More...
 
 getColumnContentWidth ($colKey)
 get column content width from column key More...
 
 getColumnContentXStart ($colKey)
 get column content X (abscissa) left position from column key More...
 
 getColumnRank ($colKey)
 get column position rank from column key More...
 
 insertNewColumnDef ($newColKey, $defArray, $targetCol='', $insertAfterTarget=false)
 get column position rank from column key More...
 
 printStdColumnContent ($pdf, &$curY, $colKey, $columnText='')
 print standard column content More...
 
 printColDescContent ($pdf, &$curY, $colKey, $object, $i, $outputlangs, $hideref=0, $hidedesc=0, $issupplierline=0)
 print description column content More...
 
 getExtrafieldContent ($object, $extrafieldKey, $outputlangs=null)
 get extrafield content for pdf writeHtmlCell compatibility usage for PDF line columns and object note block More...
 
 getColumnStatus ($colKey)
 get column status from column key More...
 
 pdfTabTitles (&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop=0)
 Print standard column content. More...
 
 defineColumnExtrafield ($object, $outputlangs, $hidedetails=0)
 Define Array Column Field for extrafields. More...
 
 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. More...
 

Detailed Description

Class to build export files with Excel format.

Definition at line 37 of file export_excel2007.modules.php.

Constructor & Destructor Documentation

◆ __construct()

ExportExcel2007::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Reimplemented from CommonDocGenerator.

Definition at line 80 of file export_excel2007.modules.php.

Member Function Documentation

◆ close_file()

ExportExcel2007::close_file ( )

Close Excel file.

Returns
int Return integer <0 if KO, >0 if OK

Definition at line 432 of file export_excel2007.modules.php.

◆ column2Letter()

ExportExcel2007::column2Letter (   $c)

Convert a column to letter (1->A, 0->B, 27->AA, ...)

Parameters
int$cColumn position
Returns
string Letter

Definition at line 468 of file export_excel2007.modules.php.

◆ enableAutosize()

ExportExcel2007::enableAutosize (   $firstColumn,
  $lastColumn 
)

Enable auto sizing for column range.

Parameters
string$firstColumnfirst column to autosize
string$lastColumnto last column to autosize
Returns
int 1

Definition at line 653 of file export_excel2007.modules.php.

◆ excel_clean()

ExportExcel2007::excel_clean (   $newvalue)

Clean a cell to respect rules of Excel file cells.

Parameters
string$newvalueString to clean
Returns
string Value cleaned

Definition at line 452 of file export_excel2007.modules.php.

References dol_string_nohtmltag().

◆ getDriverDesc()

ExportExcel2007::getDriverDesc ( )

getDriverDesc

Returns
string

Definition at line 141 of file export_excel2007.modules.php.

◆ getDriverExtension()

ExportExcel2007::getDriverExtension ( )

getDriverExtension

Returns
string

Definition at line 151 of file export_excel2007.modules.php.

◆ getDriverId()

ExportExcel2007::getDriverId ( )

getDriverId

Returns
string

Definition at line 109 of file export_excel2007.modules.php.

◆ getDriverLabel()

ExportExcel2007::getDriverLabel ( )

getDriverLabel

Returns
string Return driver label

Definition at line 119 of file export_excel2007.modules.php.

◆ getDriverLabelBis()

ExportExcel2007::getDriverLabelBis ( )

getDriverLabel

Returns
string Return driver label

Definition at line 129 of file export_excel2007.modules.php.

◆ getDriverVersion()

ExportExcel2007::getDriverVersion ( )

getDriverVersion

Returns
string

Definition at line 161 of file export_excel2007.modules.php.

◆ getLibLabel()

ExportExcel2007::getLibLabel ( )

getLibLabel

Returns
string

Definition at line 171 of file export_excel2007.modules.php.

◆ getLibVersion()

ExportExcel2007::getLibVersion ( )

getLibVersion

Returns
string

Definition at line 181 of file export_excel2007.modules.php.

◆ open_file()

ExportExcel2007::open_file (   $file,
  $outputlangs 
)

Open output file.

Parameters
string$fileFile name to generate
Translate$outputlangsOutput language object
Returns
int Return integer <0 if KO, >=0 if OK

Definition at line 195 of file export_excel2007.modules.php.

◆ resetStyle()

ExportExcel2007::resetStyle ( )

Reset Style.

Returns
int 1

Definition at line 564 of file export_excel2007.modules.php.

◆ setAlignmentStyle()

ExportExcel2007::setAlignmentStyle (   $horizontal)

Set alignment style (horizontal, left, right, ...)

Parameters
string$horizontalPhpOffice\PhpSpreadsheet\Style\Alignment
Returns
int 1

Definition at line 554 of file export_excel2007.modules.php.

◆ setBlock()

ExportExcel2007::setBlock (   $startCell,
  $TDatas = array(),
  $boldTitle = false 
)

Make a NxN Block in sheet.

Parameters
string$startCellstarting cell
array$TDatasarray(ColumnName=>array(Row value 1, row value 2, etc ...))
bool$boldTitletrue if bold headers
Returns
int 1 if OK, -1 if KO

Definition at line 578 of file export_excel2007.modules.php.

References setCellValue(), and setFontStyle().

◆ setBlock2Columns()

ExportExcel2007::setBlock2Columns (   $startCell,
  $TDatas = array(),
  $boldTitle = false 
)

Make a 2xN Tab in Sheet.

Parameters
string$startCellA1
array$TDatasarray(Title=>val)
bool$boldTitletrue if bold titles
Returns
int 1 if OK, -1 if KO

Definition at line 618 of file export_excel2007.modules.php.

◆ setBorderStyle()

ExportExcel2007::setBorderStyle (   $thickness,
  $color 
)

Set border style.

Parameters
string$thicknessstyle \PhpOffice\PhpSpreadsheet\Style\Border
string$colorcolor \PhpOffice\PhpSpreadsheet\Style\Color
Returns
int 1 if ok

Definition at line 521 of file export_excel2007.modules.php.

◆ setCellValue()

ExportExcel2007::setCellValue (   $val,
  $startCell,
  $endCell = '' 
)

Set cell value and automatically merge if we give an endcell.

Parameters
string$valcell value
string$startCellstarting cell
string$endCellending cell
Returns
int 1 if success -1 if failed

Definition at line 493 of file export_excel2007.modules.php.

Referenced by setBlock().

◆ setFontStyle()

ExportExcel2007::setFontStyle (   $bold,
  $color 
)

Set font style.

Parameters
bool$boldtrue if bold
string$colorcolor \PhpOffice\PhpSpreadsheet\Style\Color
Returns
int 1

Definition at line 539 of file export_excel2007.modules.php.

Referenced by setBlock().

◆ setMergeCellValueByLength()

ExportExcel2007::setMergeCellValueByLength (   $val,
  $startCell,
  $length,
  $offset = 0 
)

Set a value cell and merging it by giving a starting cell and a length.

Parameters
string$valCell value
string$startCellStarting cell
int$lengthLength
int$offsetStarting offset
Returns
int|string Coordinate or if KO: -1

Definition at line 670 of file export_excel2007.modules.php.

◆ write_footer()

ExportExcel2007::write_footer (   $outputlangs)

Write footer.

Parameters
Translate$outputlangsOutput language object
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 419 of file export_excel2007.modules.php.

◆ write_header()

ExportExcel2007::write_header (   $outputlangs)

Write header.

Parameters
Translate$outputlangsObject lang to translate values
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 240 of file export_excel2007.modules.php.

◆ write_record()

ExportExcel2007::write_record (   $array_selected_sorted,
  $objp,
  $outputlangs,
  $array_types 
)

Output record line into file.

Parameters
array$array_selected_sortedArray with list of field to export
Resource$objpA record from a fetch with all fields from select
Translate$outputlangsObject lang to translate values
array$array_typesArray with types of fields
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 312 of file export_excel2007.modules.php.

◆ write_title()

ExportExcel2007::write_title (   $array_export_fields_label,
  $array_selected_sorted,
  $outputlangs,
  $array_types 
)

Output title line into file.

Parameters
array$array_export_fields_labelArray with list of label of fields
array$array_selected_sortedArray with list of field to export
Translate$outputlangsObject lang to translate values
array$array_typesArray with types of fields
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 259 of file export_excel2007.modules.php.


The documentation for this class was generated from the following file: