SQL report - Chart filter expression

I have a chart in an existing SCCM report that I want filter down to two or more collections, but the dataset is used in other charts on the same report, so I can't touch that.
I've been trying to create a filter in the Chart Properties, and can limit it down to one collection without issue:
Expression: [CollectionID]
Operator: =
Value: VI100016      (the collection that I am filtering on)
I've tried to go into the Value fx and set an expression manually, example below, but this errors when I run the report.
=(Fields!CollectionID.Value  = VI100016) Or (Fields!CollectionID.Value  = VI100017)

Yep that's got it thanks, just ended up using the following which worked:
Expression: [CollectionID]
Operator: In
Value: ="VI100016", "VI100017"

Similar Messages

  • Using sql in the filter expression

    For a project I need to use a filter which is a construction
    with BETWEEN dateFrom AND dateTo.
    But the user does not choose these datevalues,
    he chooses timePeriods which have a unique startDate.
    The dashboard prompts are populated with these timePeriods and the user chooses 2 of these and 2
    presentation variables are set.
    Now I need to retrieve the according startDate for a chosen timePeriod.
    I tried to do this using a sub-query in the filter expression,
    but this seems not to be valid in Answers.
    In standard SQL it is expressed like this:
    select table1.* from table1
    where table1.dateValue  BETWEEN
    +(select table2.startDate from table2 where table2.timePeriod = 'theChosenValue1')+
    AND
    +(select table2.startDate from table2 where table2.timePeriod = 'theChosenValue2')+
    The return of the subqueries are single row, as it should in such constructions.
    I want the where clause to be in the filter expression for the dateValue column in Answers.(trimming of the WHERE keyword)
    Is there any other construction that does this trick in the BI Answers/Dashboard environment to do this?
    Kind regards

    Hi Micek,
    Thanks for your quick reaction.
    Yes you are right the ChosenValues will be replaced by presentation-variables in the final dashboard,
    I just am testing it with constant values in the Answers module.
    The problem seems to be that it is not allowed to use a sub-query in the filter expression.
    The Answers web application says there is a syntax problem near <select>, while I expect the SQL to be valid.
    I guess not all regular SQL is allowed in filter expressions.
    And since the report does not try to fetch data, no log of a generated, real SQL is written to the logfile.
    I need some alternative for the subquery, but one that is allowed in the filter expression.
    The problem is based on the fact that the user chooses a different value then the one that is filtered on.
    The timePeriods represent just one startDate, but I cannot use timePeriod itself to filter on.
    Because I need a between value, wich does not make sense for a timePeriod element
    such as '01-08' or 'JAN-08'.
    Several timePeriod notations are used, so using SubString and || to calculate a numeric value from the timePeriod varchar2 is not a good option.
    The error says:      
    Error getting drill information: SELECT "....
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <SELECT>: Syntax error [nQSError: 26012] . (HY000)
    Any input is welcome
    kind regards

  • Re: not exists SQL using ! filter expression with a variable

    This is still not producing the correct result set in Kodo JDO 3.0.0RC4. I
    see the following SQL statement in the log.
    DEBUG ExecuteThread: '10' for queue: 'default' kodo.jdbc.SQL - <t 7720801,
    conn 5232795> [10 ms] executing prepstmnt 1654874 SELECT DISTINCT t0.pk,
    t0.JDOCLASS, t0.JDOVERSION, t0.AEndPoint, t0.AEndPointType, t0.DS0, t0.DS1,
    t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint, t0.ZEndPointType, t0.adminState,
    t0.creationDate, t0.speckey, t0.spectype, t0.description,
    t0.lastModifiedDate, t0.lastModifiedUserId, t0.lastupdate, t0.name, t0.note,
    t0.previousVersion, t0.resourceBusinessName, t0.signalType, t0.supporting,
    t0.direction, t0.validForEnd, t0.validForStart FROM dschannel t0 CROSS JOIN
    channelsegment t1 WHERE (NOT (t0.pk = t1.channel AND t0.supporting = ? AND
    (t1.validForEnd > ? OR t1.validForStart < ?))) [params=(String)
    101/DS3/LOC01/LOC02, (Timestamp) 2001-07-24 20:29:14.0, (Timestamp)
    2038-01-18 22:14:07.0]
    INFO ExecuteThread: '10' for queue: 'default' com.metasolv.oss.inventory -
    resultSet size=0
    It looks to me like the CROSS JOIN is not the right join to be using. ---
    unless I am doing something altogether incorrect in the JDO Query itself,
    which is highly likely.
    Ben
    "Ben Eng" <[email protected]> wrote in message news:...
    Using Kodo JDO 2.5.3, I am attempting to do queries of the following form:
    select * from dschannel as c
    where not exists (select pk from channelsegment as s
    where c.pk = s.channel and
    c.supporting = ? and
    (s.validForEnd > ? or
    s.validForStart < ?));
    select * from dschannel as c
    left join channelsegment as s
    on c.pk = s.channel and
    c.supporting = ? and
    (s.validForEnd > ? or
    s.validForStart < ?)
    where s.channel is null;
    The code looks like this:
    extent = pm.getExtent( ChannelValue.class, true );
    query = pm.newQuery( this.extent );
    query.declareImports( "import
    com.metasolv.resources.entity.connection.ChannelSegmentValueImpl; import
    java.util.Date;" );
    query.declareParameters( "String pConn, Date pStart, Date pEnd" );
    query.declareVariables( "ChannelSegmentValueImpl assign" );
    String filter = "! (key == assign.channel && supportingConnection == pConn
    && (assign.validForEnd > pStart || assign.validForStart < pEnd))";
    query.setFilter( filter );
    resultSet = (java.util.Collection) query.execute( connection,
    interval.getStartDateTime(), interval.getEndDateTime() );
    I am seeing the following Exception with mysql 4.0.15 and mysql connector
    JDBC driver 3.0.8:
    com.solarmetric.kodo.runtime.DataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
    22:14:07.0'}))]
    [PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? ORt1.validForStart> < ?))
    Syntax error or access violation, message from server: "You have an error
    in your SQL syntax. Check the manual that corresponds to your MySQLserver
    version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
    t0.supporting = '101/DS3/LOC0" [code=1064;state=42000]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
    22:14:07.0'}))]
    [PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t> 0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,t0.signalType,> t0.supporting, t0.direction, t0.validForEnd, t0.validForStart FROMDSChannel> t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK = t1.channel AND> t0.supporting = ? AND (t1.validForEnd > ? OR t1.validForStart < ?))
    Syntax error or access violation, message from server: "You have an error
    in your SQL syntax. Check the manual that corresponds to your MySQLserver
    version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
    t0.supporting = '101/DS3/LOC0"
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwDataStore(SQLExcep
    tions.java:64)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:1167)
    at
    com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
    26)
    at
    com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
    ryImpl.java:1565)
    at
    com.solarmetric.kodo.query.QueryImpl$AggregateQueryExecutor.executeQuery(Que
    ryImpl.java:1401)
    at
    com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
    >
    atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
    >
    at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:513)
    at
    com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
    vailabilityQueryBean.java:55)
    at
    com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
    ionBean.java:1343)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
    (InventorySessionBean_xf0gis_EOImpl.java:3998)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
    Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:821)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
    >
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    NestedThrowablesStackTrace:
    java.sql.SQLException: Syntax error or access violation, message from
    server: "You have an error in your SQL syntax. Check the manual that
    corresponds to your MySQL server version for the right syntax to use near
    'WHERE NOT (t0.PK = t1.channel AND t0.supporting = '101/DS3/LOC0"
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:1874)
    at
    com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1538)
    at
    com.solarmetric.datasource.PreparedStatementWrapper.executeQuery(PreparedSta
    tementWrapper.java:93)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedQueryI
    nternal(SQLExecutionManagerImpl.java:707)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQueryInternal(
    SQLExecutionManagerImpl.java:600)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQuery(SQLExecu
    tionManagerImpl.java:355)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.selectPrimaryMappings(
    ClassMapping.java:1743)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:1136)
    at
    com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
    26)
    at
    com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
    ryImpl.java:1565)
    at
    com.solarmetric.kodo.query.QueryImpl$AggregateQueryExecutor.executeQuery(Que
    ryImpl.java:1401)
    at
    com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
    >
    atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
    >
    at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:513)
    at
    com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
    vailabilityQueryBean.java:55)
    at
    com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
    ionBean.java:1343)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
    (InventorySessionBean_xf0gis_EOImpl.java:3998)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
    Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:821)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
    >
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    INFO ExecuteThread: '10' for queue: 'default' com.metasolv.oss.inventory -
    ignoring exception
    javax.oss.IllegalArgumentException:
    com.solarmetric.kodo.runtime.DataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
    22:14:07.0'}))]
    [PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? ORt1.validForStart> < ?))
    Syntax error or access violation, message from server: "You have an error
    in your SQL syntax. Check the manual that corresponds to your MySQLserver
    version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
    t0.supporting = '101/DS3/LOC0" [code=1064;state=42000]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
    22:14:07.0'}))]
    [PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? ORt1.validForStart> < ?))
    Syntax error or access violation, message from server: "You have an error
    in your SQL syntax. Check the manual that corresponds to your MySQLserver
    version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
    t0.supporting = '101/DS3/LOC0"
    at
    com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
    vailabilityQueryBean.java:61)
    at
    com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
    ionBean.java:1343)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
    (InventorySessionBean_xf0gis_EOImpl.java:3998)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
    Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:821)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
    >
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    Ben

    Ben-
    Is the SQL statement that is being executed returning incorrect results,
    or is it causing an exception with the MySQL server?
    If the former, can you describe the results you are seeing? If the
    latter, can you post the stack trace?
    In article <[email protected]>, Ben Eng wrote:
    This is still not producing the correct result set in Kodo JDO 3.0.0RC4. I
    see the following SQL statement in the log.
    DEBUG ExecuteThread: '10' for queue: 'default' kodo.jdbc.SQL - <t 7720801,
    conn 5232795> [10 ms] executing prepstmnt 1654874 SELECT DISTINCT t0.pk,
    t0.JDOCLASS, t0.JDOVERSION, t0.AEndPoint, t0.AEndPointType, t0.DS0, t0.DS1,
    t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint, t0.ZEndPointType, t0.adminState,
    t0.creationDate, t0.speckey, t0.spectype, t0.description,
    t0.lastModifiedDate, t0.lastModifiedUserId, t0.lastupdate, t0.name, t0.note,
    t0.previousVersion, t0.resourceBusinessName, t0.signalType, t0.supporting,
    t0.direction, t0.validForEnd, t0.validForStart FROM dschannel t0 CROSS JOIN
    channelsegment t1 WHERE (NOT (t0.pk = t1.channel AND t0.supporting = ? AND
    (t1.validForEnd > ? OR t1.validForStart < ?))) [params=(String)
    101/DS3/LOC01/LOC02, (Timestamp) 2001-07-24 20:29:14.0, (Timestamp)
    2038-01-18 22:14:07.0]
    INFO ExecuteThread: '10' for queue: 'default' com.metasolv.oss.inventory -
    resultSet size=0
    It looks to me like the CROSS JOIN is not the right join to be using. ---
    unless I am doing something altogether incorrect in the JDO Query itself,
    which is highly likely.
    Ben
    "Ben Eng" <[email protected]> wrote in message news:...
    Using Kodo JDO 2.5.3, I am attempting to do queries of the following form:
    select * from dschannel as c
    where not exists (select pk from channelsegment as s
    where c.pk = s.channel and
    c.supporting = ? and
    (s.validForEnd > ? or
    s.validForStart < ?));
    select * from dschannel as c
    left join channelsegment as s
    on c.pk = s.channel and
    c.supporting = ? and
    (s.validForEnd > ? or
    s.validForStart < ?)
    where s.channel is null;
    The code looks like this:
    extent = pm.getExtent( ChannelValue.class, true );
    query = pm.newQuery( this.extent );
    query.declareImports( "import
    com.metasolv.resources.entity.connection.ChannelSegmentValueImpl; import
    java.util.Date;" );
    query.declareParameters( "String pConn, Date pStart, Date pEnd" );
    query.declareVariables( "ChannelSegmentValueImpl assign" );
    String filter = "! (key == assign.channel && supportingConnection == pConn
    && (assign.validForEnd > pStart || assign.validForStart < pEnd))";
    query.setFilter( filter );
    resultSet = (java.util.Collection) query.execute( connection,
    interval.getStartDateTime(), interval.getEndDateTime() );
    I am seeing the following Exception with mysql 4.0.15 and mysql connector
    JDBC driver 3.0.8:
    com.solarmetric.kodo.runtime.DataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >>> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
    22:14:07.0'}))]
    [PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? OR> t1.validForStart>> < ?))
    Syntax error or access violation, message from server: "You have an error
    in your SQL syntax. Check the manual that corresponds to your MySQLserver
    version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
    t0.supporting = '101/DS3/LOC0" [code=1064;state=42000]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >>> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
    22:14:07.0'}))]
    [PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t>> 0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,> t0.signalType,>> t0.supporting, t0.direction, t0.validForEnd, t0.validForStart FROM> DSChannel>> t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK = t1.channel AND>> t0.supporting = ? AND (t1.validForEnd > ? OR t1.validForStart < ?))
    Syntax error or access violation, message from server: "You have an error
    in your SQL syntax. Check the manual that corresponds to your MySQLserver
    version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
    t0.supporting = '101/DS3/LOC0"
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwDataStore(SQLExcep
    tions.java:64)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:1167)
    at
    com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
    26)
    at
    com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
    ryImpl.java:1565)
    at
    com.solarmetric.kodo.query.QueryImpl$AggregateQueryExecutor.executeQuery(Que
    ryImpl.java:1401)
    at
    com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
    atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
    at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:513)
    at
    com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
    vailabilityQueryBean.java:55)
    at
    com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
    ionBean.java:1343)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
    (InventorySessionBean_xf0gis_EOImpl.java:3998)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
    Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:821)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    NestedThrowablesStackTrace:
    java.sql.SQLException: Syntax error or access violation, message from
    server: "You have an error in your SQL syntax. Check the manual that
    corresponds to your MySQL server version for the right syntax to use near
    'WHERE NOT (t0.PK = t1.channel AND t0.supporting = '101/DS3/LOC0"
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:1874)
    at
    com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1538)
    at
    com.solarmetric.datasource.PreparedStatementWrapper.executeQuery(PreparedSta
    tementWrapper.java:93)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedQueryI
    nternal(SQLExecutionManagerImpl.java:707)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQueryInternal(
    SQLExecutionManagerImpl.java:600)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQuery(SQLExecu
    tionManagerImpl.java:355)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.selectPrimaryMappings(
    ClassMapping.java:1743)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:1136)
    at
    com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
    26)
    at
    com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
    ryImpl.java:1565)
    at
    com.solarmetric.kodo.query.QueryImpl$AggregateQueryExecutor.executeQuery(Que
    ryImpl.java:1401)
    at
    com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
    atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
    at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:513)
    at
    com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
    vailabilityQueryBean.java:55)
    at
    com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
    ionBean.java:1343)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
    (InventorySessionBean_xf0gis_EOImpl.java:3998)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
    Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:821)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    INFO ExecuteThread: '10' for queue: 'default' com.metasolv.oss.inventory -
    ignoring exception
    javax.oss.IllegalArgumentException:
    com.solarmetric.kodo.runtime.DataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >>> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
    22:14:07.0'}))]
    [PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? OR> t1.validForStart>> < ?))
    Syntax error or access violation, message from server: "You have an error
    in your SQL syntax. Check the manual that corresponds to your MySQLserver
    version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
    t0.supporting = '101/DS3/LOC0" [code=1064;state=42000]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >>> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
    22:14:07.0'}))]
    [PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
    t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
    t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
    t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
    t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
    t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
    t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? OR> t1.validForStart>> < ?))
    Syntax error or access violation, message from server: "You have an error
    in your SQL syntax. Check the manual that corresponds to your MySQLserver
    version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
    t0.supporting = '101/DS3/LOC0"
    at
    com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
    vailabilityQueryBean.java:61)
    at
    com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
    ionBean.java:1343)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
    (InventorySessionBean_xf0gis_EOImpl.java:3998)
    at
    com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
    Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:821)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    Ben
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • SQL in reports filter expression

    Hi All,
    I want to filter the report using the 'in' operator and specify a SQL as the expression. I want apex to be use the result of the query as the list of values for the 'in' operator. Is this supported?
    for example can I specify the filter as 'user_name in (select name from user_name_tab where group_id = 10)'
    Thanks
    Edited by: vmedi on Jan 3, 2012 2:53 PM
    Edited by: vmedi on Jan 3, 2012 2:53 PM

    Hi Micek,
    Thanks for your quick reaction.
    Yes you are right the ChosenValues will be replaced by presentation-variables in the final dashboard,
    I just am testing it with constant values in the Answers module.
    The problem seems to be that it is not allowed to use a sub-query in the filter expression.
    The Answers web application says there is a syntax problem near <select>, while I expect the SQL to be valid.
    I guess not all regular SQL is allowed in filter expressions.
    And since the report does not try to fetch data, no log of a generated, real SQL is written to the logfile.
    I need some alternative for the subquery, but one that is allowed in the filter expression.
    The problem is based on the fact that the user chooses a different value then the one that is filtered on.
    The timePeriods represent just one startDate, but I cannot use timePeriod itself to filter on.
    Because I need a between value, wich does not make sense for a timePeriod element
    such as '01-08' or 'JAN-08'.
    Several timePeriod notations are used, so using SubString and || to calculate a numeric value from the timePeriod varchar2 is not a good option.
    The error says:      
    Error getting drill information: SELECT "....
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <SELECT>: Syntax error [nQSError: 26012] . (HY000)
    Any input is welcome
    kind regards

  • Report Builder 3.0 filter expression not working

    I have a dataset in ReportBuilder 3.0 that is filtering rows from a table on a DistrictNumber field of type integer. The value to be filtered is coming from a prompted parameter. The filter is [DistrictNumber] = [@OutcomeDistrictNumber] and this is working
    correctly. The dataset has a field called AssessmentPeriod of type string. Values in this field take the form SFY13 or SFY14. Notice that the last two characters are the year.
    Next I have a column chart that is getting data from this dataset to display scores in different categories. There is a filter on the chart to get only the data for one assessment period. The value to be filtered is coming from a prompted parameter. The
    filter is [AssessmentPeriod] = [@CurrentAssessmentPeriod] and again this is working.
    Here is the problem. I have another column chart that should display the scores in different categories for the previous assessment period. So I thought it is possible to derive the value to be compared from the same parameter used in the other chart. I
    clicked the fx button next to the Value textbox on the Change filters dialog box and typed the following:
             = "SFY" & Str(Int(Val(Mid(Parameters!CurrentAssessmentPeriod.Value, 4, 2)) - 1))
    I typed [AssessmentPeriod] in the Expression field and selected = for the Operator. My thinking is that if the parameter was SFY14 then the expression will give SFY13. But this is not returning any data. The database table has some rows whose AssessmentPeriod
    is SFY13.
    Any help will be greatly appreciated.

    Hi tropicalsage,
    According to your description, you have a column chart which filter data based on a parameter. Now you want to have another column chart filter data based on the same parameter selection with the last two characters minus 1(SPY14->SPY13). Right?
    In Reporting Services, we can have two charts filter data based on one parameter. In this scenario, we just need to cut out the last two characters of the parameter selection, do the calculation, concatenate into string and put this string into filter. Please
    try the following expression in your filter:
    ="SPY"&CStr(CInt(Right(Parameters!CurrentAssessmentPeriod.Value,2))-1)
    We have tested this scenario with sample data in our local environment. The result looks like below:
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How to fix a report textbox aggregate expression error in SQL server reporting with multiple datasets?

    I have a SQL Server Reporting Services report that has a textbox within a Report with variations of the following expression 
    =Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0) 
    and 
    Iif(Fields!PointID.Value = 500, 1, 0)) / Sum(Iif(Fields!PointID.Value = 500, 1, 0)) 
    I see the following error when I try to preview the report: 
    The Value expression for the text box ‘Textbox2’ uses an aggregate expression without a scope. A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset. 
    What am I missing in this this expression to make it run incorrectly

    Can you include dataset name in your sum functions? e.g. Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0) 
    and 
    Iif(Fields!PointID.Value = 500, 1, 0)) should include your dataset name as Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0) and Iif(Fields!PointID.Value = 500, 1, 0),"datasetname")Like wise  Sum(Iif(Fields!PointID.Value = 500, 1, 0))  should also have dataset name Sum(Iif(Fields!PointID.Value = 500, 1, 0),"datasetname") 
    Gaur

  • Using report parameter in data set filter expression with an SSAS data source

    I have an SSRS report with an SSAS data source.
    Report parameters:
    Param1 - text, single select
    Param2 - text, multi-select
    Dataset:
    In Query Designer, I want to include Param1 as a filter expression so I can have "Dimension1 Begins with @Param2". I'm not sure the exact syntax to make param2 work in this.
    The point is to filter my data set on param1. If A is selected for param1, I want the data set to have the filter saying "Dimension1 begins with A"
    Anyone know how to use a report parameter in the dataset filter expression for an ssas data source?

    hi,
    try this maybe the dates you are comparing are not in the same format.
    I test data template in EBS but not with dates.
    to_date(date,'dd/mm/YY') between to_date(:p_from_date ,'dd/mm/YY') and to_date(:p_to_date ,'dd/mm/YY')
    if dont works try to put values insted of your parameter like :
    to_date(date,'dd/mm/YY') between to_date(:p_from_date ,'10/01/07') and to_date(:p_to_date ,'01/12/07') ... put dates where u can have some values in report...
    if dont work then try to print the values of the 2 parameters and the date of the select somwhere in ur report to see what you have in it..
    hope it helps..
    Regards Joe.

  • PS2013 / SQL 2012 - A SQL Reporting Services Report with more than one filter connection looses connection in a site template

    Hi,
    I created in a sub site not linked to a project to become a site template. I inserted two SQL Reporting Services reports web part that require the same two dates for an interval and the name of the project in a page of the site and connected
    to three filters, two for date and one for text and I got the page below (only one of the reports shown).
    Look that all parameters needed by the report are linked to the filters above the report.
    Then I save the site as template with all contentes and assign it to the EPTs and create a new project or replace the site of existing project site. What I got is:
    Look that the filter connection of the dates are lost (in both reports) and the order of the filters changed.
    I deleted and retried to connect the filters in diferent order and language, but I did not get any success.
    The BI Central Data Connectivity resource is activated in the template site and in the site collection.
    Is there any solution for this?
    Best regards, Ricardo Segawa - Segawas Projetos / Microsoft Partner

    Hi,
    Correction: this happens only with "Date Filter" web part!
    Best regards, Ricardo Segawa - Segawas Projetos / Microsoft Partner

  • Single SQL call for both Report & Chart

    Hi everyone,
    I am pretty new to APEX and I am loving it :)
    I need to create a page with two region (SQL Report & Flash Chart) and both region data will come from identical SQL statement.
    Could I make them both get data from a single sql call, instead of making 2 identical sql call for each region?
    Thanks before for any help.

    Can't think of any practical way to use only one call. Best I can come up with it to create the query as a Shared Component. At least that way your using the identical SQL source.
    HTH
    Chris

  • Determine Reports "Record Filter" as a SQL equlvilant

    Afternoon All,
    I am using the latest release, and am trying to work out how I can retrieve the final SQL query the report is using.
    My report is based on data held in a Table ("TABLE_ABC"), not a Command Table.
    I have a "Record Filter" of
    {TABLE_ABC.First_Name} = {?pFirstName}
    The report is ordered on
    {TABLE_ABC.Last_Name}
    If I run my report with a pFirstName parameter of "Bob" I am able to find the following information in my Log4j logs:
    [2010-01-06 17:05:41,717] INFO 73543[main] - com.crystaldecisions.reports.queryengine.QueryInfo.vE(SourceFile:230) - QueryInfo openRowset:
    [2010-01-06 17:05:41,717] INFO 73543[main] - com.crystaldecisions.reports.queryengine.Rowset.bL(SourceFile:444) - Rowset restart: moveToStart true
    [2010-01-06 17:05:41,717] INFO 73543[main] - com.crystaldecisions.reports.queryengine.Rowset.z3(SourceFile:921) - Rowset execute
    [2010-01-06 17:05:41,717] INFO 73543[main] - com.crystaldecisions.reports.queryengine.Connection.a(SourceFile:2929) - Executing query using a Query Definition.
    [2010-01-06 17:05:41,733] INFO 73559[main] - com.crystaldecisions.reports.queryengine.querybuilder.QueryBuilder.GenerateQuery(?:?) - Query:
    SELECT "TABLE_ABC"."First_Name", "TABLE_ABC"."Last_Name", "TABLE_ABC"."Old_Age", "TABLE_ABC"."New_Age", "TABLE_ABC"."Old_***", "TABLE_ABC"."New_***"
    FROM   "SCHEMA_XYZ"."TABLE_ABC" "TABLE_ABC"
    WHERE  ("TABLE_ABC"."First_Name"='Bob')
    ORDER BY "TABLE_ABC"."Last_Name"
    Is there any possible way I can determine this exact information programmatically?
    The whole reason for me wanting this information is I want to find a way to further filter the data of a report, so that I can dynamically manipulate the
    "Record Filter" for the report and thus I can split a Single Report PDF into multiple PDF report outputs, based on the users single Parameter of "Bob".
    .... continued below

    ... continued
    If for example I wanted to group the previous report by the value of "Old_Age" into individual PDFs.
    I am able to retrieve the "Record Filter" using the below code
    IFilter myFilter = reportClientDocument.getDataDefController().getDataDefinition().getRecordFilter();
    String currentFilter = myFilter.getText();
    This is all well and good but this filter is in Crystal Syntax and if anything more complex than a simple "equals" condition, will be almost
    impossible to "convert" into SQL syntax, which I am wanting to use to determine all the possible values of TABLE_ABC.Old_Age that can be found
    which still match the data criteria using the reports "Record Filter"
    Once I have build an array of these possible Old_Age values I will use them in the following loop     
    String freeEditingFilter = "{TABLE_ABC.Old_Age} = ToNumber(\"" + arr_Grouping[j] + "\")";
    freeEditingFilter = "(" + currentFilter + ") AND (" + freeEditingFilter + ")";
    myFilter.setFreeEditingText(freeEditingFilter);
    reportClientDocument.getDataDefController().getRecordFilterController().modify(myFilter);
    reportClientDocument.getDatabaseController().checkDatabase(true);
    exportPDF(reportClientDocument);
    This is the only possible way I can think of when trying to further split a existing report up into individual PDF outputs.
    If I was able to determine the above "...QueryBuilder.GenerateQuery" entry that is output in my logs, or the SQL syntax equivilant of
    whatever the reports "Record Filter" I would be happy as anything.
    Currently my work around is to have a suppressed text field on every report containing a SQL syntax equivalent of the whole
    query used to build the report data. So in my above example I would have a text box containing the text:
    SELECT DISTINCT ?GrpParam FROM TABLE_ABC WHERE First_Name = ?pFirstName
    I would then retrieve this text programmatically, replace ?GrpParam with the selected "grouper/splitter" (Old_Age) and also replace
    ?FirstName with the users parameter entry (Bob)
    With the results from this query I would place all the results in arr_Grouping[] and then use that to loop through
    my code and produce mupltiple reports using the original clause of "First_Name = Bob" and also the new
    grouping/splitting condition of "Old_Age"
    This is what I have come up with, and if anyone else has some ideas or solutions or anything I would
    be great appreciated.
    Cheers
    Darren

  • Filter expression producing different results after upgrade to 11.1.1.7

    Hello,
    We recently did an upgrade and noticed that on a number of reports where we're using the FILTER expression that the numbers are very inflated. Where we are not using the FILTER expression the numbers are as expected. In the example below we ran the 'Bookings' report in 10g and came up with one number and ran the same report in 11g (11.1.1.7.0) after the upgrade and got two different results. The data source is the same database for each envrionment. Also, in running the physical SQL generated by the 10g and 11g version of the report we get different the inflated numbers from the 11g SQL. Any ideas on what might be happening or causing the issue?
    10g report: 2016-Q3......Bookings..........72,017
    11g report: 2016-Q3......Bookings..........239,659
    This is the simple FILTER expression that is being used in the column formula on the report itself for this particular scenario which produces different results in 10g and 11g.
    FILTER("Fact - Opportunities"."Won Opportunity Amount" USING ("Opportunity Attributes"."Business Type" = 'New Business'))
    -------------- Physical SQL created by 10g report -------- results as expected --------------------------------------------
    WITH
    SAWITH0 AS (select sum(case when T33142.OPPORTUNITY_STATUS = 'Won-closed' then T33231.USD_LINE_AMOUNT else 0 end ) as c1,
    T28761.QUARTER_YEAR_NAME as c2,
    T28761.QUARTER_RANK as c3
    from
    XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ,
    XXFI.XXFI_OSM_OPPTY_HEADER_ACCUM T33142 /* Fact_Opportunity_Headers(CloseDate) */ ,
    XXFI.XXFI_OSM_OPPTY_LINE_ACCUM T33231 /* Fact_Opportunity_Lines(CloseDate) */
    where ( T28761.PERIOD_NAME = T33142.CLOSE_PERIOD_NAME and T28761.QUARTER_YEAR_NAME = '2012-Q3' and T33142.LEAD_ID = T33231.LEAD_ID and T33231.LINES_BUSINESS_TYPE = 'New Business' and T33142.OPPORTUNITY_STATUS <> 'Duplicate' )
    group by T28761.QUARTER_YEAR_NAME, T28761.QUARTER_RANK)
    select distinct SAWITH0.c2 as c1,
    'Bookings10g' as c2,
    SAWITH0.c1 as c3,
    SAWITH0.c3 as c5,
    SAWITH0.c1 as c7
    from
    SAWITH0
    order by c1, c5
    -------------- Physical SQL created by the same report as above but in 11g (11.1.1.7.0) -------- results much higher --------------------------------------------
    WITH
    SAWITH0 AS (select sum(case when T33142.OPPORTUNITY_STATUS = 'Won-closed' then T33142.TOTAL_OPPORTUNITY_AMOUNT_USD else 0 end ) as c1,
    T28761.QUARTER_YEAR_NAME as c2,
    T28761.QUARTER_RANK as c3
    from
    XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ,
    XXFI.XXFI_OSM_OPPTY_HEADER_ACCUM T33142 /* Fact_Opportunity_Headers(CloseDate) */ ,
    XXFI.XXFI_OSM_OPPTY_LINE_ACCUM T33231 /* Fact_Opportunity_Lines(CloseDate) */
    where ( T28761.PERIOD_NAME = T33142.CLOSE_PERIOD_NAME and T28761.QUARTER_YEAR_NAME = '2012-Q3' and T33142.LEAD_ID = T33231.LEAD_ID and T33231.LINES_BUSINESS_TYPE = 'New Business' and T33142.OPPORTUNITY_STATUS <> 'Duplicate' )
    group by T28761.QUARTER_YEAR_NAME, T28761.QUARTER_RANK),
    SAWITH1 AS (select distinct 0 as c1,
    D1.c2 as c2,
    'Bookings2' as c3,
    D1.c3 as c4,
    D1.c1 as c5
    from
    SAWITH0 D1),
    SAWITH2 AS (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    sum(D1.c5) as c6
    from
    SAWITH1 D1
    group by D1.c1, D1.c2, D1.c3, D1.c4, D1.c5)
    select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3, D1.c4 as c4, D1.c5 as c5, D1.c6 as c6 from ( select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    sum(D1.c6) over () as c6
    from
    SAWITH2 D1
    order by c1, c4, c3 ) D1 where rownum <= 2000001
    Thank you,
    Mike
    Edited by: Mike Jelen on Jun 7, 2013 2:05 PM

    Thank you for the info. They are definitely different values since ones on the header and the other is on the lines. As the "Won Opportunity" logical column is mapped to multiple LTS it appears the OBI 11 uses a different alogorthim to determine the most efficient table to use in the query generation vs 10g. I'll need to spend some time researching the impact to adding a 'sort' to the LTS. I'm hoping that there's a way to get OBI to use similar logic relative to 10g in how it generated the table priority.
    Thx again,
    Mike

  • Filter Object with Filter Expression error.

    Hello everyone!
    I'm trying to put together the following expression for a filter to be used in a report:
    Order Date -> object name = M1 - (number, measure)
    Current Date -> object name = M2 - (number, measure)
    Comparison between the two:
    <EXPRESSION> IIF (@ Select (M1) = @ Select (M2), 1.0) </EXPRESSION>
    object name 3
    So far everything works fine.
    When I create a report in Web and I put the filter M3 = 1, it filters properly.
    I thought of putting the filter in a filter object in the universe, like this:
    <FILTER EXPRESSION = "Select @ (M3)"> <CONDITION
    OPERATORCONDITION = "Equal"> <CONSTANT CAPTION="1"/></CONDITION></FILTER>
    Just as it is in Olap universes best practices written by Didier. (Page 12), as following example:
    Filter with a calculated member referenced in the filter expression:
    <FILTER EXPRESSION="@Select(Calendar Year\My Calculated Member)"><CONDITION
    OPERATORCONDITION="Equal"><CONSTANT CAPTION="1"/></CONDITION></FILTER
    But does not work when I put the query, the error is dpscommand. And I have no idea where the error is.
    The strange thing is it works, if I filter the query directly. ( Query filter: M3 equal 1).
    Do you have any tips? or something I could try that I have the M3 as a filter object?
    Tks a lot!
    Livia
    I am working on BO XI R3 - SP2 and the basead query is on SAP BW 7.0.

    macearl wrote:
    SQL View does not display unless data is returned by the query. Is that normal?
    Also, none of these options shows the literal result of the expression we built, i.e.:
    expression: CAST(YEAR(TIMESTAMPADD(SQL_TSI_MONTH, -24, CURRENT_DATE)) as CHAR)
    result: *2008*
    Having the ability to test expressions and see their results would be very helpful in debugging. If anyone knows how to do that please share!
    Thanks!
    MacOk, Probably shoud have figured this out before, but in response to my own question, the way to view the result of an expression is to add the expression as a column and include it in the Table Presentation.
    - Mac (he can be taught)

  • Assist with my SQL Reporting Script

    I have started writing a HTML SQL reporting script based off of Jeffrey Hicks tutorial
    Here is my entire script:
    ###################START SCRIPT#####################################
    #requires -version 3.0
    #Create a SQL Server report of said SQL environment
    [cmdletbinding()]
    Param(
    [string]$computername=$env:computername,
    [string]$path="$env:temp\sqlrpt.htm"
    #define an empty array to hold all of the HTML fragments
    #the fragments will break apart each HTML section in the final output so that you can out whatever information you like
    $fragments=@()
    #save current location so I can set it back after importing SQL module
    $curr = get-location
    #import the SQL module
    Import-Module SQLPS -DisableNameChecking
    #change the location back
    set-location $curr
    #get uptime
    Write-Verbose "Getting SQL Server uptime"
    $starttime = Invoke-Sqlcmd -Query 'SELECT sqlserver_start_time AS StartTime FROM sys.dm_os_sys_info' -ServerInstance $computername -database master
    $version = Invoke-Sqlcmd "Select @@version AS Version"
    #create an object
    $uptime = New-Object -TypeName PSObject -Property @{
     StartTime = $starttime.Item(0)
     Uptime = (Get-Date)-$starttime.Item(0)
     Version = $version.Item(0).replace("`n","|")
    $tmp = $uptime | ConvertTo-HTML -fragment -AS List
    #replace "|" place holder with <br>"
    $fragments += $tmp.replace("|","<br>")
    #SQL Host Information
    $smo = new-object ('Microsoft.SqlServer.Management.Smo.Server') $computername
    $fragments += "<h3>SQL Host Information Details</h3>"
    $fragments += $smo | select ComputerNamePhysicalNetBios,Name, Processors, ProcessorUsage, PhysicalMemory, PhysicalMemoryUsageInKB, MasterDBPath, BackupDirectory | ConvertTo-HTML -Fragment
    #Get Status of all SQL related Services
    Write-Verbose "Querying services"
    $services = Get-Service -DisplayName *SQL* -ComputerName $computername |
    Select Name,Displayname,Status
    $fragments += "<h3>SQL Services</h3>"
    $fragments += $services | ConvertTo-HTML -Fragment
    #get databases
    #path to databases
    Write-Verbose "Querying datases"
    $dbpath = "SQLServer:\SQL\Localhost\default\databases"
    $fragments += "<h3>Database Utilization</h3>"
    $fragments += dir $dbpath | Select Name,Size,DataSpaceUsage,SpaceAvailable,
    @{Name="PercentFree";Expression={ [math]::Round((($_.SpaceAvailable/1kb)/$_.size)*100,2) }} |
    Sort PercentFree | ConvertTo-HTML -fragment
    #get database backup information
    # Create an SMO connection to the instance
    $smo = new-object ('Microsoft.SqlServer.Management.Smo.Server') $computername
    $dbbackups = $smo.Databases
    $fragments += "<h3>Last Database Backup Information</h3>"
    $fragments += $dbbackups | select Name,LastBackupDate, LastLogBackupDate | ConvertTo-HTML -Fragment
    #Login & Service Account Information#SQL Host Information
    $smo = new-object ('Microsoft.SqlServer.Management.Smo.Server') $computername
    $fragments += "<h3>Login & Service Account Information</h3>"
    $fragments += $smo | select ServiceAccount, Logins | ConvertTo-HTML -Fragment
    #volume usage
    Write-Verbose "Querying system volumes"
    $data = Get-CimInstance win32_volume -filter "drivetype=3" -ComputerName $computername
    $drives = foreach ($item in $data) {
        $prophash = [ordered]@{
        Drive = $item.DriveLetter
        Volume = $item.DeviceID
        Compressed = $item.Compressed
        SizeGB = $item.capacity/1GB -as [int]
        FreeGB = "{0:N4}" -f ($item.Freespace/1GB )
        PercentFree = [math]::Round((($item.Freespace/$item.capacity) * 100),2)
        #create a new object from the property hash
        New-Object PSObject -Property $prophash
    [xml]$html = $drives | ConvertTo-Html -fragment
    #check each row, skipping the TH header row
    for ($i=1;$i -le $html.table.tr.count-1;$i++) {
      $class = $html.CreateAttribute("class")
      #check the value of the last column and assign a class to the row
      if (($html.table.tr[$i].td[-1] -as [int]) -le 25) {                                         
        $class.value = "danger" 
        $html.table.tr[$i].Attributes.Append($class) | Out-Null
      elseif (($html.table.tr[$i].td[-1] -as [int]) -le 35) {                                              
        $class.value = "warn"   
        $html.table.tr[$i].Attributes.Append($class) | Out-Null
    $fragments += "<h3>Volume Utilization</h3>"
    $fragments += $html.innerxml
    #define the HTML style
    Write-Verbose "preparing report"
    $imagefile = "c:\scripts\db.png"
    $ImageBits = [Convert]::ToBase64String((Get-Content $imagefile -Encoding Byte))
    $ImageHTML = "<img src=data:image/png;base64,$($ImageBits) alt='db utilization'/>"
    $head = @"
    <style>
    body { background-color:#FAFAFA;
           font-family:Arial;
           font-size:12pt; }
    td, th { border:1px solid black;
             border-collapse:collapse; }
    th { color:white;
         background-color:black; }
    table, tr, td, th { padding: 2px; margin: 0px }
    tr:nth-child(odd) {background-color: lightgray}
    table { margin-left:50px; }
    img
    float:left;
    margin: 0px 25px;
    .danger {background-color: red}
    .warn {background-color: yellow}
    </style>
    $imagehtml
    <br><br><br>
    <H2>SQL Server Report: $Computername</H2>
    <br>
    #create the HTML document
    ConvertTo-HTML -Head $head -Body $fragments -PostContent "<i>report generated: $(Get-Date)</i>" |
    Out-File -FilePath $path -Encoding ascii
    Write-Verbose "Opening report"
    Invoke-Item $path
    ######################END SCRIPT##################################
    I have 2 questions for help in regards to the above script:
    1)  For the Login and Service Account portion I can't get my output to show up properly.  Here is the snip from the script:
    #Login & Service Account Information#SQL Host Information
    $smo = new-object ('Microsoft.SqlServer.Management.Smo.Server') $computername
    $fragments += "<h3>Login & Service Account Information</h3>"
    $fragments += $smo | select ServiceAccount, Logins | ConvertTo-HTML -Fragment
    Here is how the output shows for this portion:
    ServiceAccount
    Logins
    domain\svcAcct
                 Microsoft.SqlServer.Management.Smo.LoginCollection
    I would like top have the login information show in the above table of the all the different logins.  When I run the script without HTML for that portion and just output to console it shows the login info as I would expect.
    2)  The 2nd question is, how do I add a variable to the bottom of the script to email the report to said email address.  This is probably simple but can't get my head wrapped around this part.
    Thanks all in advance!

    Thanks AnnaWY, that resolved the portion on how to email the report.  I was also able to utilize the following code which does the same thing as well:
    #Send an email with the contents of the report
    $MailBody= Get-Content $path
    $MailSubject= "SQL Server Report"
    $SmtpClient = New-Object system.net.mail.smtpClient
    $SmtpClient.host = "smtp.server.com"
    $MailMessage = New-Object system.net.mail.mailmessage
    $MailMessage.from = "[email protected]"
    $MailMessage.To.add("[email protected]")
    $MailMessage.Subject = $MailSubject
    $MailMessage.IsBodyHtml = 1
    $MailMessage.Body = $MailBody
    $SmtpClient.Send($MailMessage)
    I still have not been able to resolve the portion regarding the login/service account information not showing up in the table correctly.  For the time being I have removed it from the environment report and instead included it as a script of its own
    in our Security Auditing process.

  • FILTER EXPRESSION COMPARING DATA TYPES

    Hi,
    I am recieving an error when running my report. I added a filter expression to my chart which only shows data > 24 hours but I am receiving the following error... can anybody help me?
    CANNOT COMPARE DATA OF TYPES SYSTEM.DECIMAL AND SYSTEM.DOUBLE

    Hi Irj1985,
    Based on the error message, we can know that the data type of the two values are different. One of them is decimal, another of them is double.
    To trouble this issue, please refer to the steps below.
    Ensure that the issue was cause by the filter.
    Convert the data type of one of the value to the data type of another value.
    If the issue persists, please elaborate the issue, provide the detail information about the fitler and your report, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Conditional display in a SQL-Report/Report Region

    Hi,
    here I have an example for "Conditional display in a SQL-Report/Report Region". I figured it out in Firefox 3.6.2 using Firebug as development tool on Apex 3.2.1.00.12.
    First you have to put the following javascript code in the Page HTML-Header:
    <script type="text/javascript">
    <!--
    // SOURCE
    // W:\oracle\PRJ DWLS\javascript.07.js
    // Beispiel Funktion zur bedingten Formatierung einer Tabellenzelle.
    // Help (Substitution Strings):
    // http://htmldb.oracle.com/pls/otn/wwv_flow_help.show_help?p_lang=de&p_session=2412201185523196&p_flow_id=4003&p_step_id=420,4003
    // HTML Expression:
    // <script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#DFT_COND1#
    function ex_conditional_td
    ( p_id
    , p_rownum
    , p_cellnum
      var l_td;
      l_td = vd_getColumn(p_id, p_rownum, p_cellnum);
      // hier die Bedingung definieren
      if (true) {
        l_td.style.color = '#808080';
    }  // -- eof ex_conditional_td -- //
    // Beispiel Funktion zum Abstellen der onMouse Funktionalität der Tabellenzeile
    // HTML Expression:
    // <script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#DFT_ID#"
    function ex_conditional_tr
    ( p_id
    , p_rownum
      var l_tr;    // TABLE.TR
      var l_td;    // TABLE.TR.TD
      if (true) {
        l_tr = vd_getRow(p_id, p_rownum);
        l_tr.onmouseover = null;
        l_tr.onmouseout  = null;
        for (var i=0; i<l_tr.cells.length; i++) {
          l_td = l_tr.cells;
    l_td.style.backgroundColor = '#DDDDDD';
    } // -- eof ex_conditional_tr() -- //
    var g_DEBUG = false;
    var g_TBODY = null;
    // Liefert das Body-Element der Tabelle mit der ID <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // Return
    // das Body-Element oder NULL, wenn die Zeile nicht gefunden wurde
    function vd_getBody
    ( p_id
    if (g_TBODY == null) {
    var l_table = null;
    l_table = document.getElementById( p_id );
    if (l_table == null) {
    l_table = document.getElementByName( p_id );
    if (l_table != null) {
    if (vd_debug()) {
    alert("Tabelle gefunden, " + l_table.nodeName);
    g_TBODY = vd_search( l_table, 'TD', 't10data', 'TBODY');
    return g_TBODY;
    } // -- eof vd_getBody() -- //
    // Liefert die Zeile <p_rownum> der HTML-Tabelle mit der Id <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // p_rownum - die Zeilennummer
    // Return
    // die Zeile oder NULL, wenn die Zeile nicht gefunden wurde
    function vd_getRow
    ( p_id
    , p_rownum
    var l_body = vd_getBody(p_id);
    if ( l_body != null
    && l_body.nodeName == 'TBODY'
    && l_body.children[p_rownum].nodeName == 'TR') {
    return l_body.children[p_rownum];
    else {
    return null;
    } // -- eof vd_getRow() -- //
    // Liefert die Spalte <p_column> der Zeile <p_rownum> der HTML-Tabelle mit der
    // Id <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // p_rownum - die Zeilennummer
    // p_column - der Index der Spalte / Zelle
    // Return
    // die Zelle oder NULL, wenn die Zelle nicht gefunden wurde
    function vd_getColumn
    ( p_id
    , p_rownum
    , p_column
    var l_tr = vd_getRow(p_id, p_rownum);
    if ( l_tr != null
    && l_tr.nodeName == 'TR'
    && l_tr.children.length >= p_column
    && l_tr.children[p_column].nodeName == 'TD') {
    return l_tr.children[p_column];
    else {
    return null;
    } // -- eof vd_getColumn() -- //
    // Rekursives Suchen nach einem Node.
    // Zweck: Das bedingte Formatieren einer Tabellenzelle in einem Apex Standard
    // SQL-Report.
    // Diese Funktion durchsucht rekursiv, ab einem Ausgangsknoten <p_node>, alle
    // darunter befindlichen Elemente, ob in dem Element <p_seachIn> sich die
    // Klasse <p_class> befindet.
    // Bei Standard-Reports ist die Reportzelle (TD) mit der Klasse
    // "t10data" formatiert.
    // Zunächst muss dazu die Tabellenzelle (TD) selbst, die übergeordnete
    // Tabellenzeile (TR), der Tabellenbody (TBODY) oder die Tabelle (TABLE)
    // selbst ermittelt werden.
    // Der Beispielaufruf:
    // var l_body;
    // var l_node = document.getElementById( 'R112233' );
    // l_body = search( l_node, 'TD', 't10data', 'TBODY');
    // durchsucht also das mit der Id "R112233" versehene Element [der Report, für
    // den in Apex eine statischen ID vergeben werden musste] rekursiv, bis er
    // die [erste] Tabellenzelle "TD" findet, die als Klasse "t10data"
    // definiert hat. Für diese ermittelt er dann das übergeordnete TBODY-Element.
    // Parameter
    // p_node - das Ausgangselement
    // p_searchIn - der Knotenname, der durchsucht werden soll
    // [node.nodeName == p_searchIn]
    // p_class - der Name der CSS Klasse
    // [node.classList[<index>] == p_class
    // p_parentName - der Name [node.parentNode.nodeName == p_parentName]
    // des Elements, das zurückgeliefert werden soll. Wird als
    // p_parentName der Suchname p_searchIn angegeben, wird
    // das Element selbst zurückgegeben.
    // Return
    // das per p_parentName gesuchte Element (TD, TR, TBODY, TABLE)
    function vd_search
    ( p_node
    , p_searchIn
    , p_class
    , p_parentName
    var LN = "vd_search";
    var l_element = null;
    // DEBUG
    if (vd_debug()) {
    alert(LN + ":" + "Untersuche " + p_node.nodeName + ", id=" + p_node.id);
    // 1) der aktuelle Knoten ist der, der durchsucht werden soll
    if (p_node.nodeName == p_searchIn) {
    if (p_node.classList.length > 0) {
    for(var c=0; c<p_node.classList.length; c++) {
    if (p_node.classList[c] == p_class) {
    // Parent Node dynmisch suchen
    l_node = p_node;
    if (l_node.nodeName == p_parentName) {
    return l_node;
    while(l_node != null && l_node.parentNode != null) {
    if (l_node.parentNode.nodeName == p_parentName) {
    return l_node.parentNode;
    else {
    l_node = l_node.parentNode;
    // 2) wenn nicht 1) oder nicht in 1) gefunden, dann in den Kindelementen
    // weitersuchen
    if (p_node.children.length > 0) {
    var i = 0;
    while (i<p_node.children.length && l_element==null) {
    l_element = vd_search( p_node.children[i], p_searchIn, p_class, p_parentName);
    i++;
    return l_element;
    } // -- eof vd_search() -- //
    // Gibt an, ob Debug ein- (true) oder ausgeschaltet (false) ist.
    // Return
    // true - debug ist eingeschaltet
    // false - debug ist ausgeschaltet
    function vd_debug()
    return g_DEBUG;
    -->
    </script>
    Maybe you have to modify the "vd_getBody" function. I'm searching the table cell with having the class "t10data". When you use another theme, there's maybe another class used.
    Second is, that you set an static id for your report region. I prefer this structure:
    R<app-id><page-id><seq> (Raaaaappppsss) e.g. R094260001010.
    First example is to turn off the onMouse-Effect. Maybe on the first or last column definition you put this code in the "HTML-Expression" area:
    <script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#ID#This will call the example function ex_conditional_tr with the parameter
    a) the region id
    b) the rownum (as oracle always starts with 1 this is the first data row [rownum=0 is the table header row])
    Second example is the conditional formatting of a table cell. Put this in the HML-Expression area:
    <script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#ENAME#This will call the example function ex_conditional_tr with the parameter
    a) the region id
    b) the rownum
    c) the cellnum (here we have to subtract 1 to get the "real" cell index)
    The "ex_conditional" functions are just a representation of how to get the row or cell node.
    Hope this help a bit.
    Tom

    I would use a CASE statement in the select....
    each CASE would be an img src tag for a different button if the button is an image.
    does that make sense? I can include an example if you would like...

Maybe you are looking for

  • How can I prevent web pages from automatically reloading, such as The Druge Report, etc.

    Several web sites I frequent automatically reload their front page whenever they want to...not when I manually refresh...interrupting streaming videos, etc. I do not want these pages to do this, only I want the ability to manually refresh a web page.

  • Invalid Flow Context error in Inbound Queues

    I am new to CRM middleware. We are getting lot of entries in CRM Inbound Queue (SMQ2) in our production system with error description, "Invalid Flow Context". The queues are of type, "R3AD_CONNOBJXXXXXXXXXX" and the FM the error was caused in, is "BA

  • IPlayer wont play in HD mode?

    I just get the circle spinning round. Everything seems to play until I try to play in HD. It's not my connection as I unplugged the ethernet cable from the vision box and plugged it into my laptop and got a speed test of 75meg! Is iPlayer just parp?

  • About draw GIF in "paintComponent(Graphics)" Method ???

    I extends a new class A from JPanel and overwrite the method of "paintComponent(Graphics)", the code is like below: public void paintComponent(Graphics g)   super.paintComponent(g);   // imgObj is a GIF file.   g.drawImage(imgObj, 100, 100, this); }i

  • Can someone makepkg a kernel26zenmm-git for me?

    Hi, I'm not sure which forum this goes in, since this is not a support request nor a PKGBUILD request. I tried building the kernel26zenmm-git package from AUR, but after about 6 hours or so of git trying to reconstruct the repository, my /tmp partiti