当前位置: 首页>>代码示例>>Java>>正文


Java ExcelCSVPrinter类代码示例

本文整理汇总了Java中com.Ostermiller.util.ExcelCSVPrinter的典型用法代码示例。如果您正苦于以下问题:Java ExcelCSVPrinter类的具体用法?Java ExcelCSVPrinter怎么用?Java ExcelCSVPrinter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ExcelCSVPrinter类属于com.Ostermiller.util包,在下文中一共展示了ExcelCSVPrinter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: export

import com.Ostermiller.util.ExcelCSVPrinter; //导入依赖的package包/类
public ActionForward export(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException {
	checkPrivilege(request, PRIVILEGE_READ);
	
	List<DxAssociation> associations = dxDao.findAllAssociations();

	response.setContentType("application/octet-stream");
	response.setHeader("Content-Disposition", "attachment; filename=\"dx_associations.csv\"");

	ExcelCSVPrinter printer = new ExcelCSVPrinter(response.getWriter());

	printer.writeln(new String[] { "Issue List Code Type", "Issue List Code", "Disease Registry Code Type", "Disease Registry Code" });
	for (DxAssociation dxa : associations) {
		printer.writeln(new String[] { dxa.getCodeType(), dxa.getCode(), dxa.getDxCodeType(), dxa.getDxCode() });
	}

	printer.flush();
	printer.close();

	return null;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:21,代码来源:dxResearchLoadAssociationsAction.java

示例2: export

import com.Ostermiller.util.ExcelCSVPrinter; //导入依赖的package包/类
public ActionForward export(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException
{
	List<DxAssociation> associations = dxDao.findAllAssociations();

	response.setContentType("application/octet-stream" );
    response.setHeader( "Content-Disposition", "attachment; filename=\"dx_associations.csv\"" );

	ExcelCSVPrinter printer = new ExcelCSVPrinter(response.getWriter());

	printer.writeln(new String[] {"Issue List Code Type","Issue List Code","Disease Registry Code Type","Disease Registry Code"});
	for(DxAssociation dxa:associations) {
		printer.writeln(new String[] {dxa.getCodeType(),dxa.getCode(),dxa.getDxCodeType(),dxa.getDxCode()});
	}

	printer.flush();
	printer.close();

	return null;
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:21,代码来源:dxResearchLoadAssociationsAction.java

示例3: Logger

import com.Ostermiller.util.ExcelCSVPrinter; //导入依赖的package包/类
/**
 * Logging facility
 */
public Logger(String[] columnHeaders) {
    try {

        // init ensures that keys in LinkedHashMap always have same order
        currentLog = new LinkedHashMap<String, String>();
        for (String column : columnHeaders) {
            currentLog.put(column, noDataSymbol);    // per default has no value
        }

        // store the number of columns for validation when logging data
        columnCount = columnHeaders.length;

        // create directory for logs
        File dir = new File(logFileDir);
        if (!dir.exists()) {
            dir.mkdir();
        }

        // define log file
        File logFile = new File(this.logFilePath + "_" + Logger.currentTime() + ".log");

        // Create the log CSV printer pointed at log file
        // Logging file can only be created at this point
        logPrinter = new ExcelCSVPrinter(new FileOutputStream(logFile));

        // always write results immediately
        logPrinter.setAutoFlush(true);

        // header
        logPrinter.writeln(columnHeaders);

    } catch (Exception e) {
        System.out.println("Logger: Logger() Could'nt write log status - Exception.");
    }
}
 
开发者ID:mucke,项目名称:mucke,代码行数:39,代码来源:Logger.java


注:本文中的com.Ostermiller.util.ExcelCSVPrinter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。