Stylesheet buttons - How to set filename

Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
When you use the "Send to Word" and "Send to Excel" icons from a form, NAV assembles some XML's and send this to Word or Excel. Is it possible to set the filename of the generated document to some value? Now this filename is based on the Form's caption which is displayed, but I want a different default filename.

I have already tried to change the caption-attribute in the DataXML, but this didn't do it.

If this filename is assembled in the fin.exe/finsql.exe then I guess I'm stuck.

A 2nd question is, if it's possible to retrieve the modified document, if the user has changed it inside Word/Excel... but I have a strong idea what the answer is to this one.
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)

Comments

  • kinekine Member Posts: 12,562
    Have you tried to change the first text of the exported document to something else? (as I wrote in PM - the file name is based on the first line of text in the document...)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    There is no such thing as "first text of the exported document", as everything is enclosed in XML-tags. And which XML are you referring to: ApplicationXML or DataXML?
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • kinekine Member Posts: 12,562
    It seems that NAV client is directly "creating" the file name. I tried to modify the only one string with the caption in the application xml, but the filename was not changed. It seems that the client is doing more than just sending the output XML. I tried to use default template to export data to notepad, and the create xml has still same name as for other applications.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Indeed. You'll notice that in the Temp-dir, a document is created with the caption as filename. But this document is created using the fin.exe/finsql.exe I presume ...
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    I even tried to modify the Parameter-field in the "Send-To Program" table, but then NAV gives a Runtime Error when clicking the Send-to-Word icon.

    The parameter "/t %1" could be of use so the user needs to choose a filename when saving the document.

    ](*,)
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • lzrlzr Member Posts: 264
    Did you find a solution to this? I could also use to set filename and path for the file.
    Navision developer
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    No, I haven't been able to set the filename of the generated XML-document.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
Sign In or Register to comment.