It's all about the answers!

Ask a question

Detecting Report Design Perspective and Web Client in BIRT


Bill Taylor (3144) | asked Jan 27 '10, 6:59 a.m.
Is it possible in a BIRT report to distinguish between running in the Design Perspective and the RTC Eclipse Client?

4 answers



permanent link
James Moody (3.3k24) | answered Jan 27 '10, 4:38 p.m.
JAZZ DEVELOPER
On 1/27/2010 7:08 AM, bill.taylor wrote:
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

permanent link
Bill Taylor (3144) | answered Feb 03 '10, 3:45 a.m.
That works perfectly, thank you

permanent link
Bill Taylor (3144) | answered Feb 03 '10, 3:52 a.m.
I know you can hide elements selectively according to document type, but can you determine the document type programmatically?

Many thanks

permanent link
James Moody (3.3k24) | answered Feb 03 '10, 2:38 p.m.
JAZZ DEVELOPER
On 2/3/2010 3:53 AM, bill.taylor wrote:
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

Your answer


Register or to post your answer.