Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

journal number not passed to the report parameter

Posted on by 95

I've create 2 ssrs reports one for puch and one for sales to print the voucher from

LedgerTransVoucher form

so i create a buttom in in the form with cliced method

void clicked()

{

MenuFunction SSRS_MyReport;

   Args Args;

   str journalid ="";

      Switch (GeneralJournalEntry.JournalCategory)

    {

     case  LedgerTransType::Purch:

     SSRS_MyReport = new MenuFunction(menuItemOutputStr(ForVendByDPPrintGenJoural),MenuItemType::Output);

     break;

     case LedgerTransType::Sales :

     SSRS_MyReport = new MenuFunction(menuItemOutputStr(ForCustByDPPrintGenJoural),MenuItemType::Output);

     break;

     default :

     break;

    }

   Args = new Args();

   journalid = "Dataset1_journalNumbar=" +GeneralJournalEntry.JournalNumber;  

   // Assign parameters to report

   Args.parm(journalid);

   // Run the report

   SSRS_MyReport.run(Args);

     super();

}

but the journal number not passed to the report parameter

is this good idea or there is preferable one and why the journal number not passed to the report parameter

i have to copy it and pest in the report

thanks

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: journal number not passed to the report parameter

    Your code is passing a parameter to a report controller, but if the report controller doesn't contain any logic to take this value and pass it to the contract object used by your report, nothing will happen. You could do it in preRunModifyContract(), for example.

    By the way, your 'default' case looks wrong to me - it would end up with a runtime exception, because SSRS_MyReport will be null and you're try to call a method (run()) on it.

    And please use Insert > Insert Code (in the rich formatting view) to paste source code. It makes code easier to read; e.g. because it preserves code indentation.

  • amr abdelaziz Profile Picture
    amr abdelaziz 95 on at
    RE: journal number not passed to the report parameter

    Hi George Baluta

    just that the journal number is not passed to the report parameter

  • George_D365 Profile Picture
    George_D365 on at
    RE: journal number not passed to the report parameter

    Hi amr abdelaziz,

    Are you getting any kind of error with this code or is it just that the journal number is not passed to the report parameter as you would expect it to?

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans