cell back color change.

Topics: Developer Forum
Mar 18, 2011 at 12:06 PM

Hello,
I export data to excel, everything going good. I have a problem, after export the data and user want to change any cell data. the cell backcolor change to black.
Its very urgent please asap reply me.
thanks,
thenndral.

Mar 18, 2011 at 12:08 PM

what have you already tried to solve this? I recall a number of people having the same problem on the forum who may have already solved the exact same problem.

Mar 18, 2011 at 12:14 PM
thanks for your fast reply borft, please see the attach file
actually when I go thorough our forums I got this link...

i go by this idea, I can't understand and how to solve.


On Fri, Mar 18, 2011 at 8:08 PM, borft <notifications@codeplex.com> wrote:

From: borft

what have you already tried to solve this? I recall a number of people having the same problem on the forum who may have already solved the exact same problem.

Read the full discussion online.

To add a post to this discussion, reply to this email (PHPExcel@discussions.codeplex.com)

To start a new discussion for this project, email PHPExcel@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Mar 18, 2011 at 12:21 PM
Hi broft,

I select no fill color to template excel sheet and check it out...but the result is same.
after export data and change to No FIll color it works.

whats goes wrong.


On Fri, Mar 18, 2011 at 8:14 PM, Thendral <thenndral@gmail.com> wrote:
thanks for your fast reply borft, please see the attach file
actually when I go thorough our forums I got this link...

i go by this idea, I can't understand and how to solve.



On Fri, Mar 18, 2011 at 8:08 PM, borft <notifications@codeplex.com> wrote:

From: borft

what have you already tried to solve this? I recall a number of people having the same problem on the forum who may have already solved the exact same problem.

Read the full discussion online.

To add a post to this discussion, reply to this email (PHPExcel@discussions.codeplex.com)

To start a new discussion for this project, email PHPExcel@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com



Mar 18, 2011 at 12:27 PM
Edited Mar 18, 2011 at 12:28 PM

Hmm,

 

i remember having a similar problem a while ago. Although I didn't manage to fix it I came up with the following work around which was sufficient for my application:

 

			// set white background for background patters. keeps cells from turning black
			// on selection by the user in office >=2007 on windows
			$sheet->getStyle('a1:'.$highestColumn.$highestRow)->getFill()->getStartColor()->setARGB('FFFFFFFF');

And I basically do this for all worksheets ;)

 

 

btw which php/PHPExcel versions are you using?

Mar 18, 2011 at 12:43 PM

sorry again, how to set $highestColumn.$highestRow..

On Fri, Mar 18, 2011 at 8:27 PM, borft <notifications@codeplex.com> wrote:

From: borft

Hmm,

i remember having a similar problem a while ago. Although I didn't manage to fix it I came up with the following work around which was sufficient for my application:

			// set white background for background patters. keeps cells from turning black
			// on selection by the user in office >=2007 on windows
			$sheet->getStyle('a1:'.$highestColumn.$highestRow)->getFill()->getStartColor()->setARGB('FFFFFFFF');
And I basically do this for all worksheets ;)

Read the full discussion online.

To add a post to this discussion, reply to this email (PHPExcel@discussions.codeplex.com)

To start a new discussion for this project, email PHPExcel@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Mar 18, 2011 at 1:37 PM
Edited Mar 18, 2011 at 1:38 PM

Hi, sorry about that, I forgot :)

 

 

$sheet = $this->objPHPExcel->getActiveSheet();
$highestColumn = $sheet->getHighestColumn(); $highestRow = $sheet->getHighestRow();
Mar 18, 2011 at 4:10 PM
thanks, i will work on it and let you back :)

On Fri, Mar 18, 2011 at 9:37 PM, borft <notifications@codeplex.com> wrote:

From: borft

Hi, sorry about that, I forgot :)

$highestColumn = $sheet->getHighestColumn();
$highestRow = $sheet->getHighestRow();

Read the full discussion online.

To add a post to this discussion, reply to this email (PHPExcel@discussions.codeplex.com)

To start a new discussion for this project, email PHPExcel@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Mar 21, 2011 at 5:45 AM
Hi

There is no change in Excel sheet remain same as before.

I used your code, Please see below.
$highestColumn = $objPHPExcel->getActiveSheet()->getHighestColumn();
$highestRow = $objPHPExcel->getActiveSheet()->getHighestRow();
$objPHPExcel ->getActiveSheet()->getStyle ('a1:' .$highestColumn.$highestRow)->getFill()->getStartColor()->setARGB('FFFF00');

What goes wrong in code?
Is there any option NO Fill Color.

Thanks again,
thenndral



On Sat, Mar 19, 2011 at 12:10 AM, Thendral <thenndral@gmail.com> wrote:
thanks, i will work on it and let you back :)


On Fri, Mar 18, 2011 at 9:37 PM, borft <notifications@codeplex.com> wrote:

From: borft

Hi, sorry about that, I forgot :)

$highestColumn = $sheet->getHighestColumn();
$highestRow = $sheet->getHighestRow();

Read the full discussion online.

To add a post to this discussion, reply to this email (PHPExcel@discussions.codeplex.com)

To start a new discussion for this project, email PHPExcel@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com



Mar 21, 2011 at 10:28 AM

Allthough this may be nothing,  the setARGB() function wants 32 bits of info (I think an alpha channel is included). Thus you want to specify 'FFFFFFFF' to habve a non transparant white background. This however is a workaround that solved my particular problem. It may very well be that yours is different :(

 

Mike

Mar 21, 2011 at 10:50 AM
Thanks for being with me, to solve this issue.

I found that, this cell back color change while using template excel sheet.
Herewith I attach my template file and export file too...

thanks,
thenndral

On Mon, Mar 21, 2011 at 6:28 PM, borft <notifications@codeplex.com> wrote:

From: borft

Allthough this may be nothing, the setARGB() function wants 32 bits of info (I think an alpha channel is included). Thus you want to specify 'FFFFFFFF' to habve a non transparant white background. This however is a workaround that solved my particular problem. It may very well be that yours is different :(

Mike

Read the full discussion online.

To add a post to this discussion, reply to this email (PHPExcel@discussions.codeplex.com)

To start a new discussion for this project, email PHPExcel@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Mar 21, 2011 at 10:55 AM

Unfortunately the forum does not support attachments. Maybe you cuold put them somewhere on the web (for instance public folder of dropbox or something) ;)

 

 

Mike

Mar 21, 2011 at 11:04 AM
Yeah, I upload file in yousentit.com
here is the link, please see.


I hope you can access.

thanks again.
thenndral.

On Mon, Mar 21, 2011 at 6:55 PM, borft <notifications@codeplex.com> wrote:

From: borft

Unfortunately the forum does not support attachments. Maybe you cuold put them somewhere on the web (for instance public folder of dropbox or something) ;)

Mike

Read the full discussion online.

To add a post to this discussion, reply to this email (PHPExcel@discussions.codeplex.com)

To start a new discussion for this project, email PHPExcel@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Mar 23, 2011 at 10:15 AM
Hi borft,

Finally I fix it :)

I have one question, I give maximum highest column and highest row manually. If I want to set for the complete cell ie. active sheet. how to set? please reply me.

Here is the code.
$highestColumn = "XFD";
$highestRow ="10000";

$objPHPExcel->getActiveSheet()->getStyle('a1:' .$highestColumn.$highestRow)->getFill()->getFillType(PHPExcel_Style_Fill::FILL_NONE);
$objPHPExcel->getActiveSheet()->getStyle('a1:' .$highestColumn.$highestRow)->getFill()->getStartColor()->setRGB('FFFFFF');

thanks again,
thenndral

On Mon, Mar 21, 2011 at 7:04 PM, Thendral <thenndral@gmail.com> wrote:
Yeah, I upload file in yousentit.com
here is the link, please see.


I hope you can access.

thanks again.
thenndral.

On Mon, Mar 21, 2011 at 6:55 PM, borft <notifications@codeplex.com> wrote:

From: borft

Unfortunately the forum does not support attachments. Maybe you cuold put them somewhere on the web (for instance public folder of dropbox or something) ;)

Mike

Read the full discussion online.

To add a post to this discussion, reply to this email (PHPExcel@discussions.codeplex.com)

To start a new discussion for this project, email PHPExcel@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com