Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Get report parameters without displaying RunRequestpage to User

(0) ShareShare
ReportReport
Posted on by 505

Hi all, 
I have a scenario where I need to send a custom report as an attachment to numerous customers via email.

Is there a way to get the report parameter using only the SetTableView() procedure without showing the RunRequestpage to the user and let the user press OK.
I want to run this as a job Queue. 

Many thanks

  • Hein Kruger Profile Picture
    Hein Kruger 505 on at
    RE: Get report parameters without displaying RunRequestpage to User

    Hi Avinash,

    This is my solution.

    I used this link to get the Report Parameter

    docs.microsoft.com/.../reportinstance-runrequestpage-method

    The out put will be something like this

     '<?xml version="1.0" standalone="yes"?><ReportParameters name="Order Email" id="50118"><Options><Field name="NoOfCopies">0</Field><Field name="ShowInternalInfo">false</Field><Field name="LogInteraction">true</Field><Field name="ShowCorrectionLines">false</Field><Field name="ShowLotSN">false</Field><Field name="DisplayAssemblyInformation">false</Field></Options><DataItems><DataItem name="Incoming Order ">VERSION(1) SORTING(Field3,Field1) WHERE(Field43=1(%1),Field120=1(0))</DataItem><DataItem name="CopyLoop">VERSION(1) SORTING(Field1)</DataItem><DataItem name="PageLoop">VERSION(1) SORTING(Field1)</DataItem><DataItem name="DimensionLoop1">VERSION(1) SORTING(Field1)</DataItem><DataItem name="Incoming Order Line">VERSION(1) SORTING(Field3,Field4)</DataItem><DataItem name="DimensionLoop2">VERSION(1) SORTING(Field1)</DataItem><DataItem name="DisplayAsmInfo">VERSION(1) SORTING(Field1)</DataItem><DataItem name="Total">VERSION(1) SORTING(Field1)</DataItem><DataItem name="Total2">VERSION(1) SORTING(Field1)</DataItem><DataItem name="ItemTrackingLine">VERSION(1) SORTING(Field1)</DataItem><DataItem name="TotalItemTracking">VERSION(1) SORTING(Field1)</DataItem></DataItems></ReportParameters>';

    I added the Parameter as a Label to my code unit and replaced the filters that I want to use with StrSubstNo and passed that through as the parameter.  (Not the best method, but it does work.)

    Here is another reply I got from another forum.

    www.dynamicsuser.net/.../76232

    Hope it helps

  • Avinash B Profile Picture
    Avinash B 1,455 on at
    RE: Get report parameters without displaying RunRequestpage to User

    Hi Hein,

    Did you figure out any solution?

    I have a similar scenario  where I want to filter record before I call Report.RunRequestPage() and pass it to request page.

    How can I generate report request parameters through code and pass it to RunRequestPage function?

    Thanks,

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 74,115 Super User 2024 Season 2 on at
    RE: Get report parameters without displaying RunRequestpage to User

    Hi, How about using the Report.RunRequestPage([Text]) method?

    https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/report/reportinstance-runrequestpage-method

    Here are a few examples:

    https://yzhums.com/7200/

    https://yzhums.com/20030/

    Hope this will help.

    Thanks.

    ZHU

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans