June 18, 2015 at 10:38 am
In report builder I am building up an invoice with an address with 6 lines plus a postcode. They are showing one field below the other on the report. However sometimes as you would expect an address line is empty.
How could I hide/ignore this field whilst at the same time shuffling the other lines up the page.
June 18, 2015 at 11:32 am
paul.farnell (6/18/2015)
In report builder I am building up an invoice with an address with 6 lines plus a postcode. They are showing one field below the other on the report. However sometimes as you would expect an address line is empty.How could I hide/ignore this field whilst at the same time shuffling the other lines up the page.
In the "Row Visibility" property: isNothing(Fields!<addressLineX>.Value)
Don Simpson
June 18, 2015 at 11:52 am
You could also correct the source if at all possible,
Here's an example using AdventureWorks2012
SELECT a.AddressID,
a.AddressLine1,
a.AddressLine2,
a.City,
sp.StateProvinceCode,
sp.CountryRegionCode,
sp.IsOnlyStateProvinceFlag,
a.PostalCode,
a.AddressLine1 + CHAR( 10)
+ ISNULL(a.AddressLine2 + CHAR( 10), '')
+ a.City + ', '
+ sp.StateProvinceCode
+ CASE WHEN sp.IsOnlyStateProvinceFlag = 0 THEN ', ' + sp.CountryRegionCode ELSE '' END + CHAR(10)
+ a.PostalCode AS FullAddress
FROM AdventureWorks2012.Person.Address a
JOIN AdventureWorks2012.Person.StateProvince sp ON a.StateProvinceID = sp.StateProvinceID;
June 19, 2015 at 9:33 am
Luis Cazares (6/18/2015)
You could also correct the source if at all possible,Here's an example using AdventureWorks2012
SELECT a.AddressID,
a.AddressLine1,
a.AddressLine2,
a.City,
sp.StateProvinceCode,
sp.CountryRegionCode,
sp.IsOnlyStateProvinceFlag,
a.PostalCode,
a.AddressLine1 + CHAR( 10)
+ ISNULL(a.AddressLine2 + CHAR( 10), '')
+ a.City + ', '
+ sp.StateProvinceCode
+ CASE WHEN sp.IsOnlyStateProvinceFlag = 0 THEN ', ' + sp.CountryRegionCode ELSE '' END + CHAR(10)
+ a.PostalCode AS FullAddress
FROM AdventureWorks2012.Person.Address a
JOIN AdventureWorks2012.Person.StateProvince sp ON a.StateProvinceID = sp.StateProvinceID;
Yes, you could I guess, but I really don't like handling presentation logic in SQL when you have a tool like SSRS or Crystal. Maybe if you were pushing data out to a text based Perl report or something like that.
Don Simpson
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply