本文整理汇总了Java中net.sf.jasperreports.engine.design.JRDesignSubreport类的典型用法代码示例。如果您正苦于以下问题:Java JRDesignSubreport类的具体用法?Java JRDesignSubreport怎么用?Java JRDesignSubreport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JRDesignSubreport类属于net.sf.jasperreports.engine.design包,在下文中一共展示了JRDesignSubreport类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createSubreport
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
static JRDesignSubreport createSubreport(int x, int y, int subheight, String subreportDesignExpression, String subreportDataExpression,
JRDefaultStyleProvider defaultStyleProvider) {
JRDesignSubreport sub = new JRDesignSubreport(defaultStyleProvider);
sub.setHeight(subheight);
sub.setX(x);
sub.setY(y);
sub.setPrintRepeatedValues(true);
sub.setRemoveLineWhenBlank(true);
//sub.setPrintInFirstWholeBand(true);
if (subreportDataExpression != null) {
sub.setDataSourceExpression(new JRDesignExpression(subreportDataExpression));
}
// expect the subreport template as a parameter to the main report - see
// http://stackoverflow.com/questions/9785451/generate-jasper-report-with-subreport-from-java
if (subreportDesignExpression != null) {
JRDesignExpression subexpression = new JRDesignExpression(subreportDesignExpression);
sub.setExpression(subexpression);
}
return sub;
}
开发者ID:PGWelch,项目名称:com.opendoorlogistics,代码行数:24,代码来源:ReportBuilderUtils.java
示例2: createObject
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);
JRDesignSubreport subreport = new JRDesignSubreport(jasperDesign);
String isUsingCache = atts.getValue(JRXmlConstants.ATTRIBUTE_isUsingCache);
if (isUsingCache != null && isUsingCache.length() > 0)
{
subreport.setUsingCache(Boolean.valueOf(isUsingCache));
}
String runToBottomAttr = atts.getValue(JRXmlConstants.ATTRIBUTE_runToBottom);
if (runToBottomAttr != null)
{
subreport.setRunToBottom(Boolean.valueOf(runToBottomAttr));
}
return subreport;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:JRSubreportFactory.java
示例3: createControls
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
parent.setLayout(new GridLayout(2, false));
createWidget4Property(parent, JRBaseSubreport.PROPERTY_RUN_TO_BOTTOM);
createWidget4Property(parent, JRBaseSubreport.PROPERTY_USING_CACHE);
createWidget4Property(parent, JRDesignSubreport.PROPERTY_EXPRESSION);
createWidget4Property(parent, JRDesignSubreport.PROPERTY_PARAMETERS_MAP_EXPRESSION);
createWidget4Property(parent, JRDesignSubreport.PROPERTY_CONNECTION_EXPRESSION);
createWidget4Property(parent, JRDesignSubreport.PROPERTY_DATASOURCE_EXPRESSION);
Composite cmp = getWidgetFactory().createComposite(parent);
cmp.setLayout(new GridLayout(2, false));
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
gd.horizontalSpan = 2;
cmp.setLayoutData(gd);
createWidget4Property(cmp, JRDesignSubreport.PROPERTY_RETURN_VALUES, false);
createWidget4Property(cmp, JRDesignSubreport.PROPERTY_PARAMETERS, false);
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:SubreportSection.java
示例4: getSubreportPropertySet
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
/**
* Get the static text properties...
*/
public static Sheet.Set getSubreportPropertySet(JRDesignSubreport element, JasperDesign jd)
{
JRDesignDataset dataset = ModelUtils.getElementDataset(element, jd);
Sheet.Set propertySet = Sheet.createPropertiesSet();
propertySet.setName("SUBREPORT_ELEMENT_PROPERTIES");
propertySet.setDisplayName("Subreport properties");
propertySet.put(new SubreportExpressionProperty(element, dataset));
propertySet.put(new SubreportExpressionClassNameProperty(element));
propertySet.put(new SubreportUsingCacheProperty(element));
propertySet.put(new RunToBottomProperty(element));
propertySet.put(new ParametersMapExpressionProperty(element, dataset));
propertySet.put(new ConnectionTypeProperty(element) );
propertySet.put(new ConnectionExpressionProperty(element, dataset));
propertySet.put(new DataSourceExpressionProperty(element, dataset));
propertySet.put(new SubreportParametersProperty(element, dataset));
propertySet.put(new SubreportReturnValuesProperty(element, dataset));
//propertySet.put(new LeftProperty( element ));
return propertySet;
}
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:25,代码来源:SubreportPropertiesFactory.java
示例5: createSubreport
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
/**
* Create a subreport {@link JRDesignSubreport}. Since all kinds of reports are created through the {@link TravelReportFactoryServiceImpl} class,
* even sub report instances will be considered normal reports and created individually. This method just marks where in the
* parent report to place the sub report. This does not actually create another report.
*
* @param report is the parent report
* @field is the field that is a {@link SubReport}
* @return {@link JRDesignSubreport} to be added to report
*/
protected JRDesignSubreport createSubreport(final ReportInfo report, final Field field) throws Exception {
final JRDesignSubreport retval = new JRDesignSubreport(new JasperDesign());
final JRDesignExpression dsExpression = new JRDesignExpression();
final String getterName = "get" + field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
dsExpression.setText("$P{report}." + getterName + "()");
dsExpression.setValueClass(JRDataSource.class);
retval.setDataSourceExpression(dsExpression);
final JRDesignExpression expression = new JRDesignExpression();
expression.setValueClass(JasperReport.class);
expression.setText("$P{" + field.getName() + "Subreport}");
retval.setExpression(expression);
retval.setHeight(SUBREPORT_HEIGHT);
return retval;
}
开发者ID:kuali,项目名称:kfs,代码行数:27,代码来源:TravelReportFactoryServiceImpl.java
示例6: setParametersMapExpression
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
/**
*
*/
public void setParametersMapExpression(JRExpression parametersMapExpression)
{
Object old = this.parametersMapExpression;
this.parametersMapExpression = parametersMapExpression;
getEventSupport().firePropertyChange(JRDesignSubreport.PROPERTY_PARAMETERS_MAP_EXPRESSION, old, this.parametersMapExpression);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:StandardSubreportPartComponent.java
示例7: addParameter
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
/**
*
*/
public void addParameter(JRSubreportParameter subreportParameter) throws JRException
{
if (this.parametersMap.containsKey(subreportParameter.getName()))
{
throw
new JRException(
JRDesignSubreport.EXCEPTION_MESSAGE_KEY_DUPLICATE_PARAMETER,
new Object[]{subreportParameter.getName()});
}
this.parametersMap.put(subreportParameter.getName(), subreportParameter);
getEventSupport().fireCollectionElementAddedEvent(JRDesignSubreport.PROPERTY_PARAMETERS,
subreportParameter, parametersMap.size() - 1);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:StandardSubreportPartComponent.java
示例8: removeParameter
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
/**
*
*/
public JRSubreportParameter removeParameter(String name)
{
JRSubreportParameter removed = this.parametersMap.remove(name);
if (removed != null)
{
getEventSupport().fireCollectionElementRemovedEvent(JRDesignSubreport.PROPERTY_PARAMETERS, removed, -1);
}
return removed;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:StandardSubreportPartComponent.java
示例9: addReturnValue
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
/**
* Adds a return value to the subreport.
*
* @param returnValue the return value to be added.
*/
public void addReturnValue(JRSubreportReturnValue returnValue)
{
this.returnValues.add(returnValue);
getEventSupport().fireCollectionElementAddedEvent(JRDesignSubreport.PROPERTY_RETURN_VALUES,
returnValue, returnValues.size() - 1);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:12,代码来源:StandardSubreportPartComponent.java
示例10: removeReturnValue
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
/**
* Removes a return value from the subreport.
*
* @param returnValue the return value to be removed
* @return <code>true</code> if the return value was found and removed
*/
public boolean removeReturnValue(JRSubreportReturnValue returnValue)
{
int idx = this.returnValues.indexOf(returnValue);
if (idx >= 0)
{
this.returnValues.remove(idx);
getEventSupport().fireCollectionElementRemovedEvent(JRDesignSubreport.PROPERTY_RETURN_VALUES, returnValue, idx);
return true;
}
return false;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:StandardSubreportPartComponent.java
示例11: setExpression
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
/**
*
*/
public void setExpression(JRExpression expression)
{
Object old = this.expression;
this.expression = expression;
getEventSupport().firePropertyChange(JRDesignSubreport.PROPERTY_EXPRESSION, old, this.expression);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:StandardSubreportPartComponent.java
示例12: publishJrxml
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
private void publishJrxml(AMJrxmlContainer mres, IProgressMonitor monitor, JasperDesign jasper, Set<String> fileset, IFile file) throws Exception {
if (monitor.isCanceled())
return;
MReportUnit mrunit = null;
if (mres instanceof MReportUnit)
mrunit = (MReportUnit) mres;
else if (mres.getParent() instanceof MReportUnit)
mrunit = (MReportUnit) mres.getParent();
if (mrunit != null) {
List<JRDesignElement> elements = ModelUtils.getAllElements(jasper);
for (JRDesignElement ele : elements) {
if (ele instanceof JRDesignImage)
publishImage(mrunit, monitor, jasper, fileset, file, ele, version);
else if (ele instanceof JRDesignSubreport) {
publishSubreport(mrunit, monitor, jasper, fileset, file, ele, version);
} else {
publishElement(mrunit, monitor, jasper, fileset, file, ele, version);
}
}
publishDataAdapters(mrunit, monitor, jasper, fileset, file, version);
publishBundles(mrunit, monitor, jasper, fileset, file, version);
publishTemplates(mrunit, monitor, jasper, fileset, file, version);
}
// here extend and give possibility to contribute to plugins
Activator.getExtManager().publishJrxml(mres, monitor, jasper, fileset, file, version);
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:JrxmlPublishContributor.java
示例13: initializeProvidedProperties
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
@Override
protected void initializeProvidedProperties() {
super.initializeProvidedProperties();
addProvidedProperties(JRBaseSubreport.PROPERTY_RUN_TO_BOTTOM, Messages.MSubreport_run_to_bottom);
addProvidedProperties(JRBaseSubreport.PROPERTY_USING_CACHE, Messages.common_using_cache);
addProvidedProperties(JRDesignSubreport.PROPERTY_EXPRESSION, Messages.common_expression);
addProvidedProperties(JRDesignSubreport.PROPERTY_PARAMETERS_MAP_EXPRESSION, Messages.common_parameters_map_expression);
addProvidedProperties(JRDesignSubreport.PROPERTY_CONNECTION_EXPRESSION, Messages.common_connection_expression);
addProvidedProperties(JRDesignSubreport.PROPERTY_DATASOURCE_EXPRESSION, Messages.MSubreport_datasource_expression);
addProvidedProperties(JRDesignSubreport.PROPERTY_RETURN_VALUES, Messages.common_return_values);
addProvidedProperties(JRDesignSubreport.PROPERTY_PARAMETERS, Messages.common_parameters);
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:SubreportSection.java
示例14: getSubreportFiles
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
public static Map<File, IFile> getSubreportFiles(JasperReportsConfiguration jConfig, IFile file, JasperDesign jd,
IProgressMonitor monitor) {
Map<File, IFile> fmap = new HashMap<File, IFile>();
try {
List<JRDesignElement> elements = ModelUtils.getAllElements(jd);
for (JRDesignElement ele : elements) {
if (ele instanceof JRDesignSubreport)
publishSubreport(jConfig, fmap, monitor, file, jd, (JRDesignSubreport) ele);
}
} finally {
jConfig.init(file);
}
return fmap;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:SubreportsUtil.java
示例15: getPropertyValue
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
@Override
public Object getPropertyValue(Object id) {
JRDesignSubreport jrElement = (JRDesignSubreport) getValue();
if (id.equals(JRBaseSubreport.PROPERTY_RUN_TO_BOTTOM))
return jrElement.isRunToBottom();
if (id.equals(JRBaseSubreport.PROPERTY_USING_CACHE))
return jrElement.getUsingCache();
if (id.equals(JRDesignSubreport.PROPERTY_EXPRESSION))
return ExprUtil.getExpression(jrElement.getExpression());
if (id.equals(JRDesignSubreport.PROPERTY_PARAMETERS_MAP_EXPRESSION))
return ExprUtil.getExpression(jrElement.getParametersMapExpression());
if (id.equals(JRDesignSubreport.PROPERTY_CONNECTION_EXPRESSION))
return ExprUtil.getExpression(jrElement.getConnectionExpression());
if (id.equals(JRDesignSubreport.PROPERTY_DATASOURCE_EXPRESSION))
return ExprUtil.getExpression(jrElement.getDataSourceExpression());
if (id.equals(JRDesignSubreport.PROPERTY_PARAMETERS))
return JRCloneUtils.cloneArray(jrElement.getParameters());
if (id.equals(JRDesignSubreport.PROPERTY_RETURN_VALUES)) {
if (returnValuesDTO == null) {
returnValuesDTO = new JReportsDTO();
returnValuesDTO.setjConfig(getJasperConfiguration());
returnValuesDTO.setProp1(jrElement);
}
returnValuesDTO.setValue(JRCloneUtils.cloneList(jrElement.getReturnValuesList()));
return returnValuesDTO;
}
return super.getPropertyValue(id);
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:31,代码来源:MSubreport.java
示例16: createJRElement
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
@Override
public JRDesignElement createJRElement(JasperDesign jasperDesign) {
JRDesignSubreport subreport = new JRDesignSubreport(jasperDesign);
DefaultManager.INSTANCE.applyDefault(this.getClass(), subreport);
return subreport;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:9,代码来源:MSubreport.java
示例17: trasnferProperties
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
@Override
public void trasnferProperties(JRElement target){
super.trasnferProperties(target);
JRDesignSubreport jrSource = (JRDesignSubreport) getValue();
if (jrSource != null){
JRDesignSubreport jrTarget = (JRDesignSubreport)target;
jrTarget.setRunToBottom(jrSource.isRunToBottom());
}
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:MSubreport.java
示例18: addPages
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
@Override
public void addPages() {
this.subreport = new MSubreport();
subreport.setValue(subreport.createJRElement(getConfig().getJasperDesign()));
subreport.setPropertyValue(JRDesignSubreport.PROPERTY_CONNECTION_EXPRESSION, "$P{REPORT_CONNECTION}");
step0 = new NewSubreportPage();
step0.setSubreport(subreport);
addPage(step0);
subreport.setJasperConfiguration(getConfig());
step2 = new WizardConnectionPage();
addPage(step2);
step3 = new SubreportPropertyPage();
addPage(step3);
// Setting up the expressions context. This is not really useful, since
// the subreport has not been added to the report yet and it will be fallback to the default dataset.
// FIXME: pass a proper ANode to the wizard to let the code to lookup for a more appropriate dataset.
ExpressionContext ec = ModelUtils.getElementExpressionContext((JRDesignElement)subreport.getValue(), subreport);
step0.setExpressionContext(ec);
step2.setExpressionContext(ec);
// FIXME: add support to the step3 for setting the expression context
//step3.setExpressionContext(ec);
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:29,代码来源:SubreportWizard.java
示例19: SubreportParametersProperty
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public SubreportParametersProperty(JRDesignSubreport element, JRDesignDataset dataset)
{
super( JRDesignSubreport.PROPERTY_PARAMETERS, Map.class, "Parameters","Subreport parameters", true,true);
setValue("canEditAsText", Boolean.FALSE);
setValue("expressionContext", new ExpressionContext(dataset));
//setValue("subreport", element);
this.element = element;
this.dataset = dataset;
}
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:12,代码来源:SubreportParametersProperty.java
示例20: setValue
import net.sf.jasperreports.engine.design.JRDesignSubreport; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void setValue(Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
if (val == null || !(val instanceof Map)) throw new IllegalArgumentException();
// Fill this map with the content of the map we got here...
// TODO: manage UNDO for a map object...
Map parameters = (Map)val;
element.getParametersMap().clear();
element.getParametersMap().putAll(parameters);
element.getEventSupport().firePropertyChange( JRDesignSubreport.PROPERTY_PARAMETERS , null, element.getParametersMap() );
}
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:12,代码来源:SubreportParametersProperty.java
注:本文中的net.sf.jasperreports.engine.design.JRDesignSubreport类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论