我創建了我的Excel文件後,在Excel中的超鏈接。它設置來自數據庫的數據,它工作正常。現在我想讓一列(Image
)成爲一個URL,點擊後,開始下載。在Image
列中,圖像的名稱與數據庫中的其他值一樣設置。我對列代碼示例:嵌入其產生
$this->excel->setActiveSheetIndex(0)->setCellValue('C'.$j, $Cooperation->getPhone());
$this->excel->setActiveSheetIndex(0)->setCellValue('C'.$j, $Cooperation->getImage());
$this->excel->setActiveSheetIndex(0)->setCellValue('D'.$j, $Cooperation->getEmail());
$this->excel->setActiveSheetIndex(0)->setCellValue('E'.$j, $Cooperation->getMajor());
$this->excel->setActiveSheetIndex(0)->setCellValue('F'.$j, $Cooperation->getLastDegree());
$this->excel->setActiveSheetIndex(0)->setCellValue('G'.$j, $Cooperation->getJobCategory());
$this->excel->setActiveSheetIndex(0)->setCellValue('H'.$j, $Cooperation->getName() ." ". $Cooperation->getLastName());
這是我試過的圖像列:
$this->excel->setActiveSheetIndex(0)->setCellValue('H'.$j, echo '<a href="/media/images/footer/'.$Cooperation['Image'].'">'.$Cooperation['Image'].'</a>'
也許你可以使用'= HYPERLINK()'公式來進行。 –
你的意思是Excel公式?在PHP中?這甚至有可能嗎?! – Sean
我不知道 - 我不熟悉您用來創建Excel文件的特定庫。 –