當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。