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!
Post
FollowConditional 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
Please sign in to leave a comment.
6 comments
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
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.
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
Looking good so far. Will let you know if anything bad happens.
Tom
Seems reasonable to me, too, Tom. Give it a shot and let me know how it goes.