Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Scripted Data Source Mock Object
shermand
I have a need to create a report that uses an external java object as its data source. No problem, I've got that working, binding the object to the IRunTask like
MyDataObject mdo = new MyDataObject();
// stuff happens...
Map map = task.getAppContext();
map.put("MyData", mdo);
task.setAppContext(map);
But that only works in the runtime environment where I have access to the REAPI (and the rest of my environment that populates "mdo". The report designer Preview view doesn't work, because there's no object bound for the scripted data source to use.
How do I detect that I'm running in the report designer, so I can do something clever to bind a mock data object, allowing the preview to work? If there's an answer to this somewhere already that I haven't found, please tell me where it is!
Thanks.
BIRT 2.3, upgrade likely soon.
Find more posts tagged with
Comments
Virgil Dodson
One thing that I usually do is have a Java project in my same workspace in addition to my Report Project, and then in the Report Project properties under Project References, make a check mark by the Java project.
Now my BIRT designs can see Java classes and then I create a simple Java class with some stubbed in data.