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, ...
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  

I have the same question (0)
  • Martin Dráb Profile Picture
    237,985 Most Valuable Professional on at

    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).

  • asadfaiq Profile Picture
    40 on at

    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
    237,985 Most Valuable Professional on at

    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

    Is it possible in visual studio (report design)?

  • asadfaiq Profile Picture
    40 on at

    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

    any other idea? anyone have?

  • Martin Dráb Profile Picture
    237,985 Most Valuable Professional on at

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

  • asadfaiq Profile Picture
    40 on at

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

  • Martin Dráb Profile Picture
    237,985 Most Valuable Professional on at

    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.

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
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans