Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3458
  • Last Modified:

Repoting services - Conditional format with indent

Hi-  I have a field called "Title" which depending apon a filed called Outline Number I wish to indent a certain number of spaces.  Would this type of formatting go under the format optins of the table?

Currently I have Color formatting eg: =IIF(Fields!name.Value = 1,"RoyalBlue", IIF(Fields!name2.Value=1,Blue, "Black"))

How would I do the indentions for 2-3 spaces for each row given the value of existance of another field.

Thanks!
0
DEN_Jimbo
Asked:
DEN_Jimbo
  • 4
  • 2
1 Solution
 
Chris LuttrellSenior Database ArchitectCommented:
In the textbox expression, (not format properties), do something like this:
=StrDup(IIF(Fields!FedInd.Value="True",3,0)," ")+Fields!FirstName.Value

Here I checked a boolean value in my data and added 3 spaces in front of the FirstName value if it was true and 0 if false.  I think you can apply that to your situation.  Maybe like this indenting by the OutlineNumber:
=StrDup(Fields!OutlineNumber.Value," ")+Fields!Title.Value
0
 
DEN_JimboAuthor Commented:
Great suggestion this somewhat works.  Perhaps you have an idea on the sticking point.

It shows up correctly in visual studio.  However when displayed on the reports server eg Reports/Pages/Report.aspx?ItemPath=

The indents do not show up; However I can export this to xls or the like and the indets are back.  Any way to get it showing up on the live reportsserver genertion of it?

0
 
Chris LuttrellSenior Database ArchitectCommented:
ah, html ignores the whitespace.  We do so much to xls and PDF I forget about that.  I will look for a work-around.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
Auric1983Commented:
Can you use a leading character? I cheated when I had to do this and used a period . + the spaces
0
 
Chris LuttrellSenior Database ArchitectCommented:
Could you use the . instead of " " for indentions?  
Even when I preceded the spaces with a dot like this, it collapsed the spaces down to 1 space.
="."+StrDup(Fields!OutlineNumber.Value," ")+Fields!Title.Value

But if I used "." instead of " " in the StrDup function it will ofcourse keep all the dots.
=StrDup(Fields!OutlineNumber.Value,".")+Fields!Title.Value
0
 
Auric1983Commented:
Heres the code I used in a report where I used this logic

="." + Space(5*Fields!JobLvl.Value) + Fields!Job.Value

The Space() function will insert number of spaces in my case I had a Hierarchy field that was returned in the data set (0,1,2,3 etc.) for formating I chose a fixed value of 5 spaces * the Job Level and it gave me a nice indented list (with a period prefix)
0
 
Chris LuttrellSenior Database ArchitectCommented:
Auric, I tried your code to see if it was behaving different than mine but it still collapses all the spaces down to 1 space in html output.  Looks ok in PDF although it appears to have used 1 tab insted of each set of indents for some reason.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now