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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Set worksheet cell with leading zero
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

additive

Germany
109 Posts

Posted - 10/17/2008 :  12:33:20 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

eparent

118 Posts

Posted - 10/17/2008 :  3:57:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000