Jump to content

PHPExcel


sseeley

Recommended Posts

I am trying to replace the value of the cell based upon a database query.  This works fine for a value, however if I change to text it does not replace the value in the new spreadsheet.

 

This is the code for a value which works fine...

		$row3 = 3;
	$iv = 0;
	while ($iv < $num_results)
	{
	$lastName = mysql_result($getCadets,$iv,"tbluser.lastName");
	$lastName = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256,$key,$lastName,MCRYPT_MODE_ECB,$x));
	$objPHPExcel->getActiveSheet()->setCellValue('D' . $row3, $lastName);
	$iv++;
	$row3++;
	}

 

This code for text does not replace the text when the spreasheet is recreated.

 

	$row3 = 3;
	$vi = 0;
	while ($vi < $num_results)
	{
	$telephone = mysql_result($getCadets,$vi,"tbluser.telephone");
	$telephone = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256,$key,$telephone,MCRYPT_MODE_ECB,$x));
	$objRichText = new PHPExcel_RichText( $objPHPExcel->getActiveSheet()->getCell('F' . $row3) );
	$objRichText->createText($telephone);
	$vi++;
	$row3++;
	}

 

Can anyone help me please.

 

Many thanks

 

Stuart

Link to comment
https://forums.phpfreaks.com/topic/169337-phpexcel/
Share on other sites

Personally I'd recommend asking this question on the PHPEXcel forums, where Erik or Maarten would be better able to help than myself.

I'm active on a number of forums including Devshed and php developers network as well as sitepoint and here on phpfreaks, and can answer general questions on Excel in general or on PHPExcel, or specifics about the calculation engine; but I know very little about the Rich Text feature.

Link to comment
https://forums.phpfreaks.com/topic/169337-phpexcel/#findComment-893748
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.