Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Function or Var to return file name?
TimS
Hello all,
I am new to BIRT, was wondering if there was a function call or some sort of system variable in which BIRT will give back the name of the file that is currently being viewed.
We keep titles stored in a DB which BIRT queries against when generating the reports. Unfortunately the current where clause in the query simply states where report_file='FILE_NAME'. This is not desired as we train our customers to build their own reports against a data warehouse. Hence, if we define the master page of a specific file to only get the title of a statically-defined file name, it can lead to errors.
Is there any function or var where I can use something like this?
Psuedo:
Select name
from public.report
where report_file='$$report_file'
$$report_file would be a function or var in which BIRT would send back the name of the current file.
Thanks in advanced!
-Tim
Find more posts tagged with
Comments
TimS
Does anyone have any knowledge in this aspect?
-Tim
mwilliams
Hi Tim,
Are you talking about database files or report design files?
TimS
Like I am working on a file my_report_file.rptdesign within BIRT. I want to include the file name at the footer of my master page WITHOUT the use of AUTOTEXT.
So for each page in a report, some function call would just find out what the file name is and dynamically place it into the report.
This is so our customers know which report file they are looking at and if they want to, use our template which will automatically display the file name of their new custom report.
-Tim
mwilliams
Tim,
If you put...
r = "ReportName = " + reportContext.getReportRunnable().getReportName();
...in the initialize method script of the report, then place a label in the master page or report with the following script in the OnCreate method, you should get what you're looking for.
this.text = r;
Hope this helps.
TimS
And this will return the full filename with .rptdesign file extension?
Thanks,
Tim
mwilliams
Sure will!
TimS
Worked like a charm thanks so much!
-Tim