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
 "past Link" in origin C

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
Mathias.list@posteo.de Posted - 03/15/2021 : 09:49:35 AM
Hi everyone, I have data (Min, Max, Median )in coulumns of a worksheet as output of statistics function (DEscriptive Statistics/ statistics on columns). The data is grouped like below.
Group1 |Group2 | Min | Max | Median |...
a | c | 1 | 3 | 2 |...
a | d | 2 | 4 | 3 |...
b | c | 6 | 8 | 7 |...
b | d | 7 | 9 | 8 |...

I have to put them in sheet in the pattern:

Group2 | Min a | Max a| Median A
c | 1 | 3 | 2
d | 2 | 4 | 3

in general I know how to do this with Origin C but is there a way to link the data in the new sheet, to the data in the source sheet in a similar way to "right klick"/"Paste Link" in the GUI. My internet reseach and my attepts to find something related in the documentation were not successfull.
Thanks in advance!


Origin Ver. 2021 and Service Release: 9.8.0.200
Operating System: Win 10 (64 bit)
2   L A T E S T    R E P L I E S    (Newest First)
Mathias.list@posteo.de Posted - 03/15/2021 : 11:04:44 AM
Thanks Chris! Looks like the "MakeRangeString" is what I was looking for, I will check it out.
Chris D Posted - 03/15/2021 : 10:49:34 AM
My more learned Origin C guru colleagues may provide a better way to do it, but here is code that will achieve what you want:

void copy_paste_link(const Worksheet& wks_in, int col_in, int row_in, const Worksheet& wks_out, int col_out, int row_out)
{
    string str1 = wks_in.MakeRangeString(wks_in.Columns(col_in).GetName(), NULL, 0, -1);
    string str2;
    str2.Format("cell://%s[%u]", str1, row_in + 1);
    wks_out.SetCell(row_out, col_out, str2);
}

void abc()
{
	Worksheet wks = Project.ActiveLayer();
	copy_paste_link(wks,0, 0, wks, 1, 1);
}



Thanks,
Chris Drozdowski
Originlab Technical Support

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