I have created an agent that generates an Excel document and sends it to specific users through mail. The Excel file generation is done at run time and as such I am not storing the file anywhere. However, the issue is that the agent is supposed to be run on server. The server does not have MS Office installed it. How can this can be done through HTML.
Asked
Active
Viewed 561 times
1
-
What type of Excel file is it? Is it the older xls file? Or the newer xlsx? The latter is an XML file which you can theoretically read and parse using standard XML tools, without having Excel installed. – Richard Schwartz Apr 10 '13 at 17:20
-
It is an new excel file that my agent is creating with various sheets having data from various views presnt in the Lotus notes based applciation – Kaka Rafa Apr 12 '13 at 12:41
-
Consider using XML instead of HTML. Save your XLSs as XML and look into it. It is easy to split it into few parts and modify/join with LS code. – Frantisek Kossuth Apr 16 '13 at 09:51
-
I am actually new to lotus notes. Can someone provide me some web links to have better undersatnding about it i.e to create excel using HTML when MS office is not installed at server. – Kaka Rafa Apr 18 '13 at 12:17
3 Answers
3
Have a look at POI 4 XPages on OpenNTF that uses the Apache POI project to generate Word and Excel files.

Per Henrik Lausten
- 21,331
- 3
- 29
- 76
2
You create a normal HTML page with a <TABLE>
containing your record data. Then you need to set the Response contentType to "application/vnd.ms-excel".
The following MS tech note will detail how to write out the HTML.
http://support.microsoft.com/kb/260239
There is also sample XPage code in the XPages Cheatsheet. See the following link.
And Lekkim has sample code of setting the contentType in an agent (Java).

Simon O'Doherty
- 9,259
- 3
- 26
- 54
1
If you need to send the Excel file by email then it's best to create a real Excel file with Apache POI.

Panu Haaramo
- 2,932
- 19
- 41
-
I am creating the excel file and I have a set up where i test my code. It is working fine. The only thing is that I am storing it in a temp folder present on server and then I am killing the file path. Now, I just got the information that the server where agent needs to be run does not have MS Office. Let me know in case further inputs are required from my side. – Kaka Rafa Apr 10 '13 at 11:08
-
Well you need to get the MS Excel installed to the server or rewrite your code to use POI. Unless you can run your code in Notes client. – Panu Haaramo Apr 10 '13 at 11:20
-
@KakaRafa As Panu states, you don't have to have Excel on the server. Rewrite your code to use Apache POI, which is open source. You'll just need to add the JAR file to your Notes database and then code appropriately. – David Navarre Apr 10 '13 at 17:52
-