SAVEASPDF Function

tsvtsv Member Posts: 49
edited 2009-04-16 in NAV Three Tier
Hi All,
i have created a report and am trying to save that as PDF in a specific path using saveaspdf function in RTC.
The code is
REPORT.SAVEASPDF(50041,'c:\Thomas.pdf');
but i got an error stating "Either the caller does not have the required permission or the specified path is read only" ](*,)
Can any one help me in this?
Thanks inAdvance
with regards,
tsv

Comments

  • BeliasBelias Member Posts: 2,998
    just wondering...maybe you have vista with UAC on?
    if so try to run nav as administrator or save the file in a different path... :-k
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • tsvtsv Member Posts: 49
    thanks Belias for your response.
    Am using XP. even if i change the path, the same error exist.
    with regards,
    tsv
  • tsvtsv Member Posts: 49
    thanks Belias for your response.
    Am using XP. even if i change the path, the same error exist.
    with regards,
    tsv
  • BeliasBelias Member Posts: 2,998
    well, my knowledge stops here :lol: ...let's see what other users say...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • clabandclaband Member, Microsoft Employee Posts: 26
    Not knowing much about your setup I will give it a shot. The path you are saving to is on the server in the context of the user executing the code. This means that you would have to have write access to c:\ of the server. Is that the case?

    /Claus
    Claus Busk Andersen
    Program Manager
    Microsoft Dynamics NAV
  • tsvtsv Member Posts: 49
    Thanks for ur response claus. I have a server machine and a client machine. After processing the customer data, the user have to send a pdf as a mail. the user might send multiple files every day as pdf, so i really don't want to save all those in my server machine that requires some space. how do i achieve this...
    Thanks in advance.
    with regards,
    tsv
  • genericgeneric Member Posts: 511
    one suggestion is after you save the pdf and send the email, is to delete the pdf files.
  • kinekine Member Posts: 12,562
    1) The file is created on the server - it means use temp path to save it correctly
    2) If you want to send the file from client, you need to download the file to the client. There is command for that.
    3) After downloading the file, you can delete it on the server...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • tsvtsv Member Posts: 49
    Thanks Kamil... can you tell me what is that command to download the file from server to client. what that u mean by temp path?
    can we save the file in client computer or its possible only in server?
    Thanks in advance
    with regards,
    tsv
  • kinekine Member Posts: 12,562
    1) the command for downloading the file is "DOWNLOAD" (or "DOWNLOADFROMSTREAM")
    2) By temp path I mean the temporary folder which exists on all systems. The path is in the TEMP environment variable. You can use the TEMPORARYPATH system variable to use it.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • tsvtsv Member Posts: 49
    =D> great its working fine.
    by using DOWNLOAD function i am able to download the file, but this function opens a save dialog box.
    i don't want the dialog box to open, it should save to the default path that i specify in the function's parameter. how do i achieve this? this is becuase i have to attach the file to the mail and send it to the user.
    Thanks in advance.
    with regards,
    tsv
  • kinekine Member Posts: 12,562
    I am afradi that this cannot be done through this function. There was another thread about that. Better in this case will be to have some shared folder somewhere, where you will store the file and attach it from this shared folder. Question is, how you want to send the file, if the Outlook is on the client PC but the code is running on the server. If you will use SMTP mailing, you cann attach the file from the server, because the code will be running on the server...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.