SSRS Dynamic String Expression

I am creating a report in which I need to defer a row in a table based on the value from my result set for this row. For example, if the value is 0, do not backtrack at all. If the value is 1 indented by 5 spaces. If 2 indents are 10 times spaces, etc.

What I originally tried to do was use something like this:

= Space (Fields! Depth.Value * 5) + Fields! name.Value

This works great when rendering in a visual studio, but displays it in a browser window when rendering through report services causes these spaces to be removed. I circumvented this issue earlier with this tip: http://mssqltips.com/tip.asp?tip=1286 .

Any suggestions on how to dynamically manage this indent? I want to be able to do this dynamically with hard coding of numerous IF statements, as they are trying to make this report flexible enough so that I can get any number for this value.

+4
source share
1 answer

You can try to set the left padding in the appropriate cell with the following expression:

=CStr(2 * Fields!depth.Value) + "pt" 

You may need to play with the multiplier as it indicates, not spaces.

+3
source

Source: https://habr.com/ru/post/1338963/


All Articles