Detecting Report Design Perspective and Web Client in BIRT
4 answers
On 1/27/2010 7:08 AM, bill.taylor wrote:
When we run in the RTC Eclipse Client (or in the RTC Web UI) we pass a
context map to the BIRT report engine, with some known values in it. You
could test for the existence of one of these values in the map.
For example,
var projectArea = reportContext.getAppContext().get("PROJECT_AREA");
If it was in the map, you're running in RTC. If not, you're in some
other viewer (probably the BIRT viewer).
Hope this helps.
james
RTC Reports Team Lead
Is it possible in a BIRT report to distinguish between running in the
Design Perspective and the RTC Eclipse Client?
When we run in the RTC Eclipse Client (or in the RTC Web UI) we pass a
context map to the BIRT report engine, with some known values in it. You
could test for the existence of one of these values in the map.
For example,
var projectArea = reportContext.getAppContext().get("PROJECT_AREA");
If it was in the map, you're running in RTC. If not, you're in some
other viewer (probably the BIRT viewer).
Hope this helps.
james
RTC Reports Team Lead
On 2/3/2010 3:53 AM, bill.taylor wrote:
The IReportContetx should be able to answer this question. For example,
in the context of a chart:
if (icsc.getExternalContext().getScriptable().getOutputFormat() == "pdf") {
...
}
In a (non-chart) report item you can just ask the context:
reportContext.getOutputFormat()
james
RTC Reports Team Lead
I know you can hide elements selectively according to document type,
but can you determine the document type programmatically?
Many thanks
The IReportContetx should be able to answer this question. For example,
in the context of a chart:
if (icsc.getExternalContext().getScriptable().getOutputFormat() == "pdf") {
...
}
In a (non-chart) report item you can just ask the context:
reportContext.getOutputFormat()
james
RTC Reports Team Lead