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
 LabTalk Forum
 How to add a LongName
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

olsy

29 Posts

Posted - 09/15/2011 :  05:14:06 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.5
Operating System:Win7

Hi guys!
i have a problem to create a copy of worksheet.
It copies only a data and not a LongName of the columns.

// create a copy of The best to calculate statistics
Worksheet wks = Project.ActiveLayer();
int newWks = WksPage.AddLayer( "Statistics" );
Worksheet WksRes = WksPage.Layers( newWks );
if(wks)
{
Worksheet wksDest=WksPage.Layers( newWks );


int nC1 = 0, nC2 = wks.GetNumCols()-1; //want to copy all columns
int nR1 = 0, nR2 = -1; // want to copy rows 10-230
int nDestC1 = 0; // copy data to destination worksheet start from the first column
DWORD dwCtrl = CPYT_COPY_COLUMN_FORMAT | CPYT_COPY_COLUMN_DESIGNATIONS; // want to keep column format and designations with copied data

int nRet = wks.CopyTo(wksDest, nC1, 10, nR1, nR2, nDestC1, -1, dwCtrl);

}

How i can copy also a LongName?

LabTalk user

USA
35 Posts

Posted - 09/15/2011 :  5:58:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello olsy,

Look into using the colcopy x-function. I use it within loop structures to copy ranges of data between worksheets and it has a wide variety of options to suit all of my needs.

Hopefully it can address your issue.

Patrick
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