Dynamic header in report

Hello Team,

We want to add dynamic headers to reports. We are using Helical Insight 5 and in report using Properties, we have added a report header but that is Hard coded. We want to change it dynamically. Please advise the same.

Thank you

Hello,

We can achieve this using custom JS code. Explanation of the same is as below:

Create a report in Helical Insight application and assign blank title to it by enabling Header.

image

image

image

Now inject below code into Operations → Post Execution :

image

image

After that click on Apply.

Code is as below:

const urlParams = new URLSearchParams(window.location.href);
const title = urlParams.get('title');
console.log(title);

properties.title.show = true
properties.title.value = title

Now, in your report url, pass the title as parameter:

For example report url is: http://127.0.0.1:8085/hi-ee/#/report-viewer?dir=yuva&file=filterLabel.hr&mode=open

Then add an extra parameter in this URL called title (This is case sensitive).

Assign text value you want for report title.

So, end url will be:

http://127.0.0.1:8085/hi-ee/#/report-viewer?dir=yuva&file=filterLabel.hr&mode=open**&title=TEXTOFYOURCHOICE**

Once you pass this, the title which you have passed in URL will be shown as header title in your report and this will also be exported the same into PDF.

Thank you,
Helical Insight.