web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Formatting address box in report

(0) ShareShare
ReportReport
Posted on by

Hi all,

I need to add an address box to a delivery note report in CRM online, using fetxh XML and visual studio (BIDS). Basically the issue I have is empty address fields and formatting the box to show the address in one block ignoring the empty lines (such as address line 1 and 2 is filled but 3 is blank, but on other addresses its filled in also).

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aileen Gusni Profile Picture
    44,524 on at

    Hi Paul,

    If you use the SQL that it would be easier in select query you can manipulate using STUFF and Coalesce.

    To construct the address field, you need o construct each individual fields because you cannot use address1_composite field, it gives blank value on its value.

    But, if you are using Fetch XML,

    I think there are three options :

    You create a table with total row for your individual address field, for example you have:

    ROW 1     address1_line1

    ROW 2     address1_line2

    ROW 3     address1_line3

    ROW 4     address1_city

    ROW 5     address1_stateorprovince

    ROW 6     address1_postalcode

    ROW 7     address1_county

    ROW 8     address1_COUNTRY

    Then you can set the visibility using ISNOTHING or using = ""

    Example:

    stackoverflow.com/.../hiding-rows-that-contain-no-values

    Or

    =IIF(IsNothing(Fields!address1_line1.Value),True,False)

    =IIF(IsNothing(Fields!address1_line2.Value),True,False)

    Set them for each row value visibility.

    I think it is the best way.

    Second way, you can use long IIF to have concept:

    If address 2 no value then concatenate address1_line1, address1_line3 and so on until country, (using concatenation &)

    www.earniepost.info/.../expression-concatenation.aspx

    and I use comma separator (I give example only until address1_city, because too long)

    =IIF(IsNothing(Fields!address1_line2.Value), Fields!address1_line1 & "," & Fields!address1_line3 & "," & Fields!address1_city,    

    Fields!address1_line1 & "," & Fields!address1_line2 & "," & Fields!address1_line3 & "," & Fields!address1_city

    and you also need to give condition if address 3 no value, or if state no value or county no value (long if you need)

    You can keep them in the split fields as well.

    For example you have 3 fields:

    1. If address1_line1 no value

    2. If address1_line2 no value

    3. If address1_line3 no value

    Then concatenate them together.

    Third, you can also use Switch I think.

    Example:

    social.msdn.microsoft.com/.../is-there-a-coalesce-function-in-reporting-service-2005

    And another example, I haven't tried:

    Using Join

    social.msdn.microsoft.com/.../ssrs-concatenate-field-in-one-string-delimited-by-comma-without-sql

    I recommend the first way actually.

    I hope this can help you.

    Thank you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans