本文整理汇总了Java中net.sf.jasperreports.engine.design.JRDesignParameter.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java JRDesignParameter.setDescription方法的具体用法?Java JRDesignParameter.setDescription怎么用?Java JRDesignParameter.setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jasperreports.engine.design.JRDesignParameter
的用法示例。
在下文中一共展示了JRDesignParameter.setDescription方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPropertyValue
import net.sf.jasperreports.engine.design.JRDesignParameter; //导入方法依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
JRDesignParameter jrParameter = (JRDesignParameter) getValue();
if (id.equals(JRDesignParameter.PROPERTY_DESCRIPTION))
jrParameter.setDescription((String) value);
else if (id.equals(JRDesignParameter.PROPERTY_FOR_PROMPTING) && isMainDataset())
jrParameter.setForPrompting(((Boolean) value).booleanValue());
else if (id.equals(JRDesignParameter.PROPERTY_NESTED_TYPE_NAME))
jrParameter.setNestedTypeName((String) value);
else if (id.equals(JRDesignParameter.PROPERTY_DEFAULT_VALUE_EXPRESSION))
jrParameter.setDefaultValueExpression(ExprUtil.setValues(jrParameter.getDefaultValueExpression(), value));
else if (id.equals(PROPERTY_MAP)) {
JRPropertiesMap v = (JRPropertiesMap) value;
String[] names = jrParameter.getPropertiesMap().getPropertyNames();
for (int i = 0; i < names.length; i++) {
jrParameter.getPropertiesMap().removeProperty(names[i]);
}
names = v.getPropertyNames();
for (int i = 0; i < names.length; i++)
jrParameter.getPropertiesMap().setProperty(names[i], v.getProperty(names[i]));
this.getPropertyChangeSupport().firePropertyChange(PROPERTY_MAP, false, true);
}
super.setPropertyValue(id, value);
}
示例2: cloneParameter
import net.sf.jasperreports.engine.design.JRDesignParameter; //导入方法依赖的package包/类
/**
* Utility function to duplicate a parameter. All the parameter properties
* and parameter default value expression are duplicated as well.
*/
public static JRDesignParameter cloneParameter(JRDesignParameter param)
{
JRDesignParameter newParam = new JRDesignParameter();
newParam.setName( param.getName() );
newParam.setForPrompting( param.isForPrompting() );
newParam.setSystemDefined( param.isSystemDefined() );
//newParam.setValueClass( param.getValueClass() );
newParam.setValueClassName( param.getValueClassName() );
newParam.setDescription( param.getDescription());
if (param.getDefaultValueExpression() != null)
{
newParam.setDefaultValueExpression( cloneExpression( (JRDesignExpression)param.getDefaultValueExpression()) );
}
// Duplicate properties...
replacePropertiesMap(param.getPropertiesMap(), newParam.getPropertiesMap());
return newParam;
}
示例3: getTemplate
import net.sf.jasperreports.engine.design.JRDesignParameter; //导入方法依赖的package包/类
public byte[] getTemplate(){
try{
// design.remadgetFields().
design.getFieldsList().clear();
design.getParametersList().clear();
design.getFieldsMap().clear();
design.getParametersMap().clear();
for (JasperReportFieldDto field : fields) {
if (field.isEmpty()){
continue;
}
JRDesignField f = new JRDesignField();
f.setValueClassName(field.getTypeAsString());
f.setValueClass(Class.forName(field.getTypeAsString()));
f.setName(field.getName());
design.addField(f);
}
for (JasperReportParameterDto param : parameters) {
if (param.isEmpty()) {
continue;
}
JRDesignParameter p = new JRDesignParameter();
p.setValueClassName(param.getTypeAsString());
p.setValueClass(Class.forName(param.getTypeAsString()));
p.setName(param.getName());
p.setForPrompting(param.isForPrompting());
p.setDescription(param.getDescription());
p.setNestedTypeName(param.getNestedTypeAsString());
p.setNestedType(param.getNestedType());
p.getPropertiesMap().setBaseProperties(param.getJRProperties());
// p.getPropertiesMap().setProperty(propName, value);
design.addParameter(p);
}
JasperDesign oldDesign = ReportTypeUtil.loadJasperDesign(jasperReportXml);
oldDesign.getParametersList().clear();
oldDesign.getParametersList().addAll(design.getParametersList());
oldDesign.getFieldsList().clear();
oldDesign.getFieldsList().addAll(design.getFieldsList());
JRDesignQuery q = new JRDesignQuery();
q.setLanguage("mql");
q.setText(query);
oldDesign.setQuery(q);
String reportAsString = JRXmlWriter.writeReport(oldDesign, "UTF-8");
return Base64.encodeBase64(reportAsString.getBytes("UTF-8"));
} catch (JRException | ClassNotFoundException | SchemaException | UnsupportedEncodingException ex) {
throw new IllegalStateException(ex.getMessage(), ex.getCause());
}
}
示例4: getTemplate
import net.sf.jasperreports.engine.design.JRDesignParameter; //导入方法依赖的package包/类
public byte[] getTemplate(){
try{
// design.remadgetFields().
design.getFieldsList().clear();
design.getParametersList().clear();
design.getFieldsMap().clear();
design.getParametersMap().clear();
for (JasperReportFieldDto field : fields) {
if (field.isEmpty()){
continue;
}
JRDesignField f = new JRDesignField();
f.setValueClassName(field.getTypeAsString());
f.setValueClass(Class.forName(field.getTypeAsString()));
f.setName(field.getName());
design.addField(f);
}
for (JasperReportParameterDto param : parameters) {
if (param.isEmpty()) {
continue;
}
JRDesignParameter p = new JRDesignParameter();
p.setValueClassName(param.getTypeAsString());
p.setValueClass(Class.forName(param.getTypeAsString()));
p.setName(param.getName());
p.setForPrompting(param.isForPrompting());
p.setDescription(param.getDescription());
p.setNestedTypeName(param.getNestedTypeAsString());
p.setNestedType(param.getNestedType());
p.getPropertiesMap().setBaseProperties(param.getJRProperties());
// p.getPropertiesMap().setProperty(propName, value);
design.addParameter(p);
}
JasperDesign oldDesign = ReportTypeUtil.loadJasperDesign(jasperReportXml);
oldDesign.getParametersList().clear();
oldDesign.getParametersList().addAll(design.getParametersList());
oldDesign.getFieldsList().clear();
oldDesign.getFieldsList().addAll(design.getFieldsList());
JRDesignQuery q = new JRDesignQuery();
q.setLanguage("mql");
q.setText(query);
oldDesign.setQuery(q);
String reportAsString = JRXmlWriter.writeReport(oldDesign, "UTF-8");
return Base64.encodeBase64(reportAsString.getBytes("UTF-8"));
} catch (JRException | ClassNotFoundException | SchemaException | UnsupportedEncodingException ex) {
throw new IllegalStateException(ex.getMessage(), ex.getCause());
}
}