Post

1 follower Follow
0
Avatar

Using attributes as default report parameters

Hi!

May have asked this before but,

I am using field values in a report, e.g., for the title. What I would like to do is to be able to change the title when I generate the report. Perhaps, the best way to explain this is by example. Assume I have a package which has a value for $ReportTitle. For a specific report I want to use another title. So, I set things up as:

 

$param $$Title

Title: $$Title

My problem is that I want the default value for $$Title to be $ReportTitle, e.g., when no title is entered for the parameter.

I have tried using:

$if $$Title = '' $set $$Title $ReportTitle $endif

which does not work.

Any way to make this happen?

Thanks!

Tom 

Tom Tomasovic Answered

Please sign in to leave a comment.

1 comment

0
Avatar

Not sure if you've asked it before or not, Tom, but here goes:

Firstly, make sure you're defining your parameter ($param $$Title) within the $info section of your template. Otherwise, the reporting engine will think it's a variable instead, and will never prompt you to enter a value for it in the UI.

Secondly, the $if statement you've got there is very close, and just needs a set of brackets to set apart what the $if is actually testing, like this:

$if [$$Title = ‘’] $set $$Title $ReportTitle $endif

Other than that, I think all you need is to put the "Title: $$Title" line after wherever you set up your $if/$endif, so that if $$Title winds up being empty (and therefore reset to match your $ReportTitle value), you'll display the newly assigned value.

I think that should do it; just let me know if you have further questions.

Jason

Permanently deleted user 0 votes
Comment actions Permalink