Ok with the advent of the new report designer (3.5) a lot of stuff has changed so time for an update. I’ll follow the same basic format any problems, questions or things not understood please post below.
Style Expressions 101 Mk2
Step 1) How to set up Style Expressions:
This bit has changed the most in the new version. The entire way style expressions are created has changed. The new way is a lot more intuitive and simple but I’ll still go over it as it’s important.
Using the same original example we need to make some thing hidden in one of the report output types. E.G the report footer in CSV output.
1) Select the object you want to hide.
2) Make sure the style tab is selected in the bottom right panel.
3) Scroll down to the visible line in the table, it’s in the “size and position” section
4) Click on the plus in the formula column
5) Enter “=NOT(ISEXPORTTYPE("table/csv"))” in the text box that pops up
6) Press Close.
Ta Da. One style expression. The report will now hide the object you just applied that to if it’s run as a csv output.
Part 2) What was that magic string?
This section is almost identical to the old one so I am not going to bother copying it again. The only major thing to note if you’re used to using the old style expressions is that the new ones are a lot stricter on syntax. You used to be able to get away with having extra junk at the end of your formula, extra semi-colons at the end of if statements and after the formula. No more. These will cause the formula to fail. So be careful when copying old formula around. I have tried to make sure all the formula in here are updated but I might have missed one.
Part 3) This was about what all the style keys do.
With the new PRD it is a lot easier to work out where to put your style expressions. The new formula column keeps things clear and easy to tell what attributes may be effected by style expressions. Some of the names will no longer match up to what they were before. (computed sheet name has become “sheetname” for instance) how ever you can easily test what an attribute does before using the style expression to make sure you have what you want by simply editing the attribute.
Part 4) Examples.
I have tried to update all the examples here so they have the right syntax. Any issues with them let me know
Trick 1: changing the colour to get excel colours.
This one is mostly the same. Seems I got the right formula before.
=IF(ISEXPORTTYPE("table/excel"); "#C0C0C0"; "")
This needs to be applied to either the “text-color” or “bg-color” attributes. (Strangely the “text-color” attribute seems to be the border colour of boxes)
Trick 2: adding Padding to html and pdf output
Again the formula is the same:
=IF(ISEXPORTTYPE("table/csv"); "0"; "3")
The attributes you need are in the Padding section. They should be pretty self explanatory as to which ones you need.
Trick 3: Sensible sheet names on multipage excel documents
The formula (make sure you don’t have the ‘;’ on the end like in the old example)
=IF([pageFunction]=1; "Summary"; "Sheet " & [pageFunction])
This one needs to be applied to the sheetname attribute in the excel section of the report header.
For Fie’s example the two formulas are the same but they now need to be applied to the x-overflow and width attributes.
Any one wants to add to it, feel free.
Good luck
Wil
SQL: as much of a standard as the English language