本文整理汇总了Java中net.sf.jasperreports.engine.JRAbstractExporter类的典型用法代码示例。如果您正苦于以下问题:Java JRAbstractExporter类的具体用法?Java JRAbstractExporter怎么用?Java JRAbstractExporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JRAbstractExporter类属于net.sf.jasperreports.engine包,在下文中一共展示了JRAbstractExporter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFilter
import net.sf.jasperreports.engine.JRAbstractExporter; //导入依赖的package包/类
@Override
public ExporterFilter getFilter(JRExporterContext exporterContext)
{
JRAbstractExporter<?, ?, ?, ?> exporter =
exporterContext.getExporterRef() instanceof JRAbstractExporter<?, ?, ?, ?>
? (JRAbstractExporter<?, ?, ?, ?>)exporterContext.getExporterRef()
: null;
if (exporter != null)
{
String originFilterPrefix = exporter.getExporterPropertiesPrefix()
+ JROriginExporterFilter.PROPERTY_EXCLUDE_ORIGIN_PREFIX;
return
JROriginExporterFilter.getFilter(
exporterContext.getJasperReportsContext(),
exporterContext.getExportedReport().getPropertiesMap(),
originFilterPrefix
);
}
return null;
}
示例2: getProxy
import net.sf.jasperreports.engine.JRAbstractExporter; //导入依赖的package包/类
/**
*
*/
private final C getProxy(Class<?> clazz, InvocationHandler handler)
{
// @SuppressWarnings("rawtypes")
// List allInterfaces = ClassUtils.getAllInterfaces(clazz);
@SuppressWarnings("unchecked")
C proxy =
(C)Proxy.newProxyInstance(
JRAbstractExporter.class.getClassLoader(),
// (Class<?>[]) allInterfaces.toArray(new Class<?>[allInterfaces.size()]),
new Class<?>[]{clazz},
handler
);
return proxy;
}
示例3: getInstance
import net.sf.jasperreports.engine.JRAbstractExporter; //导入依赖的package包/类
public static MatcherExporterFilter getInstance(JRExporterContext exporterContext)
{
MatcherExporterFilter filter = null;
Exporter exporter = exporterContext.getExporterRef();
JRAbstractExporter typedExporter = exporter instanceof JRAbstractExporter ? (JRAbstractExporter)exporter : null;
if (typedExporter != null)
{
String exporterKey = typedExporter.getExporterKey();
if (exporterKey != null)
{
Set<String> includes = new HashSet<String>();
Set<String> excludes = new HashSet<String>();
List<MatcherExportFilterMapping> mappings = exporterContext.getJasperReportsContext().getExtensions(MatcherExportFilterMapping.class);
for (MatcherExportFilterMapping mapping : mappings)
{
if (exporterKey.equals(mapping.getExporterKey()))
{
if (mapping.isIncludes())
{
includes.add(mapping.getValue());
}
else
{
excludes.add(mapping.getValue());
}
}
}
filter = new MatcherExporterFilter(includes, excludes);
}
}
return filter;
}
示例4: getPrintElementIndex
import net.sf.jasperreports.engine.JRAbstractExporter; //导入依赖的package包/类
/**
*
*/
public static JRPrintElementIndex getPrintElementIndex(String imageName)
{
if (!imageName.startsWith(IMAGE_NAME_PREFIX))
{
throw
new JRRuntimeException(
JRAbstractExporter.EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME,
new Object[]{imageName});
}
return JRPrintElementIndex.parsePrintElementIndex(imageName.substring(IMAGE_NAME_PREFIX_LEGTH));
}
示例5: getFilter
import net.sf.jasperreports.engine.JRAbstractExporter; //导入依赖的package包/类
/**
* The exported report is searched for element exclusion properties, and
* if any is found a {@link ElementKeyExporterFilter} instance is returned.
*
* Each property results in a excluded element key in the following manner:
* <ul>
* <li>If the property value is not empty, it is used as excluded element key.</li>
* <li>Otherwise, the property suffix is used as element key.</li>
* </ul>
*
* @see #PROPERTY_EXCLUDED_KEY_PREFIX
*/
@Override
public ExporterFilter getFilter(JRExporterContext exporterContext)
throws JRException
{
ExporterFilter filter = null;
JRAbstractExporter<?, ?, ?, ?> exporter =
exporterContext.getExporterRef() instanceof JRAbstractExporter<?, ?, ?, ?>
? (JRAbstractExporter<?, ?, ?, ?>)exporterContext.getExporterRef()
: null;
if (exporter != null)
{
String excludeKeyPrefix =
exporter.getExporterPropertiesPrefix() + PROPERTY_EXCLUDED_KEY_PREFIX;
JRPropertiesUtil propsUtil = JRPropertiesUtil.getInstance(
exporterContext.getJasperReportsContext());
List<PropertySuffix> props = propsUtil.getAllProperties(
exporterContext.getExportedReport(), excludeKeyPrefix);
if (!props.isEmpty())
{
Set<String> excludedKeys = new HashSet<String>();
for (Iterator<PropertySuffix> it = props.iterator(); it.hasNext();)
{
PropertySuffix prop = it.next();
String key = prop.getValue();
if (key == null || key.length() == 0)
{
key = prop.getSuffix();
}
excludedKeys.add(key);
}
filter = new ElementKeyExporterFilter(excludedKeys);
}
}
return filter;
}
示例6: export
import net.sf.jasperreports.engine.JRAbstractExporter; //导入依赖的package包/类
private static void export(JRAbstractExporter exporter, JasperPrint printable, String filename, String extension, boolean openAfter) {
try {
exporter.setParameter(JRExporterParameter.JASPER_PRINT, printable);
File file = new File(filename + "." + extension);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE,file );
exporter.exportReport();
if(openAfter && Desktop.isDesktopSupported() && Desktop.getDesktop()!=null){
Desktop.getDesktop().open(file);
}
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
示例7: getBytes
import net.sf.jasperreports.engine.JRAbstractExporter; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private static byte[] getBytes(JRAbstractExporter exporter, ByteArrayOutputStream baos,
JasperPrint jasperPrint) throws JRException {
printNextReportsParameters();
// for csv delimiter
//exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER, ";");
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
if (exporter instanceof JRPdfExporter) {
exporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, encoding);
// create embedded pdf font (like in nextreports)
if (embeddedFont != null) {
HashMap<FontKey, PdfFont> fontMap = new HashMap<FontKey, PdfFont>();
FontKey key = new FontKey("Arial", false, false);
PdfFont font = new PdfFont(embeddedFont, BaseFont.IDENTITY_H, true);
fontMap.put(key, font);
exporter.setParameter(JRPdfExporterParameter.FONT_MAP, fontMap);
}
} else {
exporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, "UTF-8");
}
exporter.exportReport();
return baos.toByteArray();
}
示例8: exportWithProgress
import net.sf.jasperreports.engine.JRAbstractExporter; //导入依赖的package包/类
protected void exportWithProgress(File file, JRExportProgressMonitor monitor) throws Throwable {
JRAbstractExporter<?, ?, ?, ?> exporter = getExporter(jContext, monitor, file);
exporter.setExporterInput(new SimpleExporterInput(getReportViewer().getReport()));
exporter.exportReport();
}
示例9: getExporter
import net.sf.jasperreports.engine.JRAbstractExporter; //导入依赖的package包/类
protected abstract JRAbstractExporter<?, ?, ?, ?> getExporter(JasperReportsConfiguration jContext,
JRExportProgressMonitor monitor, File file);
示例10: getExporter
import net.sf.jasperreports.engine.JRAbstractExporter; //导入依赖的package包/类
@Override
protected JRAbstractExporter<?, ?, ?, ?> getExporter(JasperReportsConfiguration jContext,
JRExportProgressMonitor monitor, File file) {
return null;
}