The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Set worksheet cell with leading zero

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
additive Posted - 10/17/2008 : 12:33:20 PM
Hi,

when setting a cell value for a column formatted as Text & Numeric,
leading zeros get lost (V8, SR2). This was not the case in Origin 7.5.
Setting the bConsiderNumeric argument doesn't change anything. Is it a bug? I have to format the column as Text, but then I cannot adress the column as dataset anymore.


void TestSetStringCell()
{
	Worksheet wks;
	wks.Create(NULL, CREATE_VISIBLE);

	// differs from Origin 7.5, leading zero gets lost
	wks.SetCell(0, 0, "0123", false); // bConsiderNumeric == false
	wks.SetCell(1, 0, "0123", true);
	
	Dataset ds(wks,0);
	ds.SetSize(10);
	ds.SetText(4,"0123");
	
	// works
	wks.Columns(1).SetFormat(OKCOLTYPE_TEXT);
	wks.SetCell(0, 1, "0123", false);
	wks.SetCell(1, 1, "0123", true);
}


Is there any other solution than setting the column as text column in order to get the old behavior?

Best regards,

Michael
1   L A T E S T    R E P L I E S    (Newest First)
eparent Posted - 10/17/2008 : 3:57:17 PM
Hello,

Yes, this is a bug. I have Trackered it and it's ID is #12404. There is currently no work around and it is set to be fixed in SR5.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000