Hi master..
I have custom report with SSRS Report use class Contract, UI Builder and Data Provider.
in class Contract, i have parameter with enum type.
in ssrs report, i create 2 design with name 'TransDesign01' and 'TransDesign02'.
i want, if i run this report and in parameter i choose 'Buy' in enum type, report will run with output 'TransDesign01'.
and if i choose 'Sell' in enum type, report will run with output 'TransDesign02'.
Can i do it use class Controller? and How?
Thanks all..
*This post is locked for comments
Hi try this out:
public static void main(Args _args) { PIL_ReksaDana_Controller controller = new PIL_ReksaDanaTransaction_Controller(); PIL_ReksaDana_Contract contract; controller.parmArgs(_args); //this sets your default report - it can be either be your Design_PIL_Reksadana1 //or Design_PIL_Reksadana2 controller.parmReportName(ssrsReportStr(PIL_Report, Design_PIL_Reksadana1)); contract = controller.parmReportContract().parmRdpContract(); if (contract.paramTransType()) { controller.parmReportName(ssrsReportStr(PIL_Report, Design_PIL_Reksadana1)); } else { controller.parmReportName(ssrsReportStr(PIL_Report,Design_PIL_Reksadana2)); } controller.startOperation(); }
Thanks Tatiana,
But, i don't understand your code.
Can you explain to me?
Sorry for late respond.
i try your code like this in main method class controller :
public static void main(Args _args)
{
PIL_ReksaDana_Controller controller = new PIL_ReksaDanaTransaction_Controller();
PIL_ReksaDana_Contract contract;
controller.parmArgs(_args);
contract = controller.parmReportContract().parmRdpContract();
if (contract.paramTransType())
{
controller.parmReportName(ssrsReportStr(PIL_Report, Design_PIL_Reksadana1));
}
else
{
controller.parmReportName(ssrsReportStr(PIL_Report,Design_PIL_Reksadana2));
}
controller.startOperation();
}
and then i create menu item for Object Type 'Class' and Object 'PIL_ReksaDana_Controller'
And then i open this menu item, But i get error 'Report name is not set. Please set report name using parmReportName method.'.
Please help, Thanks.
you need to do it in the main method in the controller:
Create a switch:
Use the _args to get your enum value.
switch (_args.dataset())
{
case tableNum(InventTransferTable):
SalesConfirmController::ccc_mainTransfer(_args);
break;
default:
SalesConfirmController::ccc_mainSales(_args);
IN the CCC_MainTransfer method call the report design
if(curext() == #ccc)
{
controller.parmReportName(ssrsReportStr(SalesOrderAcknowledgementReport, Report));
}
else if (curext() == #cce)
{
controller.parmReportName(ssrsReportStr(SalesOrderAcknowledgementReport, CCE_TransferReport));
}
And that it.
If you need more help let me know.
You can try this in the main method of your controller
public static void main(Args _args) { yourController = new yourController(); yourController.parmArgs(_args); yourDPContract contract = yourController.parmReportContract().parmRdpContract();
if (contract.parmBuyEnum()) { yourController.parmReportName(ssrsReportStr(ReportName, TransDesign01)); } else { yourController.parmReportName(ssrsReportStr(ReportName, TransDesign02)); } yourController.startOperation(); }
Mohamed Amine Mahmoudi
100
Super User 2025 Season 1
Community Member
48
Zain Mehmood
6
Moderator