• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JRDesignDatasetRun类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中net.sf.jasperreports.engine.design.JRDesignDatasetRun的典型用法代码示例。如果您正苦于以下问题:Java JRDesignDatasetRun类的具体用法?Java JRDesignDatasetRun怎么用?Java JRDesignDatasetRun使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

JRDesignDatasetRun类属于net.sf.jasperreports.engine.design包,在下文中一共展示了JRDesignDatasetRun类的39个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: performAction

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public void performAction() throws ActionException {
	JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun();

	String datasetName = datasetRun.getDatasetName();
	
	JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext());
	
	JasperDesign jasperDesign = cache.getJasperDesign(targetUri);
	JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName);
	
	// execute command
	try {
		getCommandStack().execute(
			new ResetInCacheCommand(
				new FilterCommand(getJasperReportsContext(), dataset, getFilterData()),
				getJasperReportsContext(),
				getReportContext(), 
				targetUri
				)
			);
	} catch (CommandException e) {
		throw new ActionException(e);
	}
}
 

开发者ID:TIBCOSoftware,
项目名称:jasperreports,
代码行数:26,
代码来源:FilterAction.java

示例2: performAction

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public void performAction() throws ActionException {
	JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun();
	
	String datasetName = datasetRun.getDatasetName();
	
	JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext());

	JasperDesign jasperDesign = cache.getJasperDesign(targetUri);
	JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName);
	
	// execute command
	try {
		getCommandStack().execute(
			new ResetInCacheCommand(
				new SortCommand(getJasperReportsContext(), dataset, getSortData()),
				getJasperReportsContext(),
				getReportContext(), 
				targetUri
				)
			);
	} catch (CommandException e) {
		throw new ActionException(e);
	}
}
 

开发者ID:TIBCOSoftware,
项目名称:jasperreports,
代码行数:26,
代码来源:SortAction.java

示例3: fillData

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
private void fillData() {
	final String[] ds = ModelUtils.getDataSets(jrDesign, true);
	dsCombo.setItems(ds);
	dsCombo.select(0);
	if (eDataset != null && eDataset.getDatasetRun() != null) {
		for (int i = 0; i < ds.length; i++) {
			if (ds[i].equals(eDataset.getDatasetRun().getDatasetName())) {
				dsCombo.select(i);
				break;
			}
		}
		dsRun.setData((JRDesignDatasetRun) eDataset.getDatasetRun());
		dsRun.setExpressionContext(this.expContext);
	}

	enableMainDatasetRun();
	fillIncrement();
	fillResetGroup();
	dsCombo.getParent().layout(true);
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:21,
代码来源:ElementDatasetWidget.java

示例4: setPropertyValue

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
	StandardListComponent jrList = getList();

	if (id.equals(StandardListComponent.PROPERTY_IGNORE_WIDTH))
		jrList.setIgnoreWidth((Boolean) value);
	else if (id.equals(StandardListComponent.PROPERTY_PRINT_ORDER))
		jrList.setPrintOrderValue((PrintOrderEnum) printOrderD.getEnumValue(value));
	else if (id.equals(PREFIX + DesignListContents.PROPERTY_HEIGHT))
		((DesignListContents) jrList.getContents()).setHeight((Integer) value);
	else if (id.equals(PREFIX + DesignListContents.PROPERTY_WIDTH))
		((DesignListContents) jrList.getContents()).setWidth((Integer) value);
	else if (id.equals(PREFIX + JRDesignElementDataset.PROPERTY_DATASET_RUN)) {
		if (value == null) {
			jrList.setDatasetRun(null);
		} else {
			MDatasetRun mdr = (MDatasetRun) value;
			JRDesignDatasetRun dr = (JRDesignDatasetRun) mdr.getValue();
			if (dr.getDatasetName() != null)
				jrList.setDatasetRun(dr);
			else
				jrList.setDatasetRun(null);
		}
	} else
		super.setPropertyValue(id, value);
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:27,
代码来源:MList.java

示例5: createJRElement

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement component = new JRDesignComponentElement();
	component.setHeight(getDefaultHeight());
	component.setWidth(getDefaultWidth());
	StandardListComponent componentImpl = new StandardListComponent();
	DesignListContents contents = new DesignListContents();
	contents.setHeight(100);
	contents.setWidth(100);
	componentImpl.setContents(contents);

	component.setComponent(componentImpl);
	ComponentKey componentKey = new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "jr", "list");
	component.setComponentKey(componentKey);

	JRDesignDatasetRun datasetRun = new JRDesignDatasetRun();
	componentImpl.setDatasetRun(datasetRun);

	DefaultManager.INSTANCE.applyDefault(this.getClass(), component);

	return component;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:23,
