azizlabib2015 / jmesa

Automatically exported from code.google.com/p/jmesa
0 stars 0 forks source link

How to Set Style for excel (how to get customize excel ) #335

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I am overriding getExportTable() for XLS export.
2. I am using Table table = new Table().caption("Presidents");  
3. I am not able to get any setStyle() method for XLS Export

What is the expected output? What do you see instead?
I want to change font size and font color for column fields in Excel

What version of the product are you using? On what operating system?
jdk1.6.0_15,jexcel-2.6.6,jmesa-3.0.1,spring-2.0.2
Please provide any additional information below.

Original issue reported on code.google.com by sumitra...@gmail.com on 25 Apr 2012 at 6:24

GoogleCodeExporter commented 8 years ago
The style attributes are only applicable for rendering html.

If you want to tweak out the export what you would do is create a custom view. 
What I would do is copy the export view that you are interested in (either 
ExcelView or JExcelView) into your project and then tweak it however you need.

Then set the view on your TableModel.

API:

if (tableModel.isExporting() && 
tableModel.getExportType().equals(ExportType.EXCEL)) {
    tableModel.setView(new CustomExcelView());            
}

Original comment by jeff.johnston.mn@gmail.com on 26 Apr 2012 at 8:30