Report extension in two ways an event handler. Below is the example for the Customer base data report.
Step1. Duplicate the report and do the required changes.
Step2. Create an extension for the Report output MenuItem and output object to new report what we create in the step1.
Or
If the output menuItem assigned with controller class.
Step1. Duplicate the report and do the required changes.
Step2. Create an EventHandler or COC for the Controller class - getReportName() method.
Step3. In the event handler method, assign the new report to return in this method.
public static str getReportName(Args _args)
{
str reportName;
if (_args.menuItemName() == menuitemOutputStr(CustBasedata))
{
reportName = ssrsReportStr(CustBasedata, Report);
}
else if (_args.menuItemName() == menuitemOutputStr(CustListReport))
{
reportName = ssrsReportStr(CustListReport, Report);
}
else if (_args.menuItemName() == menuitemOutputStr(smmSalesCustItemStatistics))
{
reportName = ssrsReportStr(smmSalesCustItemStatistics, Report);
}
return reportName;
}
class smmReportController_EventHandler
{
/// <summary>
///
/// </summary>
/// <param name="args"></param>
[PostHandlerFor(classStr(smmReportsController), staticMethodStr(smmReportsController, getReportName))]
public static void smmReportsController_Post_getReportName(XppPrePostArgs args)
{
Str reportName;
smmReportsController reportsController = args.getThis();
Args argsLoc = args.getArg(identifierStr(_args));
//Args argsLoc = args.getArgNum(1);
if (argsLoc.menuItemName() == menuitemOutputStr(CustBasedata))
{
reportName = ssrsReportStr(CustBasedataTRG, Report);
}
args.setReturnValue(reportName);
}
}
Step1. Duplicate the report and do the required changes.
Step2. Create an extension for the Report output MenuItem and output object to new report what we create in the step1.
Or
If the output menuItem assigned with controller class.
Step1. Duplicate the report and do the required changes.
Step2. Create an EventHandler or COC for the Controller class - getReportName() method.
Step3. In the event handler method, assign the new report to return in this method.
public static str getReportName(Args _args)
{
str reportName;
if (_args.menuItemName() == menuitemOutputStr(CustBasedata))
{
reportName = ssrsReportStr(CustBasedata, Report);
}
else if (_args.menuItemName() == menuitemOutputStr(CustListReport))
{
reportName = ssrsReportStr(CustListReport, Report);
}
else if (_args.menuItemName() == menuitemOutputStr(smmSalesCustItemStatistics))
{
reportName = ssrsReportStr(smmSalesCustItemStatistics, Report);
}
return reportName;
}
class smmReportController_EventHandler
{
/// <summary>
///
/// </summary>
/// <param name="args"></param>
[PostHandlerFor(classStr(smmReportsController), staticMethodStr(smmReportsController, getReportName))]
public static void smmReportsController_Post_getReportName(XppPrePostArgs args)
{
Str reportName;
smmReportsController reportsController = args.getThis();
Args argsLoc = args.getArg(identifierStr(_args));
//Args argsLoc = args.getArgNum(1);
if (argsLoc.menuItemName() == menuitemOutputStr(CustBasedata))
{
reportName = ssrsReportStr(CustBasedataTRG, Report);
}
args.setReturnValue(reportName);
}
}
No comments:
Post a Comment
Give me the commetns and solutions