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 AX (Archived)

SSRS Reports With parameters

(0) ShareShare
ReportReport
Posted on by 1,210

hi,

I have a report with parameters, I want to add a new parameter of type checkbox, and i also want to add date criteria i.e start date and end date, what i explore i find contract class for this purpose for adding parameters, but my question is that from where I'm relating a column name of sql with local variable. following is my function

//Declaration Method

 #define.ParameterInclReversed('IncludeReversed')
  NoYes includeReversed;

//===========================

Contract Class:

[
    DataMemberAttribute('IncludeReversed'),
    SysOperationLabelAttribute(literalstr("@SYS78625")),
    SysOperationHelpTextAttribute(literalstr("@SYS78627"))
]
public boolean parmIncludeReversed(boolean _includeReversed = includeReversed)
{
    includeReversed = _includeReversed;
    return includeReversed;
}

//================================

DP class:(where report is processing)

 if (contract.parmIncludeReversed())
    {
        includeReversed = NoYes::Yes;
    }

*This post is locked for comments

I have the same question (0)
  • dolee Profile Picture
    11,279 on at

    Hi,

    Base on my understanding of your question, you need to declare the table buffer/variable in your class.

    For example, in the DP class you'd want to do:

    -----------------------------

    DP class:

    MyTable    myTable; // Declare the table record buffer/variable

    ttsbegin;

    // You'd want to get the table buffer you want to update first.

    select firstonly forupdate myTable

      where myTable.recId == <recId of the target table>;

    if (contract.parmIncludeReversed())

    {

      myTable.includeReversed = NoYes::yes;

     myTable.update();

    }

    ttscommit;

    -----------------------------

    You might also want to add a try/catch blog as well, but it's another topic.

    Regards

  • Rachit Profile Picture
    4,015 User Group Leader on at

    Why would you like to relate a data contract parameter with an SQL column name?

    A data contract variables acts as an input/filters to drive your report. You might consider using a query in your data contract if you want to apply the filters on some table/field.

    Thanks,

    Rachit Garg

  • Ali Zaidi Profile Picture
    4,657 on at

    Extended data Type rendered  as check boxes, combo boxes or radio buttons. You can find these properties when you right click on extended data type of enum type, even enum also have these properties. based on these  properties you can render these extended data Types/ enum as check boxes, combo or radio button. For date time, you can use TransDate Extended data Type. Like as

    public class InventABCContract implements SysOperationValidatable

    {

    //  TransDate while used as

       TransDate       fromDate;

       TransDate       toDate;

       InterestPct     interest;

    // AbCModel Rendered as drop down on Report dialog

       ABCModel        abcModel;

    }

    Inside Data Provider class you can get these parameter with reference of Data Contract Class and then  query on Dynamics Ax tables like.

    InventABCContract   contract;

    SalesLine _salesLine;

       contract    = this.parmDataContract() as InventABCContract;

       inventABCUpdate.parmFromDate(contract.parmFromDate());

       inventABCUpdate.parmToDate(contract.parmToDate());

    SalesLine _salesLine;

       while select * from _salesLine

           where _salesLine.createdTransactionId  >= parmToDate()

           && _salesLine.createdTransactionId <<=contract.parmFromDate();

       {

       // populate temp table

       }

  • AliViretechnologies Profile Picture
    1,210 on at

    thankx, everybody its very helpful now I want to ask that I want drop down list for the financial dimension set   Fund_Dept-MainAccount  Beginning   101.20010.61010  Ending  101.20010.99999 what should i need to do.

    for testing purpose i was using in class declaration.

       //====Financial dimension fields.

        String30  bfinancialdim;

        String30  efinancialdim;

  • dolee Profile Picture
    11,279 on at

    Hi,

    - For Financial Dimension Set, you can refer to General Ledger -> Common -> Trial balance Listpage. On the List page there is a "Financial dimension set" combobox which filter financial dimension set for selection only.

    - I think 101.20010.xxxxx are main accounts? Then you just add two parameters, one for the minimum/starting main account and another one for maximum/ending main account?

    Regards

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 AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans