Home DevShare Designing BIRT Reports

Get Folder and Report Name

Share

by dmelcher

Blog - 5 postsDevShare - 5 postsForum - 10 postsPoll VoterLeaderboard - 1 time
Posted 02 Mar 2011 - 11:15 AM

(1)  (0)   (459 views)

Quick script for BIRT design to get the folder and report name.

Birt Version:-2.3

Scripting in BIRT design to get the current folder and report name:


// Get report folder/report name
var reportFolderAndReportName = reportContext.getReportRunnable().getReportName();


Forum - 10 posts

ReinerE

Posted: 29 Jul 2011 - 05:39 AM

Only the name of the report? Any hint? Thx.

Blog - 5 postsDevShare - 5 postsForum - 10 postsPoll Voter

dmelcher

Posted: 29 Jul 2011 - 08:14 AM

You can use basic Javascript string functions to extract the report name from the reportFolderAndReportName variable: reportFolderAndReportName.substr(reportFolderAndReportName.lastIndexOf('/') plus 1) will return just the report name

Leaderboard - 1 timeForum - 25 posts

Baku

Posted: 29 Aug 2011 - 07:21 AM

I don't understand why with this script I get this error :Uncaught ReferenceError: reportContext is not definedAny ideas why I can't access my reportContext ??

Blog - 5 postsDevShare - 5 postsForum - 10 postsPoll Voter

dmelcher

Posted: 29 Aug 2011 - 08:05 AM

What report item and function are you attempting to use reportContext in? Sometimes you need to use this.reportContext depending on where you use it.

Leaderboard - 1 timeForum - 25 posts

Baku

Posted: 30 Aug 2011 - 07:35 AM

My bad.. i wasn't in a 'dynamic' text editor for writing my script...
 
Filter More