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


Java Footer类代码示例

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


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

示例1: execute

import org.apache.poi.ss.usermodel.Footer; //导入依赖的package包/类
public cfData execute( cfSession _session, List<cfData> parameters ) throws cfmRunTimeException {
	cfSpreadSheetData	spreadsheet = null;
	String left, center, right;
	
	/*
	 * Collect up the parameters
	 */
spreadsheet	= (cfSpreadSheetData)parameters.get(3);
left				= parameters.get(2).getString();
center			= parameters.get(1).getString();
right				= parameters.get(0).getString();

/*
 * Perform the insertion
 */
Sheet	sheet = spreadsheet.getActiveSheet();
Footer footer = sheet.getFooter();

footer.setCenter( center );
footer.setLeft( left );
footer.setRight( right );

	return cfBooleanData.TRUE;
}
 
开发者ID:OpenBD,项目名称:openbd-core,代码行数:25,代码来源:SpreadsheetSetFooter.java

示例2: initFooter

import org.apache.poi.ss.usermodel.Footer; //导入依赖的package包/类
protected void initFooter(Sheet sheet, Date exportDateTime) {
	Footer footer = sheet.getFooter();
	// add a fixed export date and time (not a dynamic HeaderFooter.date() )
	SimpleDateFormat dateFormat = new SimpleDateFormat(
			"yyyy-MM-dd HH:mm:ss");
	footer.setLeft(dateFormat.format(exportDateTime));
	footer.setRight("Page " + HeaderFooter.page() + " of "
			+ HeaderFooter.numPages());
}
 
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:10,代码来源:ExcelWriter.java

示例3: getFooterString

import org.apache.poi.ss.usermodel.Footer; //导入依赖的package包/类
/**
 * @param footer
 * @return
 */
private static String getFooterString( Footer footer) {
    if ( footer != null) {
        return "left=" + footer.getLeft() + ",center=" + footer.getCenter() + ",right=" + footer.getRight();
    } else {
        return "";
    }
}
 
开发者ID:excella-core,项目名称:excella-pdfexporter,代码行数:12,代码来源:ReportsTestUtil.java

示例4: buildFooter

