本文整理汇总了Java中net.sf.jasperreports.engine.JRParameter类的典型用法代码示例。如果您正苦于以下问题:Java JRParameter类的具体用法?Java JRParameter怎么用?Java JRParameter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JRParameter类属于net.sf.jasperreports.engine包,在下文中一共展示了JRParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPromptingParameters
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
protected Map<QName, Object> getPromptingParameters(){
JRParameter[] params = dataset.getParameters();
Map<QName, Object> expressionParameters = new HashMap<QName, Object>();
for (JRParameter param : params){
if (param.isSystemDefined()){
continue;
}
if (!param.isForPrompting()){
continue;
}
//LOGGER.trace(((JRBaseParameter)param).getName());
Object v = getParameterValue(param.getName());
try{
expressionParameters.put(new QName(param.getName()), new PrismPropertyValue(v));
} catch (Exception e){
//just skip properties that are not important for midpoint
}
LOGGER.trace("p.val: {}", v);
}
return expressionParameters;
}
示例2: fillReport
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
private static JasperPrint fillReport(JRFileVirtualizer virtualizer) throws JRException
{
long start = System.currentTimeMillis();
// Virtualization works only with in memory JasperPrint objects.
// All the operations will first fill the report and then export
// the filled object.
// creating the data source
JRDataSource dataSource = new JREmptyDataSource(1000);
// Preparing parameters
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);
// filling the report
JasperPrint jasperPrint = JasperFillManager.fillReport("build/reports/VirtualizerReport.jasper", parameters, dataSource);
virtualizer.setReadOnly(true);
System.err.println("Filling time : " + (System.currentTimeMillis() - start));
return jasperPrint;
}
示例3: JRJpaQueryExecuter
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
/**
*
*/
public JRJpaQueryExecuter(
JasperReportsContext jasperReportsContext,
JRDataset dataset,
Map<String,? extends JRValueParameter> parameters
)
{
super(jasperReportsContext, dataset, parameters);
em = (EntityManager)getParameterValue(JRJpaQueryExecuterFactory.PARAMETER_JPA_ENTITY_MANAGER);
reportMaxCount = (Integer)getParameterValue(JRParameter.REPORT_MAX_COUNT);
if (em == null) {
log.warn("The supplied javax.persistence.EntityManager object is null.");
}
parseQuery();
}
示例4: fill
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
/**
*
*/
private void fill(boolean ignorePagination) throws JRException
{
long start = System.currentTimeMillis();
//Preparing parameters
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("ReportTitle", "Address Report");
List<String> excludedCities = new ArrayList<String>();
excludedCities.add("Boston");
excludedCities.add("Chicago");
excludedCities.add("Oslo");
parameters.put("ExcludedCities", excludedCities);
parameters.put("OrderClause", "City");
if (ignorePagination)
{
parameters.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);
}
JasperFillManager.fillReportToFile("build/reports/QueryReport.jasper", parameters, getDemoHsqldbConnection());
System.err.println("Filling time : " + (System.currentTimeMillis() - start));
}
示例5: fill
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
/**
*
*/
public void fill() throws JRException
{
long start = System.currentTimeMillis();
Locale locale = chooseLocale();
if (locale != null)
{
// Object[] aw = new Object[] {new Double(1000000.45), "$", "Ferrari", new Integer(20),new Integer(88)};
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("number", new Double(1234567 + Math.random()));
// parameters.put("array", aw);
parameters.put(JRParameter.REPORT_LOCALE, locale);
JasperFillManager.fillReportToFile("build/reports/I18nReport.jasper", parameters, new JREmptyDataSource());
System.err.println("Filling time : " + (System.currentTimeMillis() - start));
}
}
示例6: contributeParameters
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
@Override
public void contributeParameters(Map<String, Object> parameters) throws JRException
{
JndiDataAdapter jndiDataAdapter = getJndiDataAdapter();
if (jndiDataAdapter != null)
{
try {
Context ctx = new InitialContext();
DataSource dataSource = (DataSource) ctx.lookup("java:comp/env/" + jndiDataAdapter.getDataSourceName());
connection = dataSource.getConnection();
}
catch (Exception ex)
{
throw new JRException(ex);
}
parameters.put(JRParameter.REPORT_CONNECTION, connection);
}
}
示例7: setBookmarksParameter
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
private void setBookmarksParameter()
{
JRPart part = fillContext.getPart();
String bookmarksParameter = part.hasProperties() ? part.getPropertiesMap().getProperty(PROPERTY_BOOKMARKS_DATA_SOURCE_PARAMETER) : null;
if (bookmarksParameter == null)
{
return;
}
if (bookmarksParameter.equals(JRParameter.REPORT_DATA_SOURCE))
{
// if the bookmarks data source is created as main data source for the part report,
// automatically exclude it from data snapshots as jive actions might result in different bookmarks.
// if the data source is not the main report data source people will have to manually inhibit data caching.
cacheIncluded = false;
}
BookmarkHelper bookmarks = fillContext.getFiller().getFirstBookmarkHelper();
BookmarksFlatDataSource bookmarksDataSource = new BookmarksFlatDataSource(bookmarks);
parameterValues.put(bookmarksParameter, bookmarksDataSource);
}
示例8: getParameter
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
/**
*
*/
protected JRBaseParameter getParameter(JRParameter parameter)
{
JRBaseParameter baseParameter = null;
if (parameter != null)
{
baseParameter = (JRBaseParameter)get(parameter);
if (baseParameter == null)
{
baseParameter = new JRBaseParameter(parameter, this);
}
}
return baseParameter;
}
示例9: JRBaseParameter
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
/**
*
*/
protected JRBaseParameter(JRParameter parameter, JRBaseObjectFactory factory)
{
factory.put(parameter, this);
name = parameter.getName();
description = parameter.getDescription();
valueClassName = parameter.getValueClassName();
nestedTypeName = parameter.getNestedTypeName();
isSystemDefined = parameter.isSystemDefined();
isForPrompting = parameter.isForPrompting();
evaluationTime = parameter.getEvaluationTime();
defaultValueExpression = factory.getExpression(parameter.getDefaultValueExpression());
propertiesMap = parameter.getPropertiesMap().cloneProperties();
}
示例10: resolveTimeZone
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
protected TimeZone resolveTimeZone(String timezoneId)
{
TimeZone tz;
if (timezoneId == null || timezoneId.length() == 0)
{
tz = null;
}
else if (timezoneId.equals(JRParameter.REPORT_TIME_ZONE))
{
// using the report timezone
tz = (TimeZone) getParameterValue(JRParameter.REPORT_TIME_ZONE, true);
}
else
{
// resolving as tz ID
tz = TimeZone.getTimeZone(timezoneId);
}
return tz;
}
示例11: JRHibernateQueryExecuter
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
/**
*
*/
public JRHibernateQueryExecuter(
JasperReportsContext jasperReportsContext,
JRDataset dataset, Map<String, ? extends JRValueParameter> parameters
)
{
super(jasperReportsContext, dataset, parameters);
session = (Session) getParameterValue(JRHibernateQueryExecuterFactory.PARAMETER_HIBERNATE_SESSION);
reportMaxCount = (Integer) getParameterValue(JRParameter.REPORT_MAX_COUNT);
isClearCache = getPropertiesUtil().getBooleanProperty(dataset,
JRHibernateQueryExecuterFactory.PROPERTY_HIBERNATE_CLEAR_CACHE,
false);
if (session == null)
{
log.warn("The supplied org.hibernate.Session object is null.");
}
parseQuery();
}
示例12: writeParameter
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
/**
*
*/
private void writeParameter(JRParameter parameter) throws IOException
{
writer.startElement(JRXmlConstants.ELEMENT_parameter);
writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, parameter.getName());
writer.addAttribute(JRXmlConstants.ATTRIBUTE_class, parameter.getValueClassName());
if(isNewerVersionOrEqual(JRConstants.VERSION_3_1_4))
{
writer.addAttribute(JRXmlConstants.ATTRIBUTE_nestedType, parameter.getNestedTypeName());
}
writer.addAttribute(JRXmlConstants.ATTRIBUTE_isForPrompting, parameter.isForPrompting(), true);
if(isNewerVersionOrEqual(JRConstants.VERSION_6_3_1))
{
writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, parameter.getEvaluationTime());
}
writeProperties(parameter);
writer.writeCDATAElement(JRXmlConstants.ELEMENT_parameterDescription, parameter.getDescription());
writeExpression(JRXmlConstants.ELEMENT_defaultValueExpression, parameter.getDefaultValueExpression(), false);
writer.closeElement();
}
示例13: resolveFormatTimeZone
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
public static TimeZone resolveFormatTimeZone(String timeZoneId, TimeZone reportTimeZone)
{
if (timeZoneId == null || timeZoneId.isEmpty())
{
return null;
}
if (timeZoneId.equals(JRTextField.FORMAT_TIMEZONE_SYSTEM))
{
// using the default JVM timezone
return TimeZone.getDefault();
}
if (timeZoneId.equals(JRParameter.REPORT_TIME_ZONE))
{
// using the report timezone
return reportTimeZone;
}
// note that this returns GMT if the ID is unknown, leaving that as is
return getTimeZone(timeZoneId);
}
示例14: writeParameter
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
/**
*
*/
private void writeParameter( JRParameter parameter, String parameterName)
{
if(parameter != null)
{
write( "JRDesignParameter " + parameterName + " = new JRDesignParameter();\n");
write( parameterName + ".setName(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(parameter.getName()));
write( parameterName + ".setDescription(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(parameter.getDescription()));
write( parameterName + ".setValueClassName(\"{0}\");\n", parameter.getValueClassName());
write( parameterName + ".setNestedTypeName(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(parameter.getNestedTypeName()));
write( parameterName + ".setForPrompting({0});\n", parameter.isForPrompting(), true);
write( parameterName + ".setEvaluationTime({0});\n", parameter.getEvaluationTime());
writeProperties( parameter, parameterName);
writeExpression( parameter.getDefaultValueExpression(), parameterName, "DefaultValueExpression");
flush();
}
}
示例15: JRSourceCompileTask
import net.sf.jasperreports.engine.JRParameter; //导入依赖的package包/类
protected JRSourceCompileTask(
JasperDesign jasperDesign,
String unitName,
JRExpressionCollector expressionCollector,
Map<String, ? extends JRParameter> parametersMap,
Map<String, JRField> fieldsMap,
Map<String, JRVariable> variablesMap,
JRVariable[] variables,
boolean onlyDefaultEvaluation
)
{
this.jasperDesign = jasperDesign;
this.unitName = unitName;
this.expressionCollector = expressionCollector;
this.parametersMap = parametersMap;
this.fieldsMap = fieldsMap;
this.variablesMap = variablesMap;
this.variables = variables;
this.expressions = expressionCollector.getCompiledExpressions();
this.onlyDefaultEvaluation = onlyDefaultEvaluation;
}