Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

custom sort by given parameter

(0) ShareShare
ReportReport
Posted on by 40

how to Custom sort by given parameter in ssrs query based report

I Want  to add custom sorting in givent account number sequence  

  • Martin Dráb Profile Picture
    232,930 Most Valuable Professional on at
    RE: custom sort by given parameter

    It's not clear what problem you're dealing with, therefore let me give you a generic answer. Here is an introduction from AX documentation: How to: Use a Report Data Provider Class in a Report.

  • asadfaiq Profile Picture
    40 on at
    RE: custom sort by given parameter

    can you help me how its done please...help

  • Martin Dráb Profile Picture
    232,930 Most Valuable Professional on at
    RE: custom sort by given parameter

    How different should it be? Why exactly did you reject the solution suggested above?

  • asadfaiq Profile Picture
    40 on at
    RE: custom sort by given parameter

    any other idea? anyone have?

  • asadfaiq Profile Picture
    40 on at
    RE: custom sort by given parameter

    Yes logically its unsorted, but as per users entry it is sorted, as i already have a store procedure that meets the requirement but the report is non ax, as i want to make a report in ax ...  I am copy sharing with you the the SP.

    ALTER PROC [dbo].[LoyaltyCardPrint] @Cardno VARCHAR(MAX)

    AS DECLARE @vCardno VARCHAR(MAX) = ISNULL(@Cardno,'')

    SELECT  PAR.NAME,LOC.ADDRESS

    ,cci.CARDNUMBER,

    ISNULL(PH.LOCATOR,'') [Phone]

    ,ISNULL(EM.LOCATOR,'') Email,SPL.idx

    , ct.ACCOUNTNUM SL_LOYALTYACCOUNTNUM

    FROM CFZ_CUSTOMERCARDINFORMATION CCI

    inner join CUSTTABLE CT

    on CCI.ACCOUNTNUM = CT.ACCOUNTNUM

    and CCI.DATAAREAID = ct.DATAAREAID

    LEFT JOIN DIRPARTYTABLE PAR ON ct.PARTY = PAR.RECID

    LEFT JOIN DIRPARTYPOSTALADDRESSVIEW LOC ON PAR.PRIMARYADDRESSLOCATION = LOC.LOCATION and LOC.VALIDTO >= '2154-12-31 23:59:59.000'

    LEFT JOIN LOGISTICSELECTRONICADDRESS PH ON PAR.PRIMARYCONTACTPHONE = PH.RECID

    LEFT JOIN LOGISTICSELECTRONICADDRESS EM ON PAR.PRIMARYCONTACTEMAIL = EM.RECID

    LEFT JOIN   dbo.fn_split(dbo.CleanAndTrim(@vCardno),',') SPL ON SPL.value = CCI.CARDNUMBER

    WHERE cci.CARDNUMBER IN(SELECT VALUE FROM dbo.fn_split(dbo.CleanAndTrim(@vCardno),','))

    ORDER BY SPL.idx

    Therefore, As you can see here i am ordering it by user's input via storeprocedure.

    SELECT VALUE FROM dbo.fn_split(dbo.CleanAndTrim(@vCardno),','))

    ORDER BY SPL.idx

  • asadfaiq Profile Picture
    40 on at
    RE: custom sort by given parameter

    Is it possible in visual studio (report design)?

  • Martin Dráb Profile Picture
    232,930 Most Valuable Professional on at
    RE: custom sort by given parameter

    That doesn't look possible to me. The data is not sorted.

    As a workaround, you can use an RDP class, put data into a temporary table and add extra field for the order. E.g. when you parse the input list and find that "6" is on the second position, you'll put 2 to the field. When running the report, you'll simply sort by this field.

  • asadfaiq Profile Picture
    40 on at
    RE: custom sort by given parameter

    I have card number as a parameter and every card number has account number so

    for eg if someone enter "1","6","2" as a parameter(card number) so it result will be

    1 => 123

    6 => 589

    2 => 160

  • Martin Dráb Profile Picture
    232,930 Most Valuable Professional on at
    RE: custom sort by given parameter

    What do you mean by "custom"?

    If something defined as a customization, you can do it in the query definition.

    If you mean sorting defined by users before running the report, there is a tab called "Sorting" in the query dialog (the dialog where you can set query ranges).

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,157 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,930 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans