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
 Worksheet Column Values

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
Campo Posted - 06/02/2006 : 08:09:18 AM
Origin Version (Select Help-->About Origin): 7.5 SR5
Operating System: WIN XP


I try to calculate some rows. For that I wrote following function:
quote:

vector<double> Reibweg_Hilfsfunction(vector<double>& ColDrehzahl, vector<double>& ColZeit)
{
vector<double> vecOut;
vecOut = Durchmesser * pi * ColDrehzahl / 60 * ColZeit * 3600;
return vecOut;
}




I wrote the function after that in Origin in the "Set Column Values" in this form:

Reibweg_Hilfsfunction(col(Zeit),col(Drehzahl))

by manually calculating all works fine.

Now i want to refill the worksheet with new data in form o a easy data import:

quote:


// diese Function ist für die function "void import_to_active_Daten_wks()" sowie für die Funktionen, die für das Öffnen von
// Excel und beschreiben der Wordvorlage verantwortlich sind, notwendig
// Ausgegeben wird eine Adresse wie zB: "C:\Dokumente und Einstellungen\Administrator\Desktop\ichbintoll.csv"

void stringfile(string)
{
PfadTriboversuch1 = GetOpenBox("*.csv");
}

//////////////////////////////////////////////////////////////////////////////////////////////////

// Importmöglichkeit, hier werden die Daten auf ein schon existierendes Worksheet überschrieben
// Tribodaten
void import_to_active_Daten_wks()
{

Worksheet wks("Daten");
// Worksheet wks = Project.ActiveLayer();
if(wks)
{
stringfile(PfadTriboversuch1); // neu verweis function stringfile
wks.ImportASCII(PfadTriboversuch1);
}

}





by manually calculating (right click on the row --> set column Values --> ok) all works again fine.

But if i want to automate this by activating the "Autoupdate" button in "Set Column Values", i get problems.
If i now start the function import_to_active_Daten_wks() the system crashs or i get a white worksheet with no rows and columns.

so what do i wrong?
3   L A T E S T    R E P L I E S    (Newest First)
Campo Posted - 06/06/2006 : 04:38:38 AM
thanks a lot @ deanna and easwar!!!!!

it was really a overwrite problem. I could solve it.
easwar Posted - 06/04/2006 : 10:15:05 PM
Hi Campo,

If like Deanna points out you are trying to import into locked columns that does have the problem of import wiping out the columns.

One get around is to not set the column values to auto update, but instead use code to update the values after the import with column class methods such as:


Worksheet wks = Project.ActiveLayer();
Column colObj(wks, 2);
colObj.ExecuteFormula();
// Note that you can also change the formula prgrammatically:
// colObj.SetFormula("col(B)*2");



Easwar
OriginLab

Deanna Posted - 06/04/2006 : 9:50:23 PM
Hi.

I guess the problem is that the importation OVERWRITES the column whose values should be autoupdated.

For example, you have a worksheet like this:


Note that the values of Column C is set by the first two columns and autoupdate is enabled.


If a file that contains only two columns is imported, Column C will be auto-updated sucessfully. However, if a file that contains three columns is imported, a warning that the file cannot be read is displayed and the worksheet becomes white.



Will you please check if the problem is related to the importing?

Deanna
OriginLab GZ Office

Edited by - Deanna on 06/04/2006 9:53:55 PM

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