How do I export a trinidad table into an excel format?
I have <tr:table> and some values in it that are displayed using <tr:column>.
I want to export those values into an excel sheet.
You can't generate Excel sheets using Apache Trinidad. What you need to do is write an action which:
converts the data to an Excel sheet (for example using Apache POI or Java Excel API) and
gets the HttpServletResponse, resets it, sets the correct headers and outputs your Excel sheet.
See:
Create Excel file in Java
How to provide a file download from a JSF backing bean?
Related
I have an Excel file that has multiple graphic content (a normal excel file).
I am reading this file using POI API in java. I am able to convert the file to PDF table using iText jar.
But, the whole format is not copied into the PDF. (e.g., merged cells come into one column, and other formatting or settings are all gone).
A simple pdf table is created like below.
However when I convert with MS Excel and save as PDF i get the below output which has all the formatting details and looks perfect.
How do i retain the same format as in excel? I have done some googling on this and got some methods like OpenOffice API but all of them convert files on local machine. What if I send my tomcat build to client machine where OpenOffice is not installed ? Need some solution for that. Any help would be useful.
I read this article. The program (from website) allows the user to generate a customized Word document use Apache POI. I found the code from these two websites that can generate Excel file use agent, however the output is generate the view in Excel format only.
Is it possible to export view to Excel in specify format without use Apache POI?
Instead of using Apache POI, is it possible to write code in agent to generate a customized Excel file?
No and Yes. You deal with Java on XPages. You could reinvent the wheel and write all was POI does yourself, so yes you could.
You also could output a HTML table but send a header of application\vnd-excel to get the table automatically opened in Excel (but no formula here)
What would stop you from using POI?
I'm uploading an Excel document from a JSP to a Servlet. I'm using Apache Poi to read the Excel file. My exact requirement is to get the sum of the values of a known column.
Please tell me if there's a direct way than iterating one by one
I make a report as pdf.It s fine. But when I export it to excel ,there are many sheets on excel . I do not wan to it.I want to 1 sheet.How can I fix this?
Thanks.
Depends on your Cognos version you can use the Excel 2000 single sheet format in Cognos 8.X:
Cognos 8.4.1 Excel Formats
However, I assume you are using Cognos 10.X. In this version this feature is deprecated:
Excel 2000 and Excel 2000 Single Sheet Report Outputs
So, you can use the following options:
1. Export report in CSV or Excel 2007 Data format. This is excellent choice if format is not required.
2. Change your report layout to support single sheet excel: Create all your report objects in one page, remove any page sets definition.
You can use render variable to create separate output for Excel and separate output for other formats.
I'm trying to know how to export a datatable with column groups into excel with the correct format. I'm using icefaces datatable, but with primefaces datatable it will be the same.
header has a recursive structure, so you can parse like xml file, but I can't see the way to reflect into excel file, just using jxl or poi.
I suppose somebody have the needs to export column groups into excel and right now I can't find a tool for do this.
Any idea??
Thanks