⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jasperpagesize.java

📁 Java报表源程序 提供二维报表设计
💻 JAVA
字号:
package com.csscis.common.report;

import net.sf.jasperreports.engine.base.JRBaseReport;

public class JasperPageSize {
	//private static final int A4_WIDTH_L = 297;
	//private static final int A4_HEIGTH_S = 210;
	
	private static final int A3_WIDTH_L = 420;
	private static final int A3_WIDTH_S = 297;
	
	private static final double CM_TO_PX = 72/25.40005;
	
	private byte orientation ;
	
	private int pageWidth = 595;  
	private int pageHeight = 842;	
	public JasperPageSize(){
	}
	public JasperPageSize(String pageSize){
		this(pageSize,"-");
	}
	public JasperPageSize(String pageSize,String _orientation){
		if (pageSize == null){
		}else if (pageSize.equalsIgnoreCase("")){			
		}else if (pageSize.equalsIgnoreCase("A4")){			
		}else if (pageSize.equalsIgnoreCase("A3")){
			pageWidth = (int) (A3_WIDTH_S * CM_TO_PX) ;
			pageHeight = (int) (A3_WIDTH_L * CM_TO_PX) ;;			
		}
		
		JRBaseReport baseReport = new JRBaseReport();
		orientation = baseReport.ORIENTATION_PORTRAIT;
		if (_orientation!=null && ( 
				_orientation.equalsIgnoreCase("portrait") || 
				_orientation.equalsIgnoreCase("-") ||
				_orientation.equalsIgnoreCase("-") ||
				_orientation.equalsIgnoreCase("横") ||
				_orientation.equalsIgnoreCase("横向"))){
			orientation = baseReport.ORIENTATION_LANDSCAPE;
			int tmp;
			tmp = pageWidth;
			pageWidth = pageHeight;
			pageHeight = tmp;
		}
	}
	public int getPageHeight() {
		return pageHeight;
	}
	public int getPageWidth() {
		return pageWidth;
	}
	public byte getOrientation(){
		return orientation;
	}	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -