I am trying to adapt a rather complicated application, which I’ve inherited, to work on the web. I’ve got useful tips here and in other forums, and I’ve come very far, but not to completion. Now I’m asking: am I thinking “right”? I’ve been struggling with this so long that I may not see if I’m barking up the wrong tree.
The task is to generate a report in Excel, based on information in selected documents. The fields that should be used for the export are defined in a Notes document. An LS agent collects the data and writes it to a number of text files that are saved on the user’s C: drive. Finally it opens the Excel template, which is stored in a Notes form. An auto_open Excel macro imports the data from the text files, and, pronto, the user can start analyze the data in pivot tables and charts.
What was complicated in Notes seemed impossible on the web, but I gave it a try. With JavaScript I can send the selected documents to a modified LS agent. This can write the text files to the Domino server’s C: drive, to a directory that is accessible for regular users.
How to launch the Excel template is one of the issues. If I use this script, it’s launched in the browser, and then some macros won’t work:
Print |window.open(‘| & dbServer + dbPath + “(myForm)/$FILE/” + “(myAttachment)” +“?OpenElement” & |’)|
This works to start Excel in its own window, but only an empty file:
Print |Content-Type: application/vnd.ms-excel|
Print |Content-disposition: attachment; filename=“(myExcelFile)”|
Since I’ve picked this code in the forum, I don’t know how to modify it. Can the two expressions be combined?
My workaround is unfortunately not programmable, and that is to uncheck the “Browse in same window” property for the XLS file type in my Windows settings.
So far, so good. In the Excel template the text file paths and names are hardcoded. The macro uses these to do an “Open (file) for Input” to get the data. Here comes the obstacle I haven’t been able to overcome: I can’t access the files on the server with a “\Server\Folder\File” expression. I can only use an “http://Server/Folder/File” expression. There is a macro command to follow this hyperlink, but none to get to the content. First I was fooled by the method “CreateNewDocument”, since its explanation is: “Creates a new document linked to the specified hyperlink”. But I soon discovered that the new document was empty. Is there any other way?
This last is not a Notes question, but I’ve seen a lot of forum entries with similar issues, so I hope someone will have some input for me. It would save my Christmas holidays - and my sanity…
With hope and gratitude
Ingegerd