本文整理汇总了Java中net.sf.jasperreports.engine.query.JRCsvQueryExecuterFactory类的典型用法代码示例。如果您正苦于以下问题:Java JRCsvQueryExecuterFactory类的具体用法?Java JRCsvQueryExecuterFactory怎么用?Java JRCsvQueryExecuterFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JRCsvQueryExecuterFactory类属于net.sf.jasperreports.engine.query包,在下文中一共展示了JRCsvQueryExecuterFactory类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSpecialParameters
import net.sf.jasperreports.engine.query.JRCsvQueryExecuterFactory; //导入依赖的package包/类
/**
* Add all the CSV parameters required to execute the report
* in query execute mode...
* @param map
* @return
* @throws net.sf.jasperreports.engine.JRException
*/
@Override
public java.util.Map getSpecialParameters(java.util.Map map) throws net.sf.jasperreports.engine.JRException
{
if (isQeMode())
{
System.out.println("Setting parameters for the CSV query executer");
map.put( JRCsvQueryExecuterFactory.CSV_FILE, new File(this.getFilename()));
if (this.getCustomDateFormat() != null && this.getCustomDateFormat().length() > 0)
{
map.put( JRCsvQueryExecuterFactory.CSV_DATE_FORMAT, new SimpleDateFormat(this.getCustomDateFormat()) );
}
// This particular setting must be fixed in JR first
//map.put( JRCsvQueryExecuterFactory.CSV_FIELD_DELIMITER, new java.lang.Character( getFieldDelimiter().charAt(0) ));
map.put( JRCsvQueryExecuterFactory.CSV_RECORD_DELIMITER, getRecordDelimiter());
map.put( JRCsvQueryExecuterFactory.CSV_USE_FIRST_ROW_AS_HEADER, new java.lang.Boolean(isUseFirstRowAsHeader()));
if (!isUseFirstRowAsHeader())
{
String[] names = new String[getColumnNames().size()];
for (int i=0; i<names.length; ++i )
{
names[i] = ""+getColumnNames().elementAt(i);
}
map.put( JRCsvQueryExecuterFactory.CSV_COLUMN_NAMES_ARRAY, names);
}
}
return map;
}