RDP Parameter using x++ :
TECInsuranceClaim
void clicked()
{
SrsReportRunController reportRunController;
Map queryContracts;
MapEnumerator mapEnum;
Query query;
QueryBuildRange range;
SrsReportDataContract contract;
TECInsuranceClaimContract rdpContract;
;
if (TECInsuranceClaimTable.TECInsuranceClaimId)
{
reportRunController = new SrsReportRunController();
reportRunController.parmReportName(ssrsReportStr(TECInsuranceClaim, PrecisionDesign1));
reportRunController.parmLoadFromSysLastValue(false);
// Set printer settings (print to file, format, filename, etc).
contract = reportRunController.parmReportContract();
// Use our custom-defined report contract class
rdpContract = contract.parmRdpContract() as TECInsuranceClaimContract;
//rdpContract.parmToDate(systemDateGet());
//rdpContract.parmIncludeVendorsWithoutTransactions(true);
queryContracts = contract.parmQueryContracts();
mapEnum = queryContracts.getEnumerator();
while(mapEnum.moveNext())
{
query = mapEnum.currentValue();
range = SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInsuranceClaimTable)),fieldNum(TECInsuranceClaimTable, TECInsuranceClaimId));
range.value(queryValue(TECInsuranceClaimTable.TECInsuranceClaimId));
}
reportRunController.runReport();
}
}
PAKAI FORM DIALOG
public void closeOk()
{
SrsReportRunController reportRunController;
Map queryContracts;
MapEnumerator mapEnum;
Query query;
QueryBuildRange range;
SrsReportDataContract contract;
TECScrapReportContract rdpContract;
JournalNameId ScraptReworkJournalNameId;
reportRunController = new SrsReportRunController();
reportRunController.parmReportName(ssrsReportStr(TECScrapReport, Report));
reportRunController.parmLoadFromSysLastValue(false);
// Set printer settings (print to file, format, filename, etc).
contract = reportRunController.parmReportContract();
// Use our custom-defined report contract class
rdpContract = contract.parmRdpContract() as TECScrapReportContract;
rdpContract.parmFromDate(FromDate.dateValue());
rdpContract.parmToDate(todate.dateValue());
rdpContract.parmSite(Site.valueStr());
rdpContract.parmWareHouse(Warehouse.valueStr());
rdpContract.parmJournalNameId(ScrapType.valueStr()); // Add by Tyo
if(ScrapType.text() == "Scrap")
{
rdpContract.parmScrapType(TECScrapType::Scrap); // Add by cTyo
}
else
{
rdpContract.parmScrapType(TECScrapType::Rework); // Add by cTyo
}
queryContracts = contract.parmQueryContracts();
mapEnum = queryContracts.getEnumerator();
if(ScrapType.valueStr() == enum2Value(TECScrapType::Scrap))
ScraptReworkJournalNameId = InventParameters::find().TECScrapJournalName;
else
ScraptReworkJournalNameId = InventParameters::find().TECReworkJournalName;
while(mapEnum.moveNext())
{
query = mapEnum.currentValue();
SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInventJournalTransDim)),fieldNum(TECInventJournalTransDim, JournalNameId)).value(ScraptReworkJournalNameId);
SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInventJournalTransDim)),fieldNum(TECInventJournalTransDim, TransDate)).value(queryRange(FromDate.dateValue(), todate.dateValue()));
SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInventJournalTransDim)),fieldNum(TECInventJournalTransDim, InventSiteId)).value(Site.valueStr());
SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInventJournalTransDim)),fieldNum(TECInventJournalTransDim, InventLocationId)).value(Warehouse.valueStr());
SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInventJournalTransDim)),fieldNum(TECInventJournalTransDim, TECScrapType)).value(queryValue(ScrapType.valueStr()));
reportRunController.runReport();
}
super();
}
TECInsuranceClaim
void clicked()
{
SrsReportRunController reportRunController;
Map queryContracts;
MapEnumerator mapEnum;
Query query;
QueryBuildRange range;
SrsReportDataContract contract;
TECInsuranceClaimContract rdpContract;
;
if (TECInsuranceClaimTable.TECInsuranceClaimId)
{
reportRunController = new SrsReportRunController();
reportRunController.parmReportName(ssrsReportStr(TECInsuranceClaim, PrecisionDesign1));
reportRunController.parmLoadFromSysLastValue(false);
// Set printer settings (print to file, format, filename, etc).
contract = reportRunController.parmReportContract();
// Use our custom-defined report contract class
rdpContract = contract.parmRdpContract() as TECInsuranceClaimContract;
//rdpContract.parmToDate(systemDateGet());
//rdpContract.parmIncludeVendorsWithoutTransactions(true);
queryContracts = contract.parmQueryContracts();
mapEnum = queryContracts.getEnumerator();
while(mapEnum.moveNext())
{
query = mapEnum.currentValue();
range = SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInsuranceClaimTable)),fieldNum(TECInsuranceClaimTable, TECInsuranceClaimId));
range.value(queryValue(TECInsuranceClaimTable.TECInsuranceClaimId));
}
reportRunController.runReport();
}
}
PAKAI FORM DIALOG
public void closeOk()
{
SrsReportRunController reportRunController;
Map queryContracts;
MapEnumerator mapEnum;
Query query;
QueryBuildRange range;
SrsReportDataContract contract;
TECScrapReportContract rdpContract;
JournalNameId ScraptReworkJournalNameId;
reportRunController = new SrsReportRunController();
reportRunController.parmReportName(ssrsReportStr(TECScrapReport, Report));
reportRunController.parmLoadFromSysLastValue(false);
// Set printer settings (print to file, format, filename, etc).
contract = reportRunController.parmReportContract();
// Use our custom-defined report contract class
rdpContract = contract.parmRdpContract() as TECScrapReportContract;
rdpContract.parmFromDate(FromDate.dateValue());
rdpContract.parmToDate(todate.dateValue());
rdpContract.parmSite(Site.valueStr());
rdpContract.parmWareHouse(Warehouse.valueStr());
rdpContract.parmJournalNameId(ScrapType.valueStr()); // Add by Tyo
if(ScrapType.text() == "Scrap")
{
rdpContract.parmScrapType(TECScrapType::Scrap); // Add by cTyo
}
else
{
rdpContract.parmScrapType(TECScrapType::Rework); // Add by cTyo
}
queryContracts = contract.parmQueryContracts();
mapEnum = queryContracts.getEnumerator();
if(ScrapType.valueStr() == enum2Value(TECScrapType::Scrap))
ScraptReworkJournalNameId = InventParameters::find().TECScrapJournalName;
else
ScraptReworkJournalNameId = InventParameters::find().TECReworkJournalName;
while(mapEnum.moveNext())
{
query = mapEnum.currentValue();
SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInventJournalTransDim)),fieldNum(TECInventJournalTransDim, JournalNameId)).value(ScraptReworkJournalNameId);
SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInventJournalTransDim)),fieldNum(TECInventJournalTransDim, TransDate)).value(queryRange(FromDate.dateValue(), todate.dateValue()));
SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInventJournalTransDim)),fieldNum(TECInventJournalTransDim, InventSiteId)).value(Site.valueStr());
SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInventJournalTransDim)),fieldNum(TECInventJournalTransDim, InventLocationId)).value(Warehouse.valueStr());
SysQuery::findOrCreateRange(query.dataSourceTable(tableNum(TECInventJournalTransDim)),fieldNum(TECInventJournalTransDim, TECScrapType)).value(queryValue(ScrapType.valueStr()));
reportRunController.runReport();
}
super();
}
0 comments:
Post a Comment