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
 ExportASCII in Origin 2016
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

andygk81

2 Posts

Posted - 03/17/2016 :  3:45:46 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2016 64-bit b9.3.226
Operating System: Windows 7 Enterprise

The ExportASCII member of the worksheet class doesn't appear to work as advertised.

The basic code I have in my script is:

void exportASCII00(string filepath, string wkbk, string wkst, int rowi, int rowf, int coli, int colf)
{

WorksheetPage wb = Project.WorksheetPages(wkbk);
Worksheet ws = wb.Layers(wkst);

ws.ExportASCII(filepath, WKS_EXPORT_MISSING_AS_BLANK, '\t', rowi, coli, rowf, colf);

}

The code compiles no problem, however when executed ignores the row and column designations in the ExportASCII commmand. When used as above, a file is indeed created, but is empty (0 kb). If I incorporate WKS_EXPORT_ALL into the ExportASCII command, it exports everything and ignores the column and row designations. I copy and pasted a similar code from the help file to test things out, namely:

wks.ExportASCII(strFileName,
WKS_EXPORT_ALL|WKS_EXPORT_LABELS|WKS_EXPORT_MISSING_AS_BLANK,
'\t',
0, 0, // start with first row, first column
-1, 1); // end with last row, second column

and it also does not work as advertised (i.e. it exports the entire worksheet)...

Anyone run into this issue or have a fix?

jasonzhao

China
262 Posts

Posted - 03/21/2016 :  02:55:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

The problem is a bug. I have submitted this issue with ID: ORG-14531, it will be fixed in our next version.

Best regards!
Jason
OriginLab Technical Service
Go to Top of Page

andygk81

2 Posts

Posted - 03/21/2016 :  5:16:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Good to know, thanks for the response!
Go to Top of Page

minimax

350 Posts

Posted - 03/23/2016 :  05:59:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi andygk81,

The member function wks.ExportASCII is a little bit old.
You may try to see if another global function export_ascii_data() fits your need.
http://www.originlab.com/doc/OriginC/ref/export_ascii_data
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