You are viewing limited content. For full access, please sign in.

Question

Question

Exporting a file using a script

asked on February 12, 2014

Hi,

 

I was wondering how to export a file to an external path using an SDK Script in Workflow.

Now I had previously set up the script a while back but it looks as if something has changed in the ExportDoc methods.

 

Previously I would have used something similar, as shown below:

 

Dim MySession As Session = me.RASession
Dim MyDocument As Laserfiche.RepositoryAccess.DocumentInfo
Dim ExportDoc As New DocumentExporter
Dim EntryID as Integer = me.BoundEntryId
        
MyDocument = Document.GetDocumentInfo(EntryID,MySession)
              
'Attempts to export document
                Try
                    ExportDoc.ExportElecDoc(MyDocument, "Output Folder Path")
                Catch ex As Exception
                    MsgBox(ex.ToString)
                End Try

 

But when using:

ExportDoc.ExportElecDoc(MyDocument, "Output Folder Path")

it asks the MyDocument variable to be ByVal document as IDocumentContents

 

How do I setup the variable MyDocument now so I can export it?

 

Many thanks,

Dom

0 1

Answer

SELECTED ANSWER
replied on February 12, 2014

Oh, that makes sense now. That's the error you would get if you use DocumentServices 9.0 with RA 9.1.

1 0

Replies

replied on February 12, 2014

I believe it should be more like this: (in C#)

MyDocument = Document.GetDocumentInfo(this.Entry.ID,MySession)

Also, what is the output folder path set to?

0 0
replied on February 12, 2014

Hi Kenneth,

 

Thanks for the response - the problem though is that I can't use "GetDocumentInfo" when using the DocumentExporter method to export the document. 

The output path was set to a shared folder (including file name) on the network (\\vk-avante\Shares\Reports\SMA.xlsx).

 

Thanks,

Dom

0 0
replied on February 12, 2014

Dom,

 

What version of Workflow are you using? Can you post the error message?

0 0
replied on February 12, 2014

Hi Miruna,

 

I'm on Workflow 9.1.0.327.

 

The workflow was written a while back (definitely pre-9.1) so I expect that I just need to make a change to the script. It's not so much as an error but this is the message I receive:-

 

 

I know it's to do with the fact that I'm declaring my document variable like:

Dim MyDocument As Laserfiche.RepositoryAccess.DocumentInfo

When it appears to be looking for:

Dim MyDocument As Laserfiche.RepositoryAccess.IDocumentContents

but if so, I don't know how to declare the starting entry this way.

0 0
SELECTED ANSWER
replied on February 12, 2014

Oh, that makes sense now. That's the error you would get if you use DocumentServices 9.0 with RA 9.1.

1 0
replied on February 12, 2014

Not sure why the reference was 9.0 and not 9.1 but that's fixed it.

 

Thanks a lot,

Dom

0 0
replied on June 2, 2016

Hi All, 

I am also trying to export the file using script. But i'm getting a error  "Access to the path E:\temp is denied" 

Workflow designer uses laserfiche administrator user account to execute the workflow.

The "laserfiche workflow 10.0" and "laserfiche workflow subscriber 10.0" runs under domain user that has local admin rights

 

Please help me to resolve this issue 

 

Thanks 

-rajah 

 

0 0
replied on June 2, 2016

Hi Rajah,

In the Workflow Administration Console under Security you should have File Browser Options. If you haven't already you might need to enable this or allow the folder under the Directories tab.

 

0 0
replied on June 2, 2016 Show version history

Hi Dominic,

As you said I have enabled the file browsing option but still i am getting the same error. Please refer screenshot<still error.png>

still error.png
still error.png (135.69 KB)
0 0
replied on June 3, 2016

You mentioned E: Drive before but your Workflow is using C:? Is the drive on the Laserfiche Server or your local PC? I did some testing with my Export Workflow and also ran into the same error. 

(In my case) when using the path G:\Temp my Workflow failed but I setup the folder up as a share instead \\MyPC\Temp and set up share with Everyone Read/Write which works fine.

1 0
replied on June 6, 2016

Hi Dominic,

I am really sorry for the late response.. I tried both C drive and E drive but i had no luck. As u said i tried sharing the folder to everyone then it worked perfectly.. 

Thanks a lot Dominic ... 

 

0 0
replied on June 6, 2016

Workflow runs as its service user, not the currently logged in Windows user. I'm guessing you gave yourself rights, but the service is running as a different user.

0 0
replied on June 9, 2016

Ya ok Miruna. Just checked workflow is  running has different users. Now i changed workflow user as local system user. Now there is no error.. 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.