本文整理匯總了Java中net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue.setToVariable方法的典型用法代碼示例。如果您正苦於以下問題:Java JRDesignSubreportReturnValue.setToVariable方法的具體用法?Java JRDesignSubreportReturnValue.setToVariable怎麽用?Java JRDesignSubreportReturnValue.setToVariable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue
的用法示例。
在下文中一共展示了JRDesignSubreportReturnValue.setToVariable方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setReturnValues
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入方法依賴的package包/類
/**
* This method will duplicate the map. The panel will work on a copy of the map.
**/
@SuppressWarnings("unchecked")
public void setReturnValues(List oldReturnVariables) {
this.returnValues.clear();
DefaultTableModel model = (DefaultTableModel)jTable.getModel();
// Create a copy of the map content...
Iterator iterator = oldReturnVariables.iterator();
while (iterator.hasNext())
{
JRDesignSubreportReturnValue oldReturnValue = (JRDesignSubreportReturnValue)iterator.next();
JRDesignSubreportReturnValue returnValue = new JRDesignSubreportReturnValue();
returnValue.setSubreportVariable(oldReturnValue.getSubreportVariable() );
returnValue.setCalculation(oldReturnValue.getCalculationValue() );
returnValue.setIncrementerFactoryClassName(oldReturnValue.getIncrementerFactoryClassName() );
returnValue.setToVariable(oldReturnValue.getToVariable() );
returnValues.add(returnValue);
model.addRow(new Object[]{returnValue, returnValue.getToVariable() });
}
}
示例2: createObject
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入方法依賴的package包/類
/**
* Creates an object from a subreport copied value XML element.
*
* @param atts the element attributes
* @return a {@link JRDesignSubreportReturnValue JRDesignSubreportReturnValue} object
*/
@Override
public Object createObject(Attributes atts)
{
JRXmlLoader xmlLoader = (JRXmlLoader) digester.peek(digester.getCount() - 1);
JasperDesign design = (JasperDesign) digester.peek(digester.getCount() - 2);
JRDesignSubreportReturnValue returnValue = new JRDesignSubreportReturnValue();
String variableName = atts.getValue(JRXmlConstants.ATTRIBUTE_toVariable);
JRVariable variable = design.getVariablesMap().get(variableName);
if (variable == null)
{
xmlLoader.addError(new JRValidationException("Unknown variable " + variableName, returnValue));
}
returnValue.setSubreportVariable(atts.getValue(JRXmlConstants.ATTRIBUTE_subreportVariable));
returnValue.setToVariable(variableName);
CalculationEnum calculation = CalculationEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_calculation));
if (calculation != null)
{
returnValue.setCalculation(calculation);
}
String incrementerFactoryClass = atts.getValue(JRXmlConstants.ATTRIBUTE_incrementerFactoryClass);
if (incrementerFactoryClass != null)
{
returnValue.setIncrementerFactoryClassName(incrementerFactoryClass);
}
return returnValue;
}
示例3: createHelperReturnValue
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入方法依賴的package包/類
@Override
protected CommonReturnValue createHelperReturnValue(CommonReturnValue returnValue, String nameSuffix, CalculationEnum calculation)
{
JRDesignSubreportReturnValue helper = new JRDesignSubreportReturnValue();
helper.setToVariable(returnValue.getToVariable() + nameSuffix);
helper.setSubreportVariable(((VariableReturnValue)returnValue).getFromVariable());
helper.setCalculation(calculation);
helper.setIncrementerFactoryClassName(helper.getIncrementerFactoryClassName());//FIXMERETURN shouldn't it be returnValue?
return helper;
}
示例4: createDistinctCountHelperReturnValue
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入方法依賴的package包/類
@Override
protected CommonReturnValue createDistinctCountHelperReturnValue(CommonReturnValue returnValue)
{
JRDesignSubreportReturnValue helper = new JRDesignSubreportReturnValue();
helper.setToVariable(returnValue.getToVariable() + "_DISTINCT_COUNT");
helper.setSubreportVariable(((VariableReturnValue)returnValue).getFromVariable());
helper.setCalculation(CalculationEnum.NOTHING);
helper.setIncrementerFactoryClassName(JRDistinctCountIncrementerFactory.class.getName());
return helper;
}
示例5: jButtonOKActionPerformed
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入方法依賴的package包/類
private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButtonOKActionPerformed
{
if ((this.jComboBoxSubreportVariable.getSelectedItem()+"").trim().length() <= 0)
{
javax.swing.JOptionPane.showMessageDialog(this,
I18n.getString("JRSubreportReturnValueDialog.Message.Warning"),
I18n.getString("JRSubreportReturnValueDialog.Message.Error"),
javax.swing.JOptionPane.WARNING_MESSAGE);
return;
}
subreportReturnValue = new JRDesignSubreportReturnValue();
subreportReturnValue.setSubreportVariable( this.jComboBoxSubreportVariable.getSelectedItem()+"" );
if (this.jComboBoxVariable.getSelectedItem() == null)
{
javax.swing.JOptionPane.showMessageDialog(this,
I18n.getString("JRSubreportReturnValueDialog.Message.Warning2"),
I18n.getString("JRSubreportReturnValueDialog.Message.Error2"),
javax.swing.JOptionPane.WARNING_MESSAGE);
return;
}
subreportReturnValue.setToVariable( jComboBoxVariable.getSelectedItem()+"");
Object t = this.jComboBoxCalculationType.getSelectedItem();
if (t != null && t instanceof Tag) subreportReturnValue.setCalculation( (CalculationEnum)((Tag)t).getValue() );
if (this.jTextFieldNameIncrementerFactoryClass.getText().length() == 0)
{
subreportReturnValue.setIncrementerFactoryClassName(null);
}
else
{
subreportReturnValue.setIncrementerFactoryClassName( this.jTextFieldNameIncrementerFactoryClass.getText());
}
setVisible(false);
this.setDialogResult(javax.swing.JOptionPane.OK_OPTION);
dispose();
}