Excel Buffer | Could not find a part of the path

navuser1navuser1 Posts: 1,201Member
Dear All,

An Enduser is facing the below error message during execution of Export To Excel Report in NAV 2016.

Microsoft Dynamics NAV

A call to Microsoft.Dynamics.Nav.OpenXml.Spreadsheet.WorkbookWriter.Create failed with this message: Could not find a part of the path
'C:\ProgramData\Microsoft\Microsoft Dynamics NAV\90\Server\MicrosoftDynamicsNavServer$DynamicsNAV90\
users\default\Woods\TEMP\__TEMP__589ed7d71b1c4d29b30f4815e1a78ac2.tmp.xlsx'.
OK

All dot net variables have RunOnClient property = yes in Excel Buffer Table.

But when Users are trying to execute the export to excel report built on Excel Buffer, the generated excel file is trying to find the path in the NAV Server instead of Local Temp path.

How to solve it ?
Now or Never

Answers

  • Slawek_GuzekSlawek_Guzek Posts: 1,144Member
    The path suggests that it has been created on the server, not on the client.

    If your writer is declared with RunOnClient property = yes no wonder it cannot find the file.
    Slawek Guzek
    "For a truly gifted programmer, writing code is a side effect of thought." Paul Ford.
  • Slawek_GuzekSlawek_Guzek Posts: 1,144Member
    In Excel Buffer table most of the .NET vars should be declared with RunOnClient property = no, with the exceptions of interop vars interacting with local Excel (OpenExcel function etc)
    Slawek Guzek
    "For a truly gifted programmer, writing code is a side effect of thought." Paul Ford.
  • navuser1navuser1 Posts: 1,201Member
    Thank you for your reply....
    Should I change the RunOnClient property YES To NO in Excel Buffer Table ?

    But Few User are able to generate the excel file without any issue. o:)
    Now or Never
  • Slawek_GuzekSlawek_Guzek Posts: 1,144Member
    edited 2018-02-12
    It is hard to tell without seeing all the code. The best would be to keep them as they come in Cronus I'd say, and then if you're making necessary modification decide on a case-by-case basis how they should be declared.

    The general rule is if var does not have to interact with any local resource there is no need to declare it with RunOnClient=Yes.

    Standard write to excel works by creating a temp file on the NST, writing all necessary stuff in there, closing the temp file, downloading it to the client and then opening it in Excel.
    Slawek Guzek
    "For a truly gifted programmer, writing code is a side effect of thought." Paul Ford.
  • navuser1navuser1 Posts: 1,201Member
    Even Base Report (ID 6) is also not working in the Client Sites.
    Now or Never
  • Slawek_GuzekSlawek_Guzek Posts: 1,144Member
    I don't think that the report 6 Trial Balance uses Excel Buffer at all.
    Slawek Guzek
    "For a truly gifted programmer, writing code is a side effect of thought." Paul Ford.
  • navuser1navuser1 Posts: 1,201Member
    I have changed the .NET variables with RunOnClient property = no in the Excel Buffer Table (As per Default Cronus Database).

    After that I have tried to execute the same report but found that no one is able to execute the export excel report (Which are built in Excel Buffer Table)
    Now or Never
  • navuser1navuser1 Posts: 1,201Member
    Report 6 Trial Balance uses Excel Buffer.
    I have checked...
    Now or Never
  • Slawek_GuzekSlawek_Guzek Posts: 1,144Member
    Standard Report 6 in Cronus does not use Excel Buffer. If it does in your database then it must be some customization.

    I would search for errors in there (in custom code in report 6), not in the Excel Buffer table.


    Slawek Guzek
    "For a truly gifted programmer, writing code is a side effect of thought." Paul Ford.
  • navuser1navuser1 Posts: 1,201Member
    Again, I have checked in Cronus Database (NAV 2016 CU26 IN Version), the report id 6 is using excel buffer table to export data into excel file....

    I have checked in Default database, no doubt from my side.
    Now or Never
  • Slawek_GuzekSlawek_Guzek Posts: 1,144Member
    Ok. I have only Cronus 2017 handy, in this one the Excel Buffer is not used in report 6
    Slawek Guzek
    "For a truly gifted programmer, writing code is a side effect of thought." Paul Ford.
  • NavSolutionNavSolution Posts: 23Member
    In Cronus Nav 2016 R_6 use Excel Buffer.
  • navuser1navuser1 Posts: 1,201Member
    The problem has been solved.

    The problem was in the Excel Buffer Table.
    Now Every Users are able to execute as per last information received from the client Site.

    Thanks to everybody for their Time.
    Now or Never
Sign In or Register to comment.