You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
38 lines
1.0 KiB
package com.fr.plugin.xxx.report.core; |
|
|
|
import com.fr.main.TemplateWorkBook; |
|
import com.fr.web.request.ReportletRequest; |
|
|
|
import java.util.Map; |
|
|
|
/** |
|
* @author 秃破天际 |
|
* @version 10.0 |
|
* Created by 秃破天际 on 2020-04-01 |
|
* 设置每个sheet的名称的构建适配器 |
|
**/ |
|
public class SheetNameBuilder extends RelationBuilder { |
|
|
|
public SheetNameBuilder(String dsName, String colKey, String colValue) { |
|
super(dsName, colKey, colValue); |
|
} |
|
|
|
@Override |
|
protected boolean accept(TemplateWorkBook book, ReportletRequest request) throws Exception { |
|
return true; |
|
} |
|
|
|
@Override |
|
protected void build(TemplateWorkBook book, ReportletRequest request, Map<String, String> relation) throws Exception { |
|
if( relation.isEmpty() ){ |
|
return; |
|
} |
|
for(int i=0,len=book.getReportCount();i<len;i++){ |
|
String id = book.getReportName(i); |
|
if( relation.containsKey(id) ){ |
|
book.setReportName(i, relation.get(id) ); |
|
} |
|
} |
|
} |
|
|
|
}
|
|
|