代码来源:MList.java

示例6: setPropertyValue

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
	StandardTable jrTable = getStandardTable();

	if (id.equals(StandardTable.PROPERTY_WHEN_NO_DATA_TYPE))
		jrTable.setWhenNoDataType((WhenNoDataTypeTableEnum) whennodataD.getEnumValue(value));
	else if (id.equals(StandardTable.PROPERTY_DATASET_RUN)) {
		MDatasetRun mdr = (MDatasetRun) value;
		JRDesignDatasetRun dr = (JRDesignDatasetRun) mdr.getValue();
		if (dr.getDatasetName() != null)
			jrTable.setDatasetRun(dr);
		else
			jrTable.setDatasetRun(null);
	}
	super.setPropertyValue(id, value);
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:17,
代码来源:MTable.java

示例7: setData

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public void setData(JRDesignDatasetRun datasetrun) {
	this.datasetrun = datasetrun;
	if (datasetrun != null) {
		if (datasetrun.getConnectionExpression() == null && datasetrun.getDataSourceExpression() == null) {
			cnExpr.setEnabled(false);
			cmb.select(0);
		} else if (datasetrun.getConnectionExpression() != null) {
			cnExpr.setEnabled(true);
			cnExpr.bindObject(datasetrun, "ConnectionExpression");
			cmb.select(1);
		} else if (datasetrun.getDataSourceExpression() != null) {
			cnExpr.setEnabled(true);
			cnExpr.bindObject(datasetrun, "DataSourceExpression");
			cmb.select(2);
		}
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:18,
代码来源:DatasetRunWidget.java

示例8: setValue

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
/**
 * Set the valued edited by this dialog
 * 
 * @param value a ParametersDTO (not null) of the parameters list that the user manipulate  
 * @param datasetRun the (not null) dataset run from where the value is extracted
 */
public void setValue(ParameterDTO value, MDatasetRun datasetRun) {
	this.value = value;
	if (value == null) {
		value = new ParameterDTO();
	}
	//get the dataset referenced by the dataset run
	JRDataset dataset = datasetRun.getJasperDesign().getDatasetMap().get(datasetRun.getPropertyValue(JRDesignDatasetRun.PROPERTY_DATASET_NAME));
	if (dataset != null) {
		List<JRParameter> userParameters = new ArrayList<JRParameter>();
		//flag to add or not the system parameters
		boolean addSystemParameters = true;
		for(JRParameter param : dataset.getParameters()){
			if (!param.isSystemDefined() || addSystemParameters) userParameters.add(param);
		}
		//the original dataset parameters are cached
		datasetParameters = userParameters.toArray(new JRParameter[userParameters.size()]);
	}
	else datasetParameters = new JRDesignParameter[0];
	if (table != null)
		fillTable(table);
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:28,
代码来源:ComboParametersPage.java

示例9: getDatasetRun

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public static List<JRDesignDatasetRun> getDatasetRun(MReport mrep, JRDataset jDataset) {
	final String dsName = jDataset.getName();
	final List<JRDesignDatasetRun> dsRuns = new ArrayList<JRDesignDatasetRun>();
	new ModelVisitor<Object>(mrep) {

		@Override
		public boolean visit(INode n) {
			if (n instanceof IDatasetContainer) {
				List<MDatasetRun> dsRunList = ((IDatasetContainer) n).getDatasetRunList();
				if (dsRunList != null)
					for (MDatasetRun mdsrun : dsRunList) {
						JRDesignDatasetRun dsrun = mdsrun.getValue();
						if (dsrun.getDataSourceExpression() != null)
							continue;
						if (dsrun.getDatasetName() != null && dsrun.getDatasetName().equals(dsName))
							dsRuns.add(dsrun);
					}
			}
			return true;
		}
	};
	return dsRuns;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:24,
代码来源:SyncDatasetRunParameters.java

示例10: postSetValue

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
/**
 * Get a list of all the datasets used by every element, and if one or more of this are references to the dataset 
 * with the changed name ask if the user want to refactor the name inside the project
 */
@Override
public Command postSetValue(IPropertySource target, Object prop, Object newValue, Object oldValue) {
	JSSCompoundCommand c = new JSSCompoundCommand(null);
	c.setReferenceNodeIfNull(target);
	//Check if the updated element is a dataset and the updated property is the name
	if (target instanceof MDataset && prop.equals(JRDesignDataset.PROPERTY_NAME)) {
		//Get all the references to this dataset
		List<IDatasetContainer> references = DeleteDatasetCommand.getDatasetUsage(((MDataset)target).getRoot().getChildren(), oldValue.toString());
		if (references.size()>0){
			boolean selectedYes = UIUtils.showConfirmation(Messages.PostSetDatasetName_title, Messages.PostSetDatasetName_message);
			if (selectedYes){
				for(IDatasetContainer datasetRun : references){
					List<MDatasetRun> datasetList = datasetRun.getDatasetRunList();
					for (MDatasetRun actualDataset : datasetList){
						if (actualDataset != null && oldValue.toString().equals(actualDataset.getPropertyValue(JRDesignDatasetRun.PROPERTY_DATASET_NAME)))
							c.add(new SetDatasetRunName(actualDataset, oldValue.toString(), newValue.toString()));
					}
				}
			}
		}
	}
	return c;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:28,
代码来源:PostSetDatasetName.java

示例11: execute

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public void execute() {
	ParameterDTO parameters = (ParameterDTO) element.getPropertyValue(JRDesignDatasetRun.PROPERTY_PARAMETERS);
	List<JRDatasetParameter> lst = new ArrayList<JRDatasetParameter>(Arrays.asList(parameters.getValue()));
	for (JRDatasetParameter param : lst) {
		if (param.getName() != null && param.getName().equals(oldName)) {
			try {
				// The parameter is removed and readded to have JR to update its internal structure (list and map)
				element.getValue().removeParameter(param);
				((JRDesignDatasetParameter) param).setName(newName);
				element.getValue().addParameter(param);
				parameterFound = true;
			} catch (JRException e) {
				e.printStackTrace();
			}
			// element.setPropertyValue(JRDesignDatasetRun.PROPERTY_PARAMETERS, parameters);
			// The parameter was found, i mark the flag to support the undo and exit the cycle when the parameter is found
			// since the aren't two parameters with the same name
			break;
		}
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:23,
代码来源:PostSetParameterName.java

示例12: undo

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public void undo() {
	if (parameterFound) {
		ParameterDTO parameters = (ParameterDTO) element.getPropertyValue(JRDesignDatasetRun.PROPERTY_PARAMETERS);
		List<JRDatasetParameter> lst = new ArrayList<JRDatasetParameter>(Arrays.asList(parameters.getValue()));
		for (JRDatasetParameter param : lst) {
			if (param.getName() != null && param.getName().equals(newName)) {
				try {
					// The parameter is removed and readded to have JR to update its internal structure (list and map)
					element.getValue().removeParameter(param);
					((JRDesignDatasetParameter) param).setName(oldName);
					element.getValue().addParameter(param);
				} catch (JRException e) {
					e.printStackTrace();
				}
				parameterFound = false;
				break;
			}
		}
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:22,
代码来源:PostSetParameterName.java

示例13: getElementDataset

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
/**
 * Return the dataset nearest to this element
 * 
 * @param node the actual node
 * @return the dataset nearest to this element or null if it can't be found
 */
private JRDataset getElementDataset(ANode node){
	if (node instanceof APropertyNode){
		APropertyNode pnode = (APropertyNode)node;
		MDatasetRun mdataset = (MDatasetRun) pnode.getPropertyValue(JRDesignElementDataset.PROPERTY_DATASET_RUN);
		if (mdataset != null) {
				JRDesignDatasetRun datasetRun = mdataset.getValue();
				if (datasetRun != null) {
					String dsname = datasetRun.getDatasetName();
					return getJasperDesign().getDatasetMap().get(dsname);
				}
		} 
	}
	ANode parent = node.getParent();
	if (parent != null){
		return getElementDataset(parent);
	} else if (getJasperDesign() != null){
		return getJasperDesign().getMainDataset();
	} else {
		return null;
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:28,
代码来源:MTextField.java

示例14: jRTextExpressionAreaMapExpressionTextChanged

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public void jRTextExpressionAreaMapExpressionTextChanged() {
    if (this.isInit()) return;
    if (currentSelectedComponent != null)
    {
        JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)currentSelectedComponent.getMarkerData().getDataset().getDatasetRun();
        if (datasetRun != null)
        {
            JRDesignExpression exp = null;
            if (jRTextExpressionAreaMapExpression.getText().trim().length() > 0)
            {
                exp = new JRDesignExpression();
                exp.setValueClassName("java.util.Map");//NOI18N
                exp.setText(jRTextExpressionAreaMapExpression.getText());
            }

            datasetRun.setParametersMapExpression(exp);
            notifyChange();
        }
    }
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:21,
代码来源:MapMarkersPanel.java

示例15: jRTextExpressionAreaTextConnectionExpressionTextChanged

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public void jRTextExpressionAreaTextConnectionExpressionTextChanged() {
    if (this.isInit()) return;
    if (currentSelectedComponent != null)
    {
        JRDesignExpression exp = null;
        if (jRTextExpressionAreaTextConnectionExpression.getText().trim().length() > 0)
        {
            exp = new JRDesignExpression();
            exp.setText(jRTextExpressionAreaTextConnectionExpression.getText());
        }

        int index = jComboBoxDatasetConnectionType.getSelectedIndex();

        if (index == 1)
        {
            if (exp != null) exp.setValueClassName("java.sql.Connection");//NOI18N
            ((JRDesignDatasetRun) getDesignDataset().getDatasetRun()).setConnectionExpression(exp);
        }
        else if (index == 2)
        {
            if (exp != null) exp.setValueClassName("net.sf.jasperreports.engine.JRDataSource");//NOI18N
            ((JRDesignDatasetRun) getDesignDataset().getDatasetRun()).setDataSourceExpression(exp);
        }
        notifyChange();
     }
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:27,
代码来源:MapMarkersPanel.java

示例16: jButtonRemParameterActionPerformed

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
private void jButtonRemParameterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemParameterActionPerformed
    if (this.isInit()) return;

    if (getCurrentSelectedComponent() == null) return;

    javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel)jTableDatasetParameters.getModel();

    JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)getDesignDataset().getDatasetRun();

    while (jTableDatasetParameters.getSelectedRowCount() > 0) {
        int i=jTableDatasetParameters.getSelectedRow();
        datasetRun.removeParameter( ((JRDatasetParameter)jTableDatasetParameters.getValueAt( i, 0)).getName() );
        dtm.removeRow(i);
    }
    notifyChange();
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:17,
代码来源:MapMarkersPanel.java

示例17: jRTextExpressionAreaMapExpressionTextChanged

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public void jRTextExpressionAreaMapExpressionTextChanged() {
    if (this.isInit()) return;
    if (currentSelectedChartComponent != null)
    {
        JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)currentSelectedChartComponent.getDataset().getDatasetRun();
        if (datasetRun != null)
        {
            JRDesignExpression exp = null;
            if (jRTextExpressionAreaMapExpression.getText().trim().length() > 0)
            {
                exp = new JRDesignExpression();
                exp.setValueClassName("java.util.Map");//NOI18N
                exp.setText(jRTextExpressionAreaMapExpression.getText());
            }

            datasetRun.setParametersMapExpression(exp);
            notifyChange();
        }
    }
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:21,
代码来源:SpiderChartPanel.java

示例18: jRTextExpressionAreaTextConnectionExpressionTextChanged

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public void jRTextExpressionAreaTextConnectionExpressionTextChanged() {
    if (this.isInit()) return;
    if (currentSelectedChartComponent != null)
    {
        JRDesignExpression exp = null;
        if (jRTextExpressionAreaTextConnectionExpression.getText().trim().length() > 0)
        {
            exp = new JRDesignExpression();
            exp.setText(jRTextExpressionAreaTextConnectionExpression.getText());
        }

        int index = jComboBoxDatasetConnectionType.getSelectedIndex();

        if (index == 1)
        {
            if (exp != null) exp.setValueClassName("java.sql.Connection");//NOI18N
            ((JRDesignDatasetRun) currentSelectedChartComponent.getDataset().getDatasetRun()).setConnectionExpression(exp);
        }
        else if (index == 2)
        {
            if (exp != null) exp.setValueClassName("net.sf.jasperreports.engine.JRDataSource");//NOI18N
            ((JRDesignDatasetRun) currentSelectedChartComponent.getDataset().getDatasetRun()).setDataSourceExpression(exp);
        }
        notifyChange();
     }
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:27,
代码来源:SpiderChartPanel.java

示例19: jButtonRemParameterActionPerformed

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
private void jButtonRemParameterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemParameterActionPerformed
    if (this.isInit()) return;

    if (getCurrentSelectedChartComponent() == null) return;

    javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel)jTableDatasetParameters.getModel();

    JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)getCurrentSelectedChartComponent().getDataset().getDatasetRun();

    while (jTableDatasetParameters.getSelectedRowCount() > 0) {
        int i=jTableDatasetParameters.getSelectedRow();
        datasetRun.removeParameter( ((JRDatasetParameter)jTableDatasetParameters.getValueAt( i, 0)).getName() );
        dtm.removeRow(i);
    }
    notifyChange();
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:17,
代码来源:SpiderChartPanel.java

示例20: performAction

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
protected void performAction(org.openide.nodes.Node[] activatedNodes) {

        ElementNode node = (ElementNode)activatedNodes[0];
        if (node.getElement() instanceof JRDesignComponentElement &&
            ((JRDesignComponentElement)node.getElement()).getComponent() instanceof StandardListComponent)
        {
            ComponentDatasetRunPanel panel = new ComponentDatasetRunPanel();
            panel.setJasperDesign( node.getJasperDesign() );
            StandardListComponent component = (StandardListComponent)((JRDesignComponentElement)node.getElement()).getComponent();
            panel.setDatasetRun( (JRDesignDatasetRun)component.getDatasetRun()   );

            if (panel.showDialog(Misc.getMainFrame(), true) == JOptionPane.OK_OPTION)
            {
                component.setDatasetRun( panel.getDatasetRun() );
                IReportManager.getInstance().notifyReportChange();
            }
        }
    }
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:19,
代码来源:EditDatasetRunAction.java

示例21: performAction

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
protected void performAction(org.openide.nodes.Node[] activatedNodes) {

        ElementNode node = (ElementNode)activatedNodes[0];
        if (node.getElement() instanceof JRDesignComponentElement &&
            ((JRDesignComponentElement)node.getElement()).getComponent() instanceof StandardTable)
        {
            ComponentDatasetRunPanel panel = new ComponentDatasetRunPanel();
            panel.setJasperDesign( node.getJasperDesign() );
            StandardTable component = (StandardTable)((JRDesignComponentElement)node.getElement()).getComponent();
            panel.setDatasetRun( (JRDesignDatasetRun)component.getDatasetRun()   );

            if (panel.showDialog(Misc.getMainFrame(), true) == JOptionPane.OK_OPTION)
            {
                component.setDatasetRun( panel.getDatasetRun() );
                IReportManager.getInstance().notifyReportChange();
            }
        }
    }
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:19,
代码来源:EditDatasetRunAction.java

示例22: jRTextExpressionAreaMapExpressionTextChanged

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public void jRTextExpressionAreaMapExpressionTextChanged() {
    if (this.isInit()) return; 
    if (currentSelectedChartElement != null)
    {
        JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)currentSelectedChartElement.getDataset().getDatasetRun();
        if (datasetRun != null)
        {
            JRDesignExpression exp = null;
            if (jRTextExpressionAreaMapExpression.getText().trim().length() > 0)
            {
                exp = new JRDesignExpression();
                exp.setValueClassName("java.util.Map");//NOI18N
                exp.setText(jRTextExpressionAreaMapExpression.getText());
            }
            
            datasetRun.setParametersMapExpression(exp);
            notifyChange();
        }
    }
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:21,
代码来源:ChartPropertiesDialog.java

示例23: jRTextExpressionAreaTextConnectionExpressionTextChanged

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public void jRTextExpressionAreaTextConnectionExpressionTextChanged() {
    if (this.isInit()) return; 
    if (currentSelectedChartElement != null)
    {
        JRDesignExpression exp = null;
        if (jRTextExpressionAreaTextConnectionExpression.getText().trim().length() > 0)
        {
            exp = new JRDesignExpression();
            exp.setText(jRTextExpressionAreaTextConnectionExpression.getText());
        }
        
        int index = jComboBoxDatasetConnectionType.getSelectedIndex();
        
        if (index == 1)
        {
            if (exp != null) exp.setValueClassName("java.sql.Connection");//NOI18N
            ((JRDesignDatasetRun) currentSelectedChartElement.getDataset().getDatasetRun()).setConnectionExpression(exp);
        }
        else if (index == 2)
        {
            if (exp != null) exp.setValueClassName("net.sf.jasperreports.engine.JRDataSource");//NOI18N
            ((JRDesignDatasetRun) currentSelectedChartElement.getDataset().getDatasetRun()).setDataSourceExpression(exp);
        }
        notifyChange();
     }
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:27,
代码来源:ChartPropertiesDialog.java

示例24: jButtonRemParameterActionPerformed

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
private void jButtonRemParameterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemParameterActionPerformed
    if (this.isInit()) return;
    
    if (currentSelectedChartElement == null) return;
    
    javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel)jTableDatasetParameters.getModel();
    
    JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)currentSelectedChartElement.getDataset().getDatasetRun();
    
    while (jTableDatasetParameters.getSelectedRowCount() > 0) {
        int i=jTableDatasetParameters.getSelectedRow();
        datasetRun.removeParameter( ((JRDatasetParameter)jTableDatasetParameters.getValueAt( i, 0)).getName() );
        dtm.removeRow(i);
    }
    notifyChange();
    
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:18,
代码来源:ChartPropertiesDialog.java

示例25: jRTextExpressionAreaMapExpressionTextChanged

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public void jRTextExpressionAreaMapExpressionTextChanged() {
    if (this.isInit()) return; 
    if (currentSelectedCrosstabElement != null)
    {
        JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)currentSelectedCrosstabElement.getDataset().getDatasetRun();
        if (datasetRun != null)
        {
            JRDesignExpression exp = null;
            if (jRTextExpressionAreaMapExpression.getText().trim().length() > 0)
            {
                exp = new JRDesignExpression();
                exp.setValueClassName("java.util.Map");
                exp.setText(jRTextExpressionAreaMapExpression.getText());
            }
            
            datasetRun.setParametersMapExpression(exp);
            notifyChange();
        }
    }
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:21,
代码来源:CrosstabDataDialog.java

示例26: jRTextExpressionAreaTextConnectionExpressionTextChanged

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public void jRTextExpressionAreaTextConnectionExpressionTextChanged() {
    if (this.isInit()) return; 
    if (currentSelectedCrosstabElement != null)
    {
        JRDesignExpression exp = null;
        if (jRTextExpressionAreaTextConnectionExpression.getText().trim().length() > 0)
        {
            exp = new JRDesignExpression();
            exp.setText(jRTextExpressionAreaTextConnectionExpression.getText());
        }
        
        int index = jComboBoxDatasetConnectionType.getSelectedIndex();
        
        if (index == 1)
        {
            if (exp != null) exp.setValueClassName("java.sql.Connection");
            ((JRDesignDatasetRun) currentSelectedCrosstabElement.getDataset().getDatasetRun()).setConnectionExpression(exp);
        }
        else if (index == 2)
        {
            if (exp != null) exp.setValueClassName("net.sf.jasperreports.engine.JRDataSource");
            ((JRDesignDatasetRun) currentSelectedCrosstabElement.getDataset().getDatasetRun()).setDataSourceExpression(exp);
        }
        notifyChange();
     }
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:27,
代码来源:CrosstabDataDialog.java

示例27: jButtonRemParameterActionPerformed

点赞 3

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
private void jButtonRemParameterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemParameterActionPerformed
    if (this.isInit()) return;
    
    if (currentSelectedCrosstabElement == null) return;
    
    javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel)jTableDatasetParameters.getModel();
    
    JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)currentSelectedCrosstabElement.getDataset().getDatasetRun();
    
    while (jTableDatasetParameters.getSelectedRowCount() > 0) {
        int i=jTableDatasetParameters.getSelectedRow();
        datasetRun.removeParameter( ((JRDatasetParameter)jTableDatasetParameters.getValueAt( i, 0)).getName() );
        dtm.removeRow(i);
    }
    notifyChange();
    
}
 

开发者ID:JockiHendry,
项目名称:ireport-fork,
代码行数:18,
代码来源:CrosstabDataDialog.java

示例28: createObject

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
	JRDesignDatasetRun datasetRun = new JRDesignDatasetRun();
	
	datasetRun.setDatasetName(atts.getValue(JRXmlConstants.ATTRIBUTE_subDataset));
	
	String uuid = atts.getValue(JRXmlConstants.ATTRIBUTE_uuid);
	if (uuid != null)
	{
		datasetRun.setUUID(UUID.fromString(uuid));
	}
	
	return datasetRun;
}
 

开发者ID:TIBCOSoftware,
项目名称:jasperreports,
代码行数:16,
代码来源:JRDatasetRunFactory.java

示例29: SortFillDatasetRun

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public SortFillDatasetRun(BaseReportFiller filler, JRFillDataset dataset, DatasetSortInfo sortInfo) throws JRException
{
	super(
		filler, 
		new JRDesignDatasetRun(), //we don't need anything from a dataset run. just avoid NPEs down the call 
		dataset
		);

	this.sortInfo = sortInfo;
}
 

开发者ID:TIBCOSoftware,
项目名称:jasperreports,
代码行数:11,
代码来源:DatasetSortUtil.java

示例30: createJRElement

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public JRDesignElement createJRElement(JasperDesign jasperDesign) {
	JRDesignCrosstab jrDesignElement = new JRDesignCrosstab(jasperDesign);
	JRDesignCrosstabDataset dataset = new JRDesignCrosstabDataset();
	dataset.setDatasetRun(new JRDesignDatasetRun());
	jrDesignElement.setDataset(dataset);

	DefaultManager.INSTANCE.applyDefault(this.getClass(), jrDesignElement);
	
	return jrDesignElement;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:12,
代码来源:MCrosstab.java

示例31: getMarkersExpressionContext

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
/**
 * Returns the expression context that should be used with the map markers.
 * Markers can be generated by a dataset and therefore the related expressions
 * should use this as their context.
 * 
 * @return the expression context to be used for the markers expressions
 */
public ExpressionContext getMarkersExpressionContext() {
	MDatasetRun datasetRun = (MDatasetRun) getPropertyValue(JRDesignElementDataset.PROPERTY_DATASET_RUN);
	if(datasetRun!=null){
		JRDesignDatasetRun value = datasetRun.getValue();
		if(value!=null && value.getDatasetName()!=null){
			JRDesignDataset ds = ModelUtils.getDesignDatasetByName(getJasperDesign(),value.getDatasetName());
			if(ds!=null) {
				return new ExpressionContext(ds, getJasperConfiguration());
			}
		}
	}
	return null;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:21,
代码来源:MMap.java

示例32: setPropertyValue

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
	if (id.equals(JRDesignDatasetRun.PROPERTY_DATASET_NAME)) {
		super.setPropertyValue(id, value);
		mapModel.setPropertyValue(JRDesignElementDataset.PROPERTY_DATASET_RUN, this);
	} else
		super.setPropertyValue(id, value);
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:9,
代码来源:MMap.java

示例33: createJRElement

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public JRDesignElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement jrElement = new JRDesignComponentElement();
	StandardTable component = new StandardTable();

	((JRDesignComponentElement) jrElement).setComponent(component);
	((JRDesignComponentElement) jrElement).setComponentKey(new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "jr", "table")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	JRDesignDatasetRun datasetRun = new JRDesignDatasetRun();
	component.setDatasetRun(datasetRun);
	
	DefaultManager.INSTANCE.applyDefault(this.getClass(), jrElement);

	return jrElement;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:15,
代码来源:MTable.java

示例34: execute

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public void execute() {
	removeGroup();
	JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getStandardTable().getDatasetRun();
	oldDatasetName = datasetRun.getDatasetName();
	datasetRun.setDatasetName(newDatasetName);
	reloadAvailableGroups();
	//Run an event on the table to force a grapghical refresh of the columns
	table.propertyChange(new PropertyChangeEvent(table.getValue(), StandardTable.PROPERTY_COLUMNS, null, null));
	table.setChangedProperty(true);
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:12,
代码来源:SwitchDatasetCommand.java

示例35: undo

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
@Override
public void undo() {
	JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getStandardTable().getDatasetRun();
	datasetRun.setDatasetName(oldDatasetName);
	oldDatasetName = null;
	restoreGroup();
	reloadAvailableGroups();
	//Run an event on the table to force a grapghical refresh of the columns
	table.propertyChange(new PropertyChangeEvent(table.getValue(), StandardTable.PROPERTY_COLUMNS, null, null));
	table.setChangedProperty(true);
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:12,
代码来源:SwitchDatasetCommand.java

示例36: WizardConnectionPage

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public WizardConnectionPage() {
	super("connectionpage"); //$NON-NLS-1$
	setTitle(Messages.common_connection);
	setDescription(Messages.WizardConnectionPage_description);
	
	jrDsRun = new JRDesignDatasetRun();
	
	// By default we set the dataset run to use the report connection...
	JRDesignExpression exp = new JRDesignExpression();
	exp.setText("$P{REPORT_CONNECTION}");
	jrDsRun.setConnectionExpression( exp );
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:13,
代码来源:WizardConnectionPage.java

示例37: setupDatasetRun

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public static void setupDatasetRun(Object[] bprms, JRDesignDatasetRun dr) throws JRException {
	if (dr.getDataSourceExpression() != null)
		return;
	for (int i = 0; i < bprms.length; i += 2) {
		String pname = (String) bprms[i];
		if (getParameter(dr, pname) != null)
			continue;
		JRDesignDatasetParameter prm = new JRDesignDatasetParameter();
		prm.setName(pname);
		prm.setExpression(new JRDesignExpression("$P{" + pname + "}"));
		dr.addParameter(prm);
	}
	// cleanup?
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:15,
代码来源:SyncDatasetRunParameters.java

示例38: cleanDatasetRun

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public static void cleanDatasetRun(Object[] bprms, JRDesignDatasetRun dr) throws JRException {
	if (dr.getDataSourceExpression() != null)
		return;
	for (int i = 0; i < bprms.length; i += 2) {
		String pname = (String) bprms[i];
		JRDatasetParameter p = getParameter(dr, pname);
		if (p.getExpression() != null && p.getExpression().getText() != null
				&& p.getExpression().getText().equals("$P{" + pname + "}"))
			dr.removeParameter(p);
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:12,
代码来源:SyncDatasetRunParameters.java

示例39: resetDatasetRun

点赞 2

import net.sf.jasperreports.engine.design.JRDesignDatasetRun; //导入依赖的package包/类
public void resetDatasetRun(boolean nullableFlag) {
	if (nullableFlag){
		this.datasetRun=null;
		this.editableDataset.setDatasetRun(null);
	}
	else {
		this.datasetRun=new JRDesignDatasetRun();
		this.editableDataset.setDatasetRun(datasetRun);
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:11,
代码来源:ComponentElementDatasetRunAdapter.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)