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)

How to pass the default value to parameter in SSRS report in AX 2012?

(0) ShareShare
ReportReport
Posted on by 865

I develop 1 SSRS report in AX 2012, in that report I am using two parameter such as Start date and End Date.. My report is working finely. now I want to pass some default date value to the Start Date and End date parameter. My default date value which is to passed on parameter is coming from display mehod.

 

in the properties of the that parameter I set default values as my display method, it is working in finely in Visual Studio, but when I deployed that report in AX and if I open that report through AX then that default value is not coming to the parameter...

If any one know on this then please let me know..

*This post is locked for comments

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

    Hi Akshay,

    I assume you are using RDP classes. You can try modify the data contract by overriding the SysReportRunController.preRunModifyContract() method. Assign the default values to start date and end date parameters there.

  • Akshay Bankar Profile Picture
    865 on at

    Hi dolee,

    Thanks for your reply..

    I develop this report by using query. So, how can I do this query based report

  • dolee Profile Picture
    11,279 on at

    Actually, I'd suggest turn it into a RDP implementation. Any reason not to do that?

  • Akshay Bankar Profile Picture
    865 on at

    I am using multiple tables in my report and I don't know that how can we use multiple tables and relations in RDP class.

    Can you please guide me for the same..

  • Jimmy Liu Profile Picture
    105 on at

    Hi Akshay,

    Couple of things to check :

    1. When you were talking your date parameters, are they date effectivity parameters?

    2. How did you bind your parameter default value to your display method?

    If possible, could you provide your report sample?

  • Suggested answer
    dolee Profile Picture
    11,279 on at

    "I am using multiple tables in my report and I don't know that how can we use multiple tables and relations in RDP class.

    Can you please guide me for the same.."

    One of the advantage of using a RDP data source for SSRS report is that we are allow to do all the manipulation we want under X++ coding environment. The final output will be a temp table (can be multiple temp tables if needed.)

    Check below links on how to use RDP:

    msdn.microsoft.com/.../gg731917.aspx

    msdn.microsoft.com/.../gg724119.aspx (A walkthrough on MSDN)

    Cheers.

  • Community Member Profile Picture
    on at

    //RDP Class

    //class Dectration

    [ SRSReportQueryAttribute (querystr(ProductInformationQry)),

    SRSReportParameterAttribute(classstr(MZNARProductInformationContract))]

    class MZNARProductInformation extends SRSReportDataProviderBase

    {

       ProductInformationTable productInformationTable;

       ToDate todate;

       FromDate fromdate;

    }

    // Temparory Table Buffer

    [SRSReportDataSetAttribute(tableStr(ProductInformationTable))]

    public productInformationTable getproductInformationTable ()

    {

    select * from productInformationTable;

    return productInformationTable;

    }

    // inerst values method

    private void inserttempmethod()

    {

     QueryRun queryRun = new QueryRun(this.parmQuery());

     InventTable         inventtable;

     InventTrans         inventtrans;

     InventTransOrigin   inventtransorigion;

     while (queryRun.next())

     {

           inventtable = queryRun.get(tableNum(InventTable));

            while select * from inventtrans

            join inventtransorigion

            where inventtransorigion.RecId == inventtrans.InventTransOrigin

            && inventtrans.ItemId == inventtable.ItemId

           && inventtrans.DateFinancial ==  mkDate(1,1,2011)

           && inventtrans.DateFinancial ==  mkDate(1,1,2011)

           && inventtrans.DatePhysical != dateNull()

             {

                productInformationTable.Name = inventtable.NameAlias;

                productInformationTable.CostAmount = inventTrans.costValue();

                productInformationTable.Qty = inventTrans.Qty;

                productInformationTable.ItemId = inventTable.ItemId;

                productInformationTable.PhysicalDate = inventTrans.DatePhysical;

               productInformationTable.DateFinancial = inventTrans.DateFinancial;

                productInformationTable.StatusIssue = inventTrans.StatusIssue;

               // productInformationTable.ReferenceCategory = inventtransorigion.ReferenceCategory;

                productInformationTable.ReferenceId = inventtransorigion.ReferenceId;

                productInformationTable.StatusReceipt = inventTrans.StatusReceipt;

                productInformationTable.ReferenceId = inventtransorigion.ReferenceId;

                productInformationtable.insert();

             }

     }

    }

    // process report

    [SysEntryPointAttribute]

    public void processReport()

    {

       MZNARProductInformationContract   productinfoContract = new MZNARProductInformationContract();

       ;

       todate =  productinfoContract.todate();

       fromdate = productinfoContract.fromdate();

            this.inserttempmethod();

    }

    // Contract Class

    //class decleration

    [DataContractAttribute]

    public class MZNARProductInformationContract

    {

      ToDate DatePhysical;

      FromDate DateFinancial;

    }

    //todate method

    [

    DataMemberAttribute('DatePhysical'),

    SysOperationLabelAttribute(literalStr("To Date"))

    ]

    Public ToDate todate(ToDate _datePhysical = datePhysical)

    {

       datePhysical = _datePhysical ;

       return datePhysical;

    }

    //formdate method

    [

    DataMemberAttribute('DateFinancial'),

    SysOperationLabelAttribute(literalStr("From Date"))

    ]

    Public FromDate fromdate(FromDate _dateFinancial = dateFinancial)

    {

       dateFinancial = _dateFinancial ;

       return dateFinancial;

    }

    this is my code and  i want use to date and from date filter but this code does not working fine please tell me the solution of this problem.

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    In the processReport method, use this statement

    MZNARProductInformationContract   productinfoContract = this.parmDataContract() as MZNARProductInformationContract;


    instead of 

    MZNARProductInformationContract   productinfoContract = new MZNARProductInformationContract();


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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans