Post

1 follower Follow
0
Avatar

Conditional statements in template headers and footers

Is this possible?

I am trying to use an $if statement in my document footer, and I keep getting a "missing $endif" error.  I'm pretty sure the code is correct, and the document which is generated shows the code in the footer (that's how I know where the error is happening.

The footer is in a table, and I have tried inserting the conditional both within and outside of the table.

Hope I am not out of luck!

Thanks!

Tom

Tom Tomasovic Answered

Please sign in to leave a comment.

6 comments

0
Avatar

Tom - would you mind sending me your report template to take a look at? As far as I know, $if / $endif statements should work in the header and footer sections of a report template, though maybe there's something in your specific construction that's preventing this. Just shoot it over to support@serlio.com  Thanks!

Permanently deleted user 0 votes
Comment actions Permalink
0
Avatar

Jason,

Here is the latest version I tried, but I also embedded the $if logic in the individual cells (unsuccessfully) and I tried using the $repeat without the $if logic (also, unsuccessfully).

Hope you can assist!!

Thanks!

Tom

Tom Tomasovic 0 votes
Comment actions Permalink
0
Avatar

I apologize, Tom. As it turns out, I was wrong, and $if / $endif statements aren't supported in headers and footers. I've attached a modified version of your template, which moves the $if section outside of the footer. Basically, we're using the $if / $endif to define a couple of additional variables, then using those variables to display the necessary information in the footer for that first page.

Permanently deleted user 0 votes
Comment actions Permalink
0
Avatar

Am trying out your code right now.  Had to add a "default" option for the case where $$project is blank, but that's not a real big deal.  Can I do something like:

$repeatPackages where Name = 'Base'

set $$producedby = $Author

$endRepeatPackages

$if $$project <> ''...

i.e., CHANGE the value of the variable?  Makes sense to me, but...

Thanks!

Tom

Tom Tomasovic 0 votes
Comment actions Permalink
0
Avatar

Looking good so far.  Will let you know if anything bad happens.

Tom

Tom Tomasovic 0 votes
Comment actions Permalink
0
Avatar

Seems reasonable to me, too, Tom. Give it a shot and let me know how it goes.

Permanently deleted user 0 votes
Comment actions Permalink