There is a form with the following functionality implemented on it.
There are few dialog box and one radio button through which the user can select some criteria. Then,there is a button which helps to get all the documents with the above selection criteria.
Now, some consolidated data from these documents are now listed in the table on the form.
Till here ,things go fine.
Now I have to put one Excel export button which should export the listed content on table to the excel.
I have worked on excel export from view but have little idea to for above solution .
Have a “template” Excel spreadsheet that you’re going to push locally to the user’s hard drive. For example, I take such a “template” and put it in “C:\Reports”. This template can have any formatting that you’d like - which is a HUGE benefit to those developers that don’t want to create EVERY part of the Excel spreadsheet. Put headers, footers, logos, column formatting, graphs - whichever!
Once there, you can interact with the Excel spreadsheet and manipulate pretty much (if not all) attributes - including criteria - via Lotuscript.
Additionally, you may want to categorize/sort/etc. the data post-export. I create a macro named “AutoOpen” and do whatever sort or what-have-you is required for the particular report. Once that’s done, I’ll save my “template” with this macro in it.
If you’re interested, I go into all of this, including the code that you’ll need, in the following:
I basically use runtime formula evaluations on the current documents.
IE., Column A = “@Text(Subject)”, etc.
This allows me to export any item in the document directly into the spreadsheet (the above example DB was written to work only with Excel - sorry OO fans) and the macro that I mentioned before triggers when the user reads the report - thus properly formatting the report to it’s specific needs.
It gives Admins and Power-Users the ability, once they nail down some simple formula, to create reporting in their applications.
HTH,
-Chris
Keywords: Excel, Microsoft Excel, spreadsheet, AutoOpen, macro, reporting, export, Office
Is the Table created directly within Form, or is it in a Richtextfield in the Form?
A)
If the Table is directly in form, then your table will be getting data through Fields defined in Table cells. To read this data you could use NotesUIDocument.FieldGetText.
B) If the table is part of a RichText field, then you could easily epxort to MS Word than Excel. If you are particular about having your data in spreadsheet format, use RichTextNavigator class.