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 :
Finance | Project Operations, Human Resources, ...
Answered

SSRS Report Design Format issue

(0) ShareShare
ReportReport
Posted on by 10

I have a Report Table that has data in the following format. 

Plant Charge Code Value Bit 
Plant 1 AB

100

1

Plant 1 AC 200 1
Plant 2 AB 300 1
Plant 2 AC

10

1

Plant 1 Other 1

450

0

Plant 1 Other 2

550

0

Plant 2 Other 1

78

0

Plant 2 Other 2

45

0

I want my SSRS report data to display data in the following format

Plant AB AC Other Charge Code Other Charge Code Value Other Charge Code Other Charge Code Value
Plant 1 100 200 Other 1 450 Other 2 550
Plant 2 300 10 Other 1 78 Other 2 45

Please note that I have a Bit column in my data table on the basis of which I have to transpose the resultant table. For charge codes with Bit = 1, I want the Charge code in the column header and its value under that. For charge codes with bit = 0, I want the Charge code to be display in Column Other Charge Code and their Values in different column Other Charge Code. It will be expanding like this for all charge codes whose bit = 0.

Please suggest how it can be possible in the SSRS report design. Or do I need to write code in the Report DP class to cater this. 

Thanks

I have the same question (0)
  • Suggested answer
    greengrimms Profile Picture
    1,400 on at

    Hi,

    You can add the logic in your report design. You'll have to select the column/s where you want to apply this logic, right click on Expression, and add your logic in VB code. For example, select the "Other Charge Code" column and add as follows:

    IIF(Fields!Bit.Value = 0, Fields!ChargeCode.Value, 0)

    Let me know if that helps.

  • Verified answer
    Hassan Akhtar Khan Profile Picture
    240 on at

    No need to add code in RDP class, you can easily achieve this output by using matrix in SSRS report.

    Perform following steps in the design of your SSRS report:

    1. Add a matrix with this dataset.

    2. Use 'Plant' as row group.

    3. Add a column group with 'ChargeCode' as group expression which will automatically set for heading too and then use the 'Value' as value. Apply filter in the column group for (Bit = 1). This group will expand with only charge codes with Bit = 1 and show their values.

    4. Add another column group on the right using the same expression 'ChargeCode' as group expression and 'Value' as value except this time apply filter of (Bit = 0) in the group. So this will expand for only charge codes with Bit = 0.

    5. Add one more column inside the second column group to the left and use 'ChargeCode' expression as the value of that column. Now your second column group will expand for every charge code with Bit = 0 and will show two columns; one with the name of the charge code and another with its value according to the plant.

    6. In the end just hard code your desired headings (i.e. 'Other Charge Code' and. 'Other Charge Code Value') in both the columns of second column group so it will repeat the same header for every charge code.

    Following these steps will transform your sample data into the desired output.

  • F3D365Report Profile Picture
    10 on at

    Thanks, @Hassan for providing the solution.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans