Community
Participate
Working Groups
Build ID: 3.3.0 I20070625-1500 Steps To Reproduce: 1. Write an event handler that implements IScriptedDataSetEventHandler 2. Create a report design using your scripted data set and set some properties like "comments" and "customXml". 3. Put a breakpoint in the describe method and run the report in the debugger. 4. When the breakpoint is hit, note that by expanding the attributes of the IDataSetInstance you can see the "propValues" map and that the properties and their values are in that map. 5. Note that you cannot get to the property map from the IDataSetInstance because there are no accessible methods to do so. More information: It should be possible to request the value of a data set property from the IDataSetInstance argument directly, with a getPropertyValue method, for example. The following reflection-based code that specifically forces inaccessible attributes to be accessible, does get to the property map, proving that the data is indeed there: /* =============================================================== */ public boolean describe ( IDataSetInstance aIDataSetInstance, IScriptedDataSetMetadata aIScriptedDataSetMetadata ) { Map<String,Object> myPropertyMap = getPropertyMap (aIDataSetInstance); . . . } /* =============================================================== */ protected Map<String,Object> getPropertyMap ( IDataSetInstance aIDataSetInstance ) { try { Object myObject = aIDataSetInstance; myObject = getFieldObject (myObject, myObject.getClass (), "dataSet"); myObject = getFieldObject (myObject, myObject.getClass (), "scriptEventHandler"); myObject = getFieldObject (myObject, myObject.getClass (), "dataSetHandle"); myObject = getFieldObject (myObject, myObject.getClass (), "element"); myObject = getFieldObject (myObject, myObject.getClass (), "propValues"); return ((Map<String,Object>) myObject); } catch (Throwable myThrowable) { return (null); } } /* =============================================================== */ protected Object getFieldObject ( Object aParentObject, Class<?> aParentObject, String aFieldName ) { Object myObject = null; try { Field myField = aParentClass.getDeclaredField (aFieldName); myField.setAccessible (true); myObject = myField.get (aParentObject); } catch (Throwable myThrowable) { myObject = getFieldObject ( aParentObject, aParentClass.getSuperclass (), aFieldName ); } return (myObject); }
Requires API change. Deferring to next maintenance release.