Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

How to use SSRS to format financial report using non-sequential account order Expand / Collapse
Posted Friday, May 16, 2014 7:55 AM


Group: General Forum Members
Last Login: Friday, July 22, 2016 2:02 PM
Points: 14, Visits: 117
I am new to SSRS 2012 and am trying to create several financial reports (trial balance, profit & loss, balance sheet, etc.).
Our general ledger account numbers are in the ###-###-### format (i.e 481-389-810)

The problem I am having is that the finance dept wants the P&L report in a specific format using groups/headings and with the GL accounts appearing in a non-sequential order.

See example in attached image file that shows GL Account Description, GL Account Number, Company Number fields

How do I get SSRS to use, display and keep the non-sequential order?

Example 1 using simplified account numbers:

Account# Description
100 Truck Repairs
150 Rail Repairs
120 Warehouse Inventory
110 Auto Repairs
160 Property Maintenance

I am assuming others have had a similar problem and possible solution(s). I would appreciate any assistance in resolving this issue.

  Post Attachments 
GL PL Acct Structure.jpg (19 views, 141.25 KB)
Post #1571732
Posted Friday, May 16, 2014 11:32 PM


Group: General Forum Members
Last Login: Today @ 9:55 AM
Points: 1,988, Visits: 11,524
SSRS will use the same sort order as the query/stored procedure you base the report on, so if you have the data sorted in your stored procedure, you're all set.

If that doesn't help, we may need more information - like what are the rules for sorting?
Post #1571967
Posted Saturday, May 17, 2014 8:04 AM



Group: General Forum Members
Last Login: Today @ 3:02 AM
Points: 23,264, Visits: 37,163
Here is what I would do.

I would create a table that lists the accounts that must be in a specific order with a sequence number for the order that that the accounts need to be displayed. I would then join to this table using an left outer join. Where the sequence number is null substitute some default value (use ISNULL or COALESCE to accomplish this) then the query sorts on the sequence number first then the account number.

Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1571996
Posted Tuesday, May 20, 2014 12:44 PM


Group: General Forum Members
Last Login: Friday, July 22, 2016 2:02 PM
Points: 14, Visits: 117
I have the report now sorting the accounts in the correct order that the users want. Now my problem is getting SSRS to be able to incorporate the correct financial statement headings and subheadings (text).

The report output/preview looks like attached image file: IS-Bal Statement. I can't figure out how to get the headings and subheadings to work in the report like attached image file Statement Labels - see items in red/bold.

I think that I may need to use some kind of IIF expression but not sure. If I do, then do I need to create some expression for each heading/subheading?

Can anyone point me in the right direction to make this work?


  Post Attachments 
IS-Bal Statement.jpg (30 views, 379.08 KB)
Statement Labels.jpg (33 views, 143.56 KB)
Post #1572841
Posted Tuesday, May 20, 2014 1:16 PM



Group: General Forum Members
Last Login: Today @ 1:02 AM
Points: 2,155, Visits: 7,545
You need to include the headings/subheadings in the data and group the report by them.


select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);

  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw
  • Post #1572858
    Posted Friday, June 27, 2014 5:59 PM

    SSC Eights!

    SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

    Group: General Forum Members
    Last Login: Yesterday @ 5:37 PM
    Points: 805, Visits: 1,606
    Start by right clicking the detail row and select to add a parent group. In the popup dialogue you select the column to group by and if you want to include a header.
    Post #1587076
    « Prev Topic | Next Topic »

    Add to briefcase

    Permissions Expand / Collapse