Skip to main content



      Home
Home » Archived » BIRT » [BIRT 2.2M6] cascading parameters multiple data sets
[BIRT 2.2M6] cascading parameters multiple data sets [message #239710] Thu, 24 May 2007 05:22 Go to next message
Eclipse UserFriend
Originally posted by: johnww.yxcasd.org

iŽve got a problem in retrieving data from a cascading parameter group
with multiple datasets. the parameter example in eclipsepedia just works
with single datasets, an exception is thrown:

//---------------------------------------------------------- ------------
org.eclipse.birt.data.engine.core.DataException: Column binding
"SHIFT_NUMBER" does not exist.
at
org.eclipse.birt.data.engine.impl.ExprManagerUtil.checkColum nBindingExist(ExprManagerUtil.java:251)
at
org.eclipse.birt.data.engine.impl.ExprManagerUtil.checkColum nBindingExpression(ExprManagerUtil.java:209)
at
org.eclipse.birt.data.engine.impl.ExprManagerUtil.validateCo lumnBinding(ExprManagerUtil.java:59)
at
org.eclipse.birt.data.engine.impl.ExprManager.validateColumn Binding(ExprManager.java:174)
at
org.eclipse.birt.data.engine.impl.ServiceForQueryResults.val idateQueryColumBinding(ServiceForQueryResults.java:406)
at
org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:146)
at
org.eclipse.birt.report.engine.api.impl.GetParameterDefiniti onTask.evaluateQuery(GetParameterDefinitionTask.java:654)
//---------------------------------------------------------- ------------

so is there a possibility to retrieve the other datasets?

greets,
chris
Re: [BIRT 2.2M6] cascading parameters multiple data sets [message #239776 is a reply to message #239710] Thu, 24 May 2007 11:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Chris

I just tested this in RC0 and it works. Remember to link the first
parameter in the cascade to the second data set if you want the second
data set values culled.

Jason

chris wrote:
> iŽve got a problem in retrieving data from a cascading parameter group
> with multiple datasets. the parameter example in eclipsepedia just works
> with single datasets, an exception is thrown:
>
> //---------------------------------------------------------- ------------
> org.eclipse.birt.data.engine.core.DataException: Column binding
> "SHIFT_NUMBER" does not exist.
> at
> org.eclipse.birt.data.engine.impl.ExprManagerUtil.checkColum nBindingExist(ExprManagerUtil.java:251)
>
> at
> org.eclipse.birt.data.engine.impl.ExprManagerUtil.checkColum nBindingExpression(ExprManagerUtil.java:209)
>
> at
> org.eclipse.birt.data.engine.impl.ExprManagerUtil.validateCo lumnBinding(ExprManagerUtil.java:59)
>
> at
> org.eclipse.birt.data.engine.impl.ExprManager.validateColumn Binding(ExprManager.java:174)
>
> at
> org.eclipse.birt.data.engine.impl.ServiceForQueryResults.val idateQueryColumBinding(ServiceForQueryResults.java:406)
>
> at
> org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:146)
>
> at
> org.eclipse.birt.report.engine.api.impl.GetParameterDefiniti onTask.evaluateQuery(GetParameterDefinitionTask.java:654)
>
> //---------------------------------------------------------- ------------
>
> so is there a possibility to retrieve the other datasets?
>
> greets,
> chris
>
>
Re: [BIRT 2.2M6] cascading parameters multiple data sets [message #239900 is a reply to message #239776] Fri, 25 May 2007 04:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johnww.asdasd.org

Hi Jason,

thx for the quick reply. iŽm running on rc0 now, the report works fine
with the new webviewer example.


but i still got the same problem in parameter extraction class:
//---------------------------------------------------------- ------------------

/**
* retrieves values from parameters controlled by a LIST_BOX or
RADIO_BUTTON
*
*@param task
* parameter definition task
*@param scalar
* scalar report parameter
*@param report
* report design file
*@param group
* group definition
*
* @return ListValues
* HashMap containing our LIST_BOX values (value, label)
*/
private SortedMap<Object, String>
getListValues(IGetParameterDefinitionTask task, IScalarParameterDefn
scalar, IReportRunnable report, IParameterGroupDefn group){
SortedMap<Object, String> ListValues= new TreeMap<Object,
String>();

//Get report design and find default value, prompt text and data
set expression using the DE API
ReportDesignHandle reportHandle = ( ReportDesignHandle )
report.getDesignHandle( );
ScalarParameterHandle parameterHandle = ( ScalarParameterHandle )
reportHandle.findParameter( scalar.getName() );

if(scalar.getControlType() != IScalarParameterDefn.TEXT_BOX) {
//retrieve selection list for cascaded parameter
if ( parameterHandle.getContainer( ) instanceof
CascadingParameterGroupHandle ){
Collection sList = Collections.EMPTY_LIST;
if ( parameterHandle.getContainer( ) instanceof
CascadingParameterGroupHandle ) {
int index = parameterHandle.getContainerSlotHandle( )
.findPosn( parameterHandle );
Object[] keyValue = new Object[index];
for ( int i = 0; i < index; i++ ) {
ScalarParameterHandle handle =
(ScalarParameterHandle) ( (CascadingParameterGroupHandle)
parameterHandle.getContainer( ) ).getParameters( )
.get( i );
//Use parameter default values
keyValue[i] = handle.getDefaultValue();
}
String groupName = parameterHandle.getContainer(
).getName( );
task.evaluateQuery( groupName );

sList = task.getSelectionListForCascadingGroup(
groupName, keyValue );

for ( Iterator sl = sList.iterator( ); sl.hasNext( );
) {
IParameterSelectionChoice sI =
(IParameterSelectionChoice) sl.next( );
Object value = sI.getValue( );
Object label = sI.getLabel( );
ListValues.put(value,label.toString());
}
}
}else{
//retrieve selection list
Collection selectionList = task.getSelectionList(
scalar.getName() );
if ( selectionList != null ) {
for ( Iterator sliter = selectionList.iterator( );
sliter.hasNext( ); ) {
IParameterSelectionChoice selectionItem =
(IParameterSelectionChoice) sliter.next( );
Object value = selectionItem.getValue( );
Object label = selectionItem.getLabel( );
ListValues.put(value,label.toString());
}
}
}
}
return ListValues;
}


//---------------------------------------------------------- ------------------


my cascading parameter group:
//###################################################

<cascading-parameter-group name="Anlage->Schicht" id="384">
<property name="dataSet">Anlagenstruktur</property>
<property name="dataSetMode">multiple</property>
<parameters>
<scalar-parameter name="node" id="385">
<property name="valueType">dynamic</property>
<text-property name="promptText">Anlage</text-property>
<property name="allowNull">false</property>
<property name="controlType">list-box</property>
<property name="dataSetName">Anlagenstruktur</property>
<expression name="valueExpr">row["ID"]</expression>
<expression name="labelExpr">row["NAME_0"]</expression>
<property name="defaultValue">0</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
<scalar-parameter name="schicht" id="386">
<property name="valueType">dynamic</property>
<text-property
name="promptText">Schicht</text-property>
<property name="allowNull">false</property>
<property name="controlType">list-box</property>
<property name="dataSetName">Schichten</property>
<expression
name="valueExpr">row["SHIFT_NUMBER"]</expression>
<expression name="labelExpr">row["NAME_0"]</expression>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</parameters>
</cascading-parameter-group>

//###################################################

i forgot to mention my motivation for all this:
i want to create an external filter frame just like the parameter-window
in the webviewer example, maybe theres a whole easier way to solve this
problem. some code snippets would also be great.

greets,
chris from munich
Re: [BIRT 2.2M6] cascading parameters multiple data sets [message #240207 is a reply to message #239900] Tue, 29 May 2007 13:59 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Chris,

This is happening in the Viewer code as well. Can you log a bug entry
for this? It should still work BTW.

Jason

chris wrote:
> Hi Jason,
>
> thx for the quick reply. iŽm running on rc0 now, the report works fine
> with the new webviewer example.
>
>
> but i still got the same problem in parameter extraction class:
> //---------------------------------------------------------- ------------------
>
>
> /**
> * retrieves values from parameters controlled by a LIST_BOX or
> RADIO_BUTTON
> *
> *@param task
> * parameter definition task
> *@param scalar
> * scalar report parameter
> *@param report
> * report design file
> *@param group
> * group definition
> *
> * @return ListValues
> * HashMap containing our LIST_BOX values (value, label)
> */
> private SortedMap<Object, String>
> getListValues(IGetParameterDefinitionTask task, IScalarParameterDefn
> scalar, IReportRunnable report, IParameterGroupDefn group){
> SortedMap<Object, String> ListValues= new TreeMap<Object, String>();
> //Get report design and find default value, prompt text
> and data set expression using the DE API
> ReportDesignHandle reportHandle = ( ReportDesignHandle )
> report.getDesignHandle( );
> ScalarParameterHandle parameterHandle = ( ScalarParameterHandle )
> reportHandle.findParameter( scalar.getName() );
> if(scalar.getControlType() !=
> IScalarParameterDefn.TEXT_BOX) {
> //retrieve selection list for cascaded parameter
> if ( parameterHandle.getContainer( ) instanceof
> CascadingParameterGroupHandle ){
> Collection sList = Collections.EMPTY_LIST;
> if ( parameterHandle.getContainer( ) instanceof
> CascadingParameterGroupHandle ) {
> int index = parameterHandle.getContainerSlotHandle( )
> .findPosn( parameterHandle );
> Object[] keyValue = new Object[index];
> for ( int i = 0; i < index; i++ ) {
> ScalarParameterHandle handle =
> (ScalarParameterHandle) ( (CascadingParameterGroupHandle)
> parameterHandle.getContainer( ) ).getParameters( )
> .get( i );
> //Use parameter default values
> keyValue[i] = handle.getDefaultValue();
> }
> String groupName = parameterHandle.getContainer(
> ).getName( );
> task.evaluateQuery( groupName );
> sList =
> task.getSelectionListForCascadingGroup( groupName, keyValue );
> for ( Iterator sl =
> sList.iterator( ); sl.hasNext( ); ) {
> IParameterSelectionChoice sI =
> (IParameterSelectionChoice) sl.next( );
> Object value = sI.getValue( );
> Object label = sI.getLabel( );
> ListValues.put(value,label.toString());
> }
> }
> }else{
> //retrieve selection list
> Collection selectionList = task.getSelectionList(
> scalar.getName() );
> if ( selectionList != null ) {
> for ( Iterator sliter = selectionList.iterator( );
> sliter.hasNext( ); ) {
> IParameterSelectionChoice selectionItem =
> (IParameterSelectionChoice) sliter.next( );
> Object value = selectionItem.getValue( );
> Object label = selectionItem.getLabel( );
> ListValues.put(value,label.toString());
> }
> }
> }
> }
> return ListValues;
> }
>
>
> //---------------------------------------------------------- ------------------
>
>
>
> my cascading parameter group:
> //###################################################
>
> <cascading-parameter-group name="Anlage->Schicht" id="384">
> <property name="dataSet">Anlagenstruktur</property>
> <property name="dataSetMode">multiple</property>
> <parameters>
> <scalar-parameter name="node" id="385">
> <property name="valueType">dynamic</property>
> <text-property name="promptText">Anlage</text-property>
> <property name="allowNull">false</property>
> <property name="controlType">list-box</property>
> <property name="dataSetName">Anlagenstruktur</property>
> <expression name="valueExpr">row["ID"]</expression>
> <expression name="labelExpr">row["NAME_0"]</expression>
> <property name="defaultValue">0</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> <scalar-parameter name="schicht" id="386">
> <property name="valueType">dynamic</property>
> <text-property name="promptText">Schicht</text-property>
> <property name="allowNull">false</property>
> <property name="controlType">list-box</property>
> <property name="dataSetName">Schichten</property>
> <expression
> name="valueExpr">row["SHIFT_NUMBER"]</expression>
> <expression name="labelExpr">row["NAME_0"]</expression>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> </parameters>
> </cascading-parameter-group>
>
> //###################################################
>
> i forgot to mention my motivation for all this:
> i want to create an external filter frame just like the parameter-window
> in the webviewer example, maybe theres a whole easier way to solve this
> problem. some code snippets would also be great.
>
> greets,
> chris from munich
>
Previous Topic:Scroll in a BIRT chart
Next Topic:BuildOdaFlatfile.xml
Goto Forum:
  


Current Time: Wed Jun 18 07:40:10 EDT 2025

Powered by FUDForum. Page generated in 0.08929 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top