Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 blanking a row if one column is null

Author  Topic 

chris_wood99
Yak Posting Veteran

70 Posts

Posted - 2006-02-22 : 06:05:40
Hi,

I need to blank out all the numerical figures for a particular row from a financial report if the name column is blank. Can this be done using a format or expression to blank each cell, or even better the whole row.

Something like if [name.value] IsNull then display " ". tried to find it in the Reporting services BOL but find they are a bit thin on info.

Regards

Chris

jhermiz

3564 Posts

Posted - 2006-02-22 : 09:02:01
Use the Length function in RS.

Check if the Len() of the field > 0 if it is keep it else blank it out.

Very simple.


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]

RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url]
Go to Top of Page

chris_wood99
Yak Posting Veteran

70 Posts

Posted - 2006-02-23 : 07:12:28
The only thing that appears to be simple is me!

I'm new to RS and also to VB so i'm struggling a little..

on my report i have columns

ACCOUNT NAME ___ PRIOR YTD

so if the group for account name is empty i need to blank out the fields on the same row for the prior YTD cell, otherwise display the sum of the PRIOR YTD field. i've been trying to use this...

=IIf(len(ReportItems!Acc_name.Value)>0), " " & sum(Fields!PRIOR_YTD.Value), " "

getting the error

e:\rs2000sbs\workspace\finance\finance\MIR.rdl The value expression for the textbox ‘textbox120’ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

Go to Top of Page

jhermiz

3564 Posts

Posted - 2006-02-23 : 22:08:39
quote:
Originally posted by chris_wood99

The only thing that appears to be simple is me!

I'm new to RS and also to VB so i'm struggling a little..

on my report i have columns

ACCOUNT NAME ___ PRIOR YTD

so if the group for account name is empty i need to blank out the fields on the same row for the prior YTD cell, otherwise display the sum of the PRIOR YTD field. i've been trying to use this...

=IIf(len(ReportItems!Acc_name.Value)>0), " " & sum(Fields!PRIOR_YTD.Value), " "

getting the error

e:\rs2000sbs\workspace\finance\finance\MIR.rdl The value expression for the textbox ‘textbox120’ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.





Like this:

=IIf(LEN(ReportItems!Acc_name.Value)>0), SUM(Fields!PRIOR_YTD.Value), "")

Jon


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]

RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url]
Go to Top of Page

chris_wood99
Yak Posting Veteran

70 Posts

Posted - 2006-02-28 : 07:08:36
cheers jon,

this now achieves what I was aiming to do.. after a long weekend its nice to sort out something that was ruining my day last thursday!

Chris

p.s. was also missing a parenthesis at the start
Go to Top of Page
   

- Advertisement -