BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
sbiedrzycki

Occasional Contributor

Joined:

Apr 9, 2018

JSL Automation Write to HTML fails

I'm running into an unusual problem with a JSL script.  I'm trying to automate the production of some reports and export them to HTML for presentation.  I am planning to integrate this using automation (C# via RunJSLFile).  The problem is that, although the variants of script I've tried (examples below) all work fine when run within JMP, they don't produce the HTML file when run standalone either by double clicking the JSL script file itself or through C#.  No error is generated when I check HasRunCommandErrorString so I'm at a loss why it fails to run.

 

New Window( "Report", vlb = V List Box() );
// Insert several graphs into list box here
vlb << Save HTML("C:\report.html");

j = New Window( "Report", <<journal, vlb = V List Box() );
// Insert several graphs into list box here
j<< Save HTML("C:\report.html");

 

I've already looked around at a few other topics and all of them more or less point to the basic format but none of them work running as a standalone script.

https://community.jmp.com/t5/Discussions/Saving-journals-as-HTML/td-p/85

https://community.jmp.com/t5/Discussions/saving-html-with-multiple-plot/td-p/48411

 

5 REPLIES 5
gzmorgan0

Super User

Joined:

Jul 25, 2016

Re: JSL Automation Write to HTML fails

This might seem trivial, but most PCs are configured so that you cannot save directly to C:\ .

 

Try saving to C:\temp\ and see if that still gives an error.  You might want to look up the function Is Directory Writable() and Is File Writable().

sbiedrzycki

Occasional Contributor

Joined:

Apr 9, 2018

Re: JSL Automation Write to HTML fails

The directory was just an example. I have it much deeper in a personal folder. As mentioned though, it works just fine when I run it in JMP. It's only when the script is called by itself or through C# that it fails to write the file.
gzmorgan0

Super User

Joined:

Jul 25, 2016

Re: JSL Automation Write to HTML fails

@sbiedrzycki,

This still might be a security issue. I think my security is set-up so that an unsigned program cannot write 

 

You might want t look at

https://stackoverflow.com/questions/3842020/running-cscript-exe-from-c-sharp-ashx-does-not-execute-c...

 

or

https://blogs.msdn.microsoft.com/shawnfa/2003/06/20/my-application-works-from-my-local-machine-but-t...

 

If you find a definitive answer/link you shoudl post it.  Good Luck

sbiedrzycki

Occasional Contributor

Joined:

Apr 9, 2018

Re: JSL Automation Write to HTML fails

I have two concerns with this...
1. My program has no security problems of its own. It has no problem writing to the same directories that the JSL script is to write to.
2. The JSL script is not able to write the HTML even when running on it's own - which it should do through some shell of JMP presumably which should have all the permissions required to perform the task as it does it when I run it after loading into the home window.

Besides, if it was running into a security conflict surely it would report that as an error or otherwise crash should it not? The fact that it does not give any error suggests some internal JMP problem but I don't know what.
gzmorgan0

Super User

Joined:

Jul 25, 2016

Re: JSL Automation Write to HTML fails

If it is the security problem like those reported at the links I provided, then it is not JMP that is having the problem; it would be your OS or your security software. I have McAfee and when I was working in a corporate environment with lots of security, I had to make JMP a trusted program. That was several years ago. 

 

You might want to contact JMP Help for directly. To test running my program externally ( I do not use C# ) I use wscript.

 

Good Luck!