Hi,
Run a custom made SSRS Report via Form in Dynamics D365.
Here i gonna show WHSLoadListPalletManifest Report
Step 1: Create a Query with range of form arg parameter.
Step 2: Create DP Class WhsLoadListPalletManifestDP with above query
Step 3: Create a SSRS Report with DP Class
Step 4: Add new Button to Print SSRS from Loads form in Warehouse Management
output
Step 5: Add Event handler class for above button (WHSLoadPlanningListPageEvents)
class WHSLoadPlanningListPageEvents
{
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormControlEventHandler(formControlStr(WHSLoadPlanningListPage, SHYAM_WHSPalletManifest), FormControlEventType::Clicked)]
public static void SHYAM_WHSPalletManifest_OnClicked(FormControl sender, FormControlEventArgs e)
{
FormDataSource WHSLoadTableDS;
WHSLoadTable wHSLoadTable;
WHSLoadTableDS = sender.formRun().dataSource();
wHSLoadTable = WHSLoadTableDS.cursor() as wHSLoadTable;
Args args = new args(ssrsReportStr(SHYAM_WhsLoadListPalletManifestReport, Report));
args.caller(sender.formRun());
args.menuItemType(MenuItemType::Display);
args.menuItemName(menuItemDisplayStr(WHSLoadPlanningListPage));
args.record(wHSLoadTable);
args.parm(wHSLoadTable.LoadId);
SHYAM_WHSLoadListController srsReportRun = new SHYAM_WHSLoadListController();
srsReportRun.parmReportName(ssrsReportStr(SHYAM_WhsLoadListPalletManifestReport, Report));
srsReportRun.parmArgs(args);
srsReportRun.parmShowDialog(false);
srsReportRun.startOperation();
}
}
Run a custom made SSRS Report via Form in Dynamics D365.
Here i gonna show WHSLoadListPalletManifest Report
Step 1: Create a Query with range of form arg parameter.
Step 2: Create DP Class WhsLoadListPalletManifestDP with above query
Step 3: Create a SSRS Report with DP Class
Step 4: Add new Button to Print SSRS from Loads form in Warehouse Management
output
Step 5: Add Event handler class for above button (WHSLoadPlanningListPageEvents)
class WHSLoadPlanningListPageEvents
{
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormControlEventHandler(formControlStr(WHSLoadPlanningListPage, SHYAM_WHSPalletManifest), FormControlEventType::Clicked)]
public static void SHYAM_WHSPalletManifest_OnClicked(FormControl sender, FormControlEventArgs e)
{
FormDataSource WHSLoadTableDS;
WHSLoadTable wHSLoadTable;
WHSLoadTableDS = sender.formRun().dataSource();
wHSLoadTable = WHSLoadTableDS.cursor() as wHSLoadTable;
Args args = new args(ssrsReportStr(SHYAM_WhsLoadListPalletManifestReport, Report));
args.caller(sender.formRun());
args.menuItemType(MenuItemType::Display);
args.menuItemName(menuItemDisplayStr(WHSLoadPlanningListPage));
args.record(wHSLoadTable);
args.parm(wHSLoadTable.LoadId);
SHYAM_WHSLoadListController srsReportRun = new SHYAM_WHSLoadListController();
srsReportRun.parmReportName(ssrsReportStr(SHYAM_WhsLoadListPalletManifestReport, Report));
srsReportRun.parmArgs(args);
srsReportRun.parmShowDialog(false);
srsReportRun.startOperation();
}
}
Step 6:Add a Controller Class to call SSRS report
class SHYAM_WHSLoadListController extends SrsReportRunController
{
/// <summary>
/// The <c>WHSLoadListController</c> class is used to run print management of the <c>WHSLoadList</c> report.
/// </summary>
protected void preRunModifyContract()
{
this.setRanges();
}
private void setRanges()
{
Query q;
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
WHSLoadTable loadTable;
q = this.getFirstQuery();
queryBuildDataSource = SysQuery::findOrCreateDataSource(q, tableNum(WHSLoadTable));
queryBuildRange = SysQuery::findOrCreateRange(queryBuildDataSource, fieldNum(WHSLoadTable, LoadId));
if (this.parmArgs().parm())
{
queryBuildRange.value(queryValue(this.parmArgs().parm()));
}
else if (this.parmArgs().record() && this.parmArgs().dataset() == tableNum(WHSLoadTable))
{
loadTable = this.parmArgs().record();
queryBuildRange.value(loadTable.LoadId);
}
}
}
Atempfeche-zu-Topeka Amy Turner https://wakelet.com/wake/gwVssbrtTGnu1scp4Jwxj
ReplyDeleteabanoscon
How did you manage this error "An attempt was made to set a report parameter 'WHSLoadListDP_DynamicParameter' that is not defined in this report." ?
ReplyDelete