mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-25 14:56:04 +03:00
Allow HYPERLINK() function to set the tooltip, and add extra examples of setting hyperlinks either through PHPExcel methods or using the HYPERLINK() function
This commit is contained in:
parent
6a3dd85f6f
commit
352e6ea5cc
@ -281,6 +281,7 @@ class PHPExcel_Calculation_LookupRef
|
||||
}
|
||||
|
||||
$pCell->getHyperlink()->setUrl($linkURL);
|
||||
$pCell->getHyperlink()->setTooltip($displayName);
|
||||
|
||||
return $displayName;
|
||||
}
|
||||
|
@ -136,6 +136,27 @@ $objPHPExcel->getActiveSheet()->getStyle("C14")->getAlignment()->setWrapText(tru
|
||||
$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);
|
||||
$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);
|
||||
|
||||
$objRichText3 = new PHPExcel_RichText();
|
||||
$objRichText3->createText("Hello ");
|
||||
|
||||
$objUnderlined = $objRichText3->createTextRun("underlined");
|
||||
$objUnderlined->getFont()->setUnderline(true);
|
||||
$objRichText3->createText(' World.');
|
||||
|
||||
$objPHPExcel->getActiveSheet()
|
||||
->getCell("C15")
|
||||
->setValue($objRichText3);
|
||||
|
||||
|
||||
$objPHPExcel->getActiveSheet()->setCellValue('A17', 'Hyperlink');
|
||||
|
||||
$objPHPExcel->getActiveSheet()->setCellValue('C17', 'www.phpexcel.net');
|
||||
$objPHPExcel->getActiveSheet()->getCell('C17')->getHyperlink()->setUrl('http://www.phpexcel.net');
|
||||
$objPHPExcel->getActiveSheet()->getCell('C17')->getHyperlink()->setTooltip('Navigate to website');
|
||||
|
||||
$objPHPExcel->getActiveSheet()->setCellValue('C18', '=HYPERLINK("mailto:abc@def.com","abc@def.com")');
|
||||
|
||||
|
||||
// Rename worksheet
|
||||
echo date('H:i:s') , " Rename worksheet" , EOL;
|
||||
$objPHPExcel->getActiveSheet()->setTitle('Datatypes');
|
||||
|
Loading…
Reference in New Issue
Block a user