Subscribe Bookmark RSS Feed

Save data table to a sharepoint

MTOF

Community Trekker

Joined:

Jun 29, 2011

Hi All

I have succeded in reading data tables (uploaded manually) from a sharepoint using JSL.

However, I cannot find a way to make JMP (version 8.0.2 on Windows) save a file to this sharepoint.

To read a file I use:

dt = open(::path||"MyTable.jmp");

where path is a long string starting with http://.....

This works fine.

To save a file I use:

dt << save(::path||"MyTable1.jmp")


JMP interprets ::path||"MyTable1.jmp" as the filename and not as the full path incl filename!? And saves the file with a stupidly long name in the current directory in stead of on the sharepoint...

Any suggestions are highly appreciated!

BR, Marianne

8 REPLIES
gbu

Community Trekker

Joined:

Jun 23, 2011

Hello Marianne,

Did you try with this syntax ?

strpath = "http://..............";

dt = open(strpath || "MyTable.jmp");

dt << save(strpath || "MyTable1.jmp");

Could you copy the log of the save statement ?

Regards,

Guillaume

MTOF

Community Trekker

Joined:

Jun 29, 2011

Hello Guillaume


Thank you for trying to help .

Yes, my path is a string (defined as ::path = "http://..............\"; )

The path as such works fine, otherwise the open command would not have worked.

But when saving the problem occurs. I've nailed the problem, but don't know how to overcome it! The problem is that Save interprets the input string I give it in the wrong way.

dt<<Save("MyTable.jmp")                                     saves dt as MyTable.jmp in the current directory.

dt<<Save("C:\Program Files\MyTable.jmp")           saves dt as MyTable.jmp in C:\Program Files.

dt<<Save("http://........\MyTable.jmp")                    is supposed to save dt as MyTable.jmp in the specified folder on the Sharepoint (given by the path), but instead saves dt in the current directory as a file named http---..................MyTable.jmp.

There is no error message in the log - only 'Scriptable[]' as JMP does save the file - just in the wrong place with the wrong name...

I've also tried changing directory using set current directory, thinking that then I could save the file using dt<<Save("MyTable.jmp") afterwards,

but nothing happens (no error message, no change in directory).

set current directory (::path);

BR, Marianne

pmroz

Super User

Joined:

Jun 23, 2011

See if you can open your Sharepoint folder as a windows folder.  That will give you the unc-style path which will work from JMP.  When you are looking at the appropriate Sharepoint folder, click on Actions > Open with Windows Explorer.  You will get a Windows Explorer window showing your files.  The correct folder path is at the top, and will look something like this:

\\mysite.mycompany.com\mysubject\jmpprograms\Shared Documents

Then, your complete file path will be "\\mysite.mycompany.com\mysubject\jmpprograms\Shared Documents\MyTable.jmp"

MTOF

Community Trekker

Joined:

Jun 29, 2011

Dear PMroz

Thank you for your comment, but this is exactly what I've done!

Opened the Sharepoint folder in Windows Explorer and copied the path from here: ::pathstr="http://mysite.mycompany.net/mysubject/JMP_DB/";.

This path works fine with dt=open(::pathstr||"MyTable.jmp").

But it doesn't work with dt<<save(::pathstr||"MyTable.jmp");

See explanation of what happens in my reply above.

BR, Marianne

somehow got an extra set of http: in the above text... Message was edited by: Marianne Toft

pmroz

Super User

Joined:

Jun 23, 2011

I think you are changing the view to an Explorer view, and then copying the URL (http://...) and trying to use that.  I don't think that will work.  Try this instead:

When you are looking at your desired Sharepoint folder:

1. Change the view to All Documents


2. Click on Actions > Open with Windows Explorer

3. Once the Windows Explorer window opens (separately from IE), you will have a unc-style folder path that you can use.  It should start with \\.

MTOF

Community Trekker

Joined:

Jun 29, 2011

No, I really have done as you write and get the path in my previous reply. I'm on Windows XP - maybe you're on something different?

Anyway - removing the http: and exchanging the front slashes with back slashes worked to a certain extent...

Now JMP understands what I want to do and tries to save the file with the correct name in the correct folder. Only now I get an error message:

I/O problem. Unable to open in ReadWrite mode.

The specified network name is no longer available.

Unable to save file.

Looks like some kind of permission problem, but my permissions on this sharepoint is "Full Control" - I thought that was good enough.

pmroz

Super User

Joined:

Jun 23, 2011

I'm running Internet Explorer 8 on Windows XP.  Our Sharepoint is not the latest version.

Sounds like you need to check with your Sharepoint administrator.  The following commands worked btw:

dt = current data table();

dt << save("\\abcde.jnj.com\def\hijkl\Shared Documents\x.jmp");

MTOF

Community Trekker

Joined:

Jun 29, 2011

I'll get in contact with our IT guys.

Thank you so much for your help sorting this out!

BR, Marianne