import org.apache.poi.ss.usermodel.Footer; //导入依赖的package包/类
private void buildFooter() {
	if (bean.getReportLayout().getPageFooterBand().getColumnCount() == 0) {
		return;
	}
	try {
		printPageFooterBand();  
		Footer footer = xlsSheet.getFooter();
		footer.setCenter(footerS.toString());
	} catch (QueryException ex) {
		ex.printStackTrace();
	} finally {
		footerS = new StringBuilder();
	}
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:15,代码来源:XlsxExporter.java

示例5: getLeftFooter

import org.apache.poi.ss.usermodel.Footer; //导入依赖的package包/类
public String getLeftFooter(){
    Footer leftFooter = sheet.getFooter();
    return leftFooter.getLeft();
}
 
开发者ID:jguglielmi,项目名称:OASIS-Maven,代码行数:5,代码来源:ExcelFileReader.java

示例6: getCenterFooter

import org.apache.poi.ss.usermodel.Footer; //导入依赖的package包/类
public String getCenterFooter(){
    Footer centerFooter = sheet.getFooter();
    return centerFooter.getCenter();
}
 
开发者ID:jguglielmi,项目名称:OASIS-Maven,代码行数:5,代码来源:ExcelFileReader.java

示例7: getRightFooter

import org.apache.poi.ss.usermodel.Footer; //导入依赖的package包/类
public String getRightFooter(){
    Footer rightFooter = sheet.getFooter();
    return rightFooter.getRight();
}
 
开发者ID:jguglielmi,项目名称:OASIS-Maven,代码行数:5,代码来源:ExcelFileReader.java

示例8: getFooter

import org.apache.poi.ss.usermodel.Footer; //导入依赖的package包/类
public Footer getFooter() {
	return sheet.getFooter();
}
 
开发者ID:eclipse,项目名称:birt,代码行数:4,代码来源:FilteredSheet.java

示例9: getFooter

import org.apache.poi.ss.usermodel.Footer; //导入依赖的package包/类
/**
 * Not supported
 */
@Override
public Footer getFooter() {
  throw new UnsupportedOperationException();
}
 
开发者ID:monitorjbl,项目名称:excel-streaming-reader,代码行数:8,代码来源:StreamingSheet.java

示例10: testModifyDocAttribute

import org.apache.poi.ss.usermodel.Footer; //导入依赖的package包/类
/**
 * [Flow #-4] 엑셀 문서 속성 수정 : 엑셀 파일 문서의 속성(Header, Footer)을 수정함
 */
@Test
public void testModifyDocAttribute() throws Exception {
    
    try {
    	log.debug("testModifyDocAttribute start....");

    	StringBuffer sb = new StringBuffer();
    	sb.append(fileLocation).append("/").append("testModifyDocAttribute.xlsx");        	


    	if (EgovFileUtil.isExistsFile(sb.toString())) {
    		EgovFileUtil.delete(new File(sb.toString()));
    	
    		log.debug("Delete file...." + sb.toString());
    	}

    	XSSFWorkbook wbTmp = new XSSFWorkbook();
    	wbTmp.createSheet();

        // 엑셀 파일 생성
        excelService.createXSSFWorkbook(wbTmp, sb.toString());


    	// 엑셀 파일 로드
    	XSSFWorkbook wb = excelService.loadXSSFWorkbook(sb.toString());
    	log.debug("testModifyCellContents after loadWorkbook....");

    	XSSFSheet sheet = wb.createSheet("doc test sheet");

    	XSSFRow row = sheet.createRow(1);
    	XSSFCell cell = row.createCell(1);
    	cell.setCellValue(new XSSFRichTextString("Header/Footer Test"));
    	
    	// Header
    	XSSFOddHeader header = (XSSFOddHeader) sheet.getHeader();
        header.setCenter("Center Header");
        header.setLeft("Left Header");
        header.setRight(XSSFOddHeader.stripFields("&IRight Stencil-Normal Italic font and size 16"));
        
        // Footer
        XSSFOddHeader footer = (XSSFOddHeader) sheet.getFooter();
        footer.setCenter(XSSFOddHeader.stripFields("Fixedsys"));
        log.debug("Style is ... " + XSSFOddHeader.stripFields("Fixedsys"));
        footer.setLeft("Left Footer");
        footer.setRight("Right Footer");
        
        // 엑셀 파일 저장
        FileOutputStream out = new FileOutputStream(sb.toString());
        wb.write(out);
        out.close();

        assertTrue(EgovFileUtil.isExistsFile(sb.toString()));
        
        //////////////////////////////////////////////////////////////////////////
        // 검증
        XSSFWorkbook wbT = excelService.loadXSSFWorkbook(sb.toString());
        XSSFSheet sheetT = wbT.getSheet("doc test sheet");

        Header headerT = sheetT.getHeader();
        assertEquals("Center Header", headerT.getCenter());
        assertEquals("Left Header", headerT.getLeft());
        assertEquals(XSSFOddHeader.stripFields("Right Stencil-Normal Italic font and size 16"), headerT.getRight());
        
        Footer footerT = sheetT.getFooter();
        assertEquals("Right Footer", footerT.getRight());
        assertEquals("Left Footer", footerT.getLeft());
        assertEquals(XSSFOddHeader.stripFields("Fixedsys"), footerT.getCenter());

    } catch (Exception e) {
    	log.error(e.toString());
    	throw new Exception(e);
    } finally {
    	log.debug("testModifyDocAttribute end....");
    }
}
 
开发者ID:eGovFrame,项目名称:egovframework.rte.root,代码行数:79,代码来源:EgovExcelXSSFServiceTest.java


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