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
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.
Hi George Baluta
just that the journal number is 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?
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156