PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Spreadsheet writer problem

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PEAR Forum Forum Index -> General PEAR questions
View previous topic :: View next topic  
Author Message
mykg4orce1



Joined: 03 Jan 2008
Posts: 4

PostPosted: Thu Jan 03, 2008 4:34 pm    Post subject: Spreadsheet writer problem Reply with quote

There is a function to writeString and writeNumber but is there a way i can writeText? I need this because I am building a worksheet with ISBN numbers in it that start with 00 so when I create the excel file the numbers appear properly but once I select one of the cells the prefixed double zeros disappear and the cell formats itself as a number.

how can i bypass this?
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Thu Jan 03, 2008 4:57 pm    Post subject: Reply with quote

Hmm, what's wrong with writeString()? This seems to be right method for strings with leading zeros.
Back to top
View user's profile Send private message
mykg4orce1



Joined: 03 Jan 2008
Posts: 4

PostPosted: Thu Jan 03, 2008 5:22 pm    Post subject: Reply with quote

here is a link to the file that I generate. You'll see that the file shows the leading zeros properly but when you click inside the cell the leading zeros disappear

http://www.myksp.com/temp/Dec-2007.xls

when you double click to edit the numbers you'll see that the leading zeros disappear when you select another cell
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Thu Jan 03, 2008 5:29 pm    Post subject: Reply with quote

mykg4orce1 wrote:
here is a link to the file that I generate. You'll see that the file shows the leading zeros properly but when you click inside the cell the leading zeros disappear

http://www.myksp.com/temp/Dec-2007.xls

when you double click to edit the numbers you'll see that the leading zeros disappear when you select another cell


They don't disappear with the last Excel version, but they are marked as "broken" numbers.

You could try to use
Code:
$xls->setVersion(8);
In many cases this helps, in others it doesn't.
Back to top
View user's profile Send private message
mykg4orce1



Joined: 03 Jan 2008
Posts: 4

PostPosted: Thu Jan 03, 2008 5:43 pm    Post subject: Reply with quote

This doesn't work. Is there a property of the format function that could be applied to the cell? shot in the dark i guess...
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Thu Jan 03, 2008 5:46 pm    Post subject: Reply with quote

mykg4orce1 wrote:
Is there a property of the format function that could be applied to the cell?


I don't know such a format. There might exist one, but the Excel file format isn't documented unfortunately.
Back to top
View user's profile Send private message
mykg4orce1



Joined: 03 Jan 2008
Posts: 4

PostPosted: Thu Jan 03, 2008 5:47 pm    Post subject: Reply with quote

well I appreciate your help.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PEAR Forum Forum Index -> General PEAR questions All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement