Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Hiding Query Parameters in AX 2012 SSRS Report Dialog

Posted on by

Hi,

I want to hide the dynamic query parameters in a AX 2012 SSRS report dialog.

The report datasource is a query, which has a  few predefined ranges. But in the report dialog, I just want to see the printer select box and not the query range fields with their predefined values. I set the status of the query ranges to hide, but ist had no effect on the dialog.

Is it possible to hide all the parameters at once for the report dialog?

Thx, Markus     

  • venkatesh vadlamani Profile Picture
    venkatesh vadlamani 3,180 on at
    RE: Hiding Query Parameters in AX 2012 SSRS Report Dialog

    Hi ,

    There is a reason why controller is needed in query based reports to update the dialog query.

    Just take an example where you have a set of users who can view list of vendors and not their open transactions, and few other users who can view both.

    Its impossible to secure the report in such a scenario with your approach.

    Controller gives you flexibility to transfer the information from form to report without undermining the object based security.

    I understand your need for simplicity and ease of getting things done , but there is a reason why patterns are followed in report development. I agree that your approach will work but when security is a concern it cannot be used.

    I was only confused why do you need a menu item button since you are not pointing to any menu item in its properties. Directly overriding the click event implementation can be achieved in normal button.

  • Joanna Demetriou Profile Picture
    Joanna Demetriou 355 on at
    RE: Hiding Query Parameters in AX 2012 SSRS Report Dialog

    Hi venkatesh

    Here's example:

    I create a custom query-based SSRS report to display the vendor info.

    I add it as a menu item button on the Vendor form.

    Obviously, when the button in clicked I want to pass the Vendor's Account Num as a range on my report as it should display the info for the specific vendor I have selected.

    I do that as shown below:

    void clicked()

    {

       SRSReportRun    srsReportRun = new SRSReportRun(ssrsReportStr(myVendorInfo_SRS, PrecisionDesign1));

       ;

       //init report run

       if(srsReportRun.init())

       {

    //reset the query so that any previously set ranges are gone
    srsReportRun.resetQueries();

    //set value for parameter "Printing Date" to today
    srsReportRun.reportParameter(identifierStr(PrintingDate)).value(systemDateGet());

    //set range on vendor Account num
    SysQuery::findOrCreateRange(srsReportRun.reportQuery("").datasourceTable(tableNum(VendTable)), fieldNum(VendTable, AccountNum)).value(VendTable.AccountNum);

    //run report
    srsReportRun.run();

       }

    else

    warning("Report could not be executed. Please contact your system administrator");

    }

  • venkatesh vadlamani Profile Picture
    venkatesh vadlamani 3,180 on at
    RE: Hiding Query Parameters in AX 2012 SSRS Report Dialog

    Need to understand that i am not validating any requirement.

    Question was for query based report where dialog query needs to be hidden from the user.

    The thing you mentioned about writing the logic in menu item button , could you share if you have any example as such,

  • Joanna Demetriou Profile Picture
    Joanna Demetriou 355 on at
    RE: Hiding Query Parameters in AX 2012 SSRS Report Dialog

    That's the whole purpose of a query based report! That you don't need to create any classes, temporary tables or any other objects..

    We are trying to minimize the work required for a simple report.

    In the click method of the menu item button we just add a range to the report's query. As simple as that. I don't see where your surprise comes from.

    The suggested approach to hide the query from the user simply makes the report non-usable. How often is it that you need to run a report that doesn't apply any filtering what so ever?

  • Joanna Demetriou Profile Picture
    Joanna Demetriou 355 on at
    RE: Hiding Query Parameters in AX 2012 SSRS Report Dialog

    That's the whole purpose of a query based report! That you don't need to create any classes, temporary tables or any other objects.

    We are trying to minimize the work required for a simple report.

    In the click method of the menu item button we just add a range to the report's query. As simple as that. I don't see where your surprise comes from.

    The suggested approach to hide the query from the user simply makes the report non-usable. How often is it that you need to run a report that doesn't apply any filtering what so ever?

  • venkatesh vadlamani Profile Picture
    venkatesh vadlamani 3,180 on at
    RE: Hiding Query Parameters in AX 2012 SSRS Report Dialog

    How do you plan to use the query from x++ code when you have a query based report and you are reluctant to write a controller?

    Making query invisible to user is already explained, create a controller and override the showQueryValues method in the initial reply, please browse the initial replies.

    For other queries please use a different thread

  • Joanna Demetriou Profile Picture
    Joanna Demetriou 355 on at
    RE: Hiding Query Parameters in AX 2012 SSRS Report Dialog

    It seems that setting the "Dynamic Filters" option to False is not really the solution..

    Doing so the query object cannot be accessed at all in X++ code.

    The opposite doesn't seem to work either: If we set the "Dynamic Filters" option to True and try to make the query/query run non-interactive on the AX side doesn't seem to have any effect when running the report.

    What we need a solution that:

    - Makes the query options invisible to the user (Select button and query values)

    - The query can be updated in X++ code (e.g. set a range)

    I believe this is a typical scenario and there must be a sufficient way to achieve.. (e.g. print a report for a Vendor. The Vendor's account num must be set as a range)

    Expecting your feedback.

    Thanks

    Joanna

  • Suggested answer
    nagaraj Profile Picture
    nagaraj 2,340 on at
    RE: Hiding Query Parameters in AX 2012 SSRS Report Dialog

    you can set Datset properties > Dynamic filters = false in visual studio.

  • nagaraj Profile Picture
    nagaraj 2,340 on at
    RE: Hiding Query Parameters in AX 2012 SSRS Report Dialog

    Thank you Venkatesh, it is working fine.

  • venkatesh vadlamani Profile Picture
    venkatesh vadlamani 3,180 on at
    RE: Hiding Query Parameters in AX 2012 SSRS Report Dialog

    Allow dynamic filtering false and remove the dynamic parameter. redeploy the report and refresh the user cache.

    This should do

Helpful resources

Quick Links

Can you answer this forum question?

You could make someone's day!

Community Newsletter - May 2024

Kudos to our community stars!

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283,632 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 224,528 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Featured topics

Product updates

Dynamics 365 release plans