本文整理汇总了Java中net.sf.jasperreports.engine.print.JRPrinterAWT类的典型用法代码示例。如果您正苦于以下问题:Java JRPrinterAWT类的具体用法?Java JRPrinterAWT怎么用?Java JRPrinterAWT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JRPrinterAWT类属于net.sf.jasperreports.engine.print包,在下文中一共展示了JRPrinterAWT类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: print
import net.sf.jasperreports.engine.print.JRPrinterAWT; //导入依赖的package包/类
/**
*
*/
public boolean print(
JasperPrint jasperPrint,
int firstPageIndex,
int lastPageIndex,
boolean withPrintDialog
) throws JRException
{
return
new JRPrinterAWT(jasperReportsContext, jasperPrint).printPages(
firstPageIndex,
lastPageIndex,
withPrintDialog
);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:JasperPrintManager.java
示例2: printToImage
import net.sf.jasperreports.engine.print.JRPrinterAWT; //导入依赖的package包/类
/**
*
*/
public Image printToImage(
JasperPrint jasperPrint,
int pageIndex,
float zoom
) throws JRException
{
return new JRPrinterAWT(jasperReportsContext, jasperPrint).printPageToImage(pageIndex, zoom);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:12,代码来源:JasperPrintManager.java
示例3: refreshPage
import net.sf.jasperreports.engine.print.JRPrinterAWT; //导入依赖的package包/类
/**
*/
protected void refreshPage()
{
if (
jasperPrint == null ||
jasperPrint.getPages() == null ||
jasperPrint.getPages().size() == 0
)
{
pnlPage.setVisible(false);
btnSave.setEnabled(false);
btnPrint.setEnabled(false);
btnActualSize.setEnabled(false);
btnFitPage.setEnabled(false);
btnFitWidth.setEnabled(false);
btnZoomIn.setEnabled(false);
btnZoomOut.setEnabled(false);
cmbZoom.setEnabled(false);
if (jasperPrint != null)
{
JOptionPane.showMessageDialog(this, getBundleString("no.pages"));
}
return;
}
pnlPage.setVisible(true);
btnSave.setEnabled(true);
btnPrint.setEnabled(true);
btnActualSize.setEnabled(true);
btnFitPage.setEnabled(true);
btnFitWidth.setEnabled(true);
btnZoomIn.setEnabled(zoom < MAX_ZOOM);
btnZoomOut.setEnabled(zoom > MIN_ZOOM);
cmbZoom.setEnabled(true);
Dimension dim = new Dimension(
(int)(jasperPrint.getPageWidth() * realZoom) + 8, // 2 from border, 5 from shadow and 1 extra pixel for image
(int)(jasperPrint.getPageHeight() * realZoom) + 8
);
pnlPage.setMaximumSize(dim);
pnlPage.setMinimumSize(dim);
pnlPage.setPreferredSize(dim);
long maxImageSize = JRProperties.getLongProperty(VIEWER_RENDER_BUFFER_MAX_SIZE);
boolean renderImage;
if (maxImageSize <= 0)
{
renderImage = false;
}
else
{
long imageSize = JRPrinterAWT.getImageSize(jasperPrint, realZoom);
renderImage = imageSize <= maxImageSize;
}
lblPage.setRenderImage(renderImage);
if (renderImage)
{
setPageImage();
}
pnlLinks.removeAll();
linksMap = new HashMap();
createHyperlinks();
if (!renderImage)
{
lblPage.setIcon(null);
pnlMain.validate();
pnlMain.repaint();
}
}
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:79,代码来源:JRViewer300.java
示例4: refreshPage
import net.sf.jasperreports.engine.print.JRPrinterAWT; //导入依赖的package包/类
/**
*/
protected void refreshPage()
{
if (
jasperPrint == null ||
jasperPrint.getPages() == null ||
jasperPrint.getPages().isEmpty()
)
{
pnlPage.setVisible(false);
btnSave.setEnabled(false);
btnPrint.setEnabled(false);
btnActualSize.setEnabled(false);
btnFitPage.setEnabled(false);
btnFitWidth.setEnabled(false);
btnZoomIn.setEnabled(false);
btnZoomOut.setEnabled(false);
cmbZoom.setEnabled(false);
if (jasperPrint != null)
{
JOptionPane.showMessageDialog(this, getBundleString("no.pages"));
}
return;
}
pnlPage.setVisible(true);
btnSave.setEnabled(true);
btnPrint.setEnabled(true);
btnActualSize.setEnabled(true);
btnFitPage.setEnabled(true);
btnFitWidth.setEnabled(true);
btnZoomIn.setEnabled(zoom < MAX_ZOOM);
btnZoomOut.setEnabled(zoom > MIN_ZOOM);
cmbZoom.setEnabled(true);
Dimension dim = new Dimension(
(int)(jasperPrint.getPageWidth() * realZoom) + 8, // 2 from border, 5 from shadow and 1 extra pixel for image
(int)(jasperPrint.getPageHeight() * realZoom) + 8
);
pnlPage.setMaximumSize(dim);
pnlPage.setMinimumSize(dim);
pnlPage.setPreferredSize(dim);
long maxImageSize = JRProperties.getLongProperty(VIEWER_RENDER_BUFFER_MAX_SIZE);
boolean renderImage;
if (maxImageSize <= 0)
{
renderImage = false;
}
else
{
long imageSize = JRPrinterAWT.getImageSize(jasperPrint, realZoom);
renderImage = imageSize <= maxImageSize;
}
lblPage.setRenderImage(renderImage);
if (renderImage)
{
setPageImage();
}
pnlLinks.removeAll();
linksMap = new HashMap();
createHyperlinks();
if (!renderImage)
{
lblPage.setIcon(null);
pnlMain.validate();
pnlMain.repaint();
}
}
开发者ID:gnoopy,项目名称:wifepos,代码行数:79,代码来源:JRViewer300.java
注:本文中的net.sf.jasperreports.engine.print.JRPrinterAWT类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论