當前位置: 首頁>>代碼示例>>Java>>正文


Java HSSFWorkbook.createInformationProperties方法代碼示例

本文整理匯總了Java中org.apache.poi.hssf.usermodel.HSSFWorkbook.createInformationProperties方法的典型用法代碼示例。如果您正苦於以下問題:Java HSSFWorkbook.createInformationProperties方法的具體用法?Java HSSFWorkbook.createInformationProperties怎麽用?Java HSSFWorkbook.createInformationProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.poi.hssf.usermodel.HSSFWorkbook的用法示例。


在下文中一共展示了HSSFWorkbook.createInformationProperties方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: makeDocInfo

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
private void makeDocInfo ( final HSSFWorkbook workbook )
{
    workbook.createInformationProperties ();

    final DocumentSummaryInformation dsi = workbook.getDocumentSummaryInformation ();
    dsi.setCompany ( "Eclipse SCADA Project" );

    final CustomProperties cp = new CustomProperties ();
    cp.put ( "Eclipse SCADA Export Version", Activator.getDefault ().getBundle ().getVersion ().toString () );
    dsi.setCustomProperties ( cp );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:12,代碼來源:ExportEventsImpl.java

示例2: prepareHSSFMetaData

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
/**
*
* Write metadata into HSSF document
*
*/
private void prepareHSSFMetaData() {
	HSSFWorkbook currentHSSFWorkbook = (HSSFWorkbook) this.currentWorkbook;
	SummaryInformation summaryInfo = currentHSSFWorkbook.getSummaryInformation(); 
	if (summaryInfo==null) {
		currentHSSFWorkbook.createInformationProperties();
		 summaryInfo = currentHSSFWorkbook.getSummaryInformation(); 
	}
	SimpleDateFormat formatSDF = new SimpleDateFormat(MSExcelParser.DATE_FORMAT); 
	for (Map.Entry<String,String> entry: this.howc.getMetadata().entrySet()) {
		// process general properties
		try {
		switch(entry.getKey()) {
			case "applicationname": 
				summaryInfo.setApplicationName(entry.getValue()); 
				break;
			case "author": 
				summaryInfo.setAuthor(entry.getValue()); 
				break;
			case "charcount": 
				summaryInfo.setCharCount(Integer.parseInt(entry.getValue())); 
				break;
			case "comments": 
				summaryInfo.setComments(entry.getValue()); 
				break;
			case "createdatetime": 
				summaryInfo.setCreateDateTime(formatSDF.parse(entry.getValue())); 
				break;
			case "edittime": 
				summaryInfo.setEditTime(Long.parseLong(entry.getValue())); 
				break;
			case "keywords": 
				summaryInfo.setKeywords(entry.getValue()); 
				break;
			case "lastauthor": 
				summaryInfo.setLastAuthor(entry.getValue()); 
				break;
			case "lastprinted": 
				summaryInfo.setLastPrinted(formatSDF.parse(entry.getValue())); 
				break;	
			case "lastsavedatetime": 
				summaryInfo.setLastSaveDateTime(formatSDF.parse(entry.getValue())); 
				break;
			case "pagecount": 
				summaryInfo.setPageCount(Integer.parseInt(entry.getValue())); 
				break;
			case "revnumber": 
				summaryInfo.setRevNumber(entry.getValue()); 
				break;
			case "security": 
				summaryInfo.setSecurity(Integer.parseInt(entry.getValue())); 
				break;
			case "subject": 
				summaryInfo.setSubject(entry.getValue()); 
				break;
			case "template": 
				summaryInfo.setTemplate(entry.getValue()); 
				break;	
			case "title": 
				summaryInfo.setTitle(entry.getValue()); 
				break;
			case "wordcount": 
				summaryInfo.setWordCount(Integer.parseInt(entry.getValue())); 
				break;
			default: 
				LOG.warn("Unknown metadata key: "+entry.getKey()); 
				break;	
		} 
		} catch (ParseException pe) {
			LOG.error(pe);
		}

	}
}
 
開發者ID:ZuInnoTe,項目名稱:hadoopoffice,代碼行數:79,代碼來源:MSExcelWriter.java


注:本文中的org.apache.poi.hssf.usermodel.HSSFWorkbook.createInformationProperties方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。