Hi ,
I am trying to Multi Select the Item Group , I can able to multi select too . When I tried degugging I can able to see the List of Group ID inside the contract class(List return type parm method) untill I press the ok Button in the Dialog Form . When I press the ok button and while clalling the parm method(List Reurn Type) from the DP class I am able to sore only the first value in the varaible .
Here is my code .
Contract class
[ DataContractAttribute, SysOperationContractProcessingAttribute(classStr(ItemSummaryUIBuilder), SysOperationDataContractProcessingMode::CreateUIBuilderForRootContractOnly) ] class ItemSummaryContract implements SysOperationValidatable { List itemGroupId; [ DataMemberAttribute('ItemGroup'), SysOperationLabelAttribute(literalStr("Item Group")), AifCollectionTypeAttribute("Item Group", Types::String), SysOperationDisplayOrderAttribute("3") ] public List parmItemGroup(List _itemGroupId = itemGroupId) { itemGroupId =_itemGroupId; return itemGroupId; } }
UI Builder class
public class ItemSummaryUIBuilder extends SrsReportDataContractUIBuilder { ItemSummaryContract contract; DialogField itemGroupID; List itemGroupIDList; public void postBuild() { contract = this.dataContractObject() as ItemSummaryContract; itemGroupID= this.bindInfo().getDialogField(contract, methodStr(ItemSummaryContract, parmItemGroup)); itemGroupID.registerOverrideMethod(methodStr(FormStringControl,lookup),methodStr(ItemSummaryUIBuilder,ItemGroupLookup),this); } public void postRun() { // this.GroupID(); } private void ItemGroupLookup(FormStringControl _control) { ListEnumerator enum; Query query = new query(); QueryBuildDataSource queryBuildDataSource; queryBuildDataSource = query.addDataSource(tableNum(InventItemGroup)); queryBuildDataSource.fields().dynamic(false); queryBuildDataSource.fields().clearFieldList(); queryBuildDataSource.addSelectionField(fieldNum(InventItemGroup, ItemGroupId)); SysLookupMultiSelectGrid::lookup(query,_control, _control, _control, conNull()); } }
DP class
[SRSReportParameterAttribute(classStr(ItemSummaryContract))] class ItemSummaryDpClass extends SRSReportDataProviderBase { ItemSummaryTemptbl itemwiseTmp; ListEnumerator itemGroupIdIterator; // List _itemGroupId; List _itemGroupId = new List(Types::String); ItemSummaryContract contract; TransDate fromDate; TransDate toDate; InventLocationId inventLocationId; InventSiteId inventSiteId; WMSLocationId locationId; ItemGroupId itemGroupId; ItemId itemId; [SrsReportDataSetAttribute(tableStr(ItemSummaryTemptbl))] public ItemSummaryTemptbl getPurchaseOrderTmp() { select itemwiseTmp; return itemwiseTmp; } public void processReport() { InventTable inventTable; InventTrans inventTrans; InventDim inventDim; InventTransOrigin inventTransorigin; InventTransferTable inventTransferTable; InventTransferJour inventTransferJour; InventItemGroupItem inventItemGroupItem; CompanyInfo companyinfo; real openingPurchQty,openingSoldQty,openingPurchvalue,openingSoldValue; contract = this.parmDataContract() as ABS_ItemSummaryContract; //Assigning contract values to Parameters fromDate = contract.parmFromDate(); toDate = contract.parmToDate(); inventLocationId = contract.parminventLocationId(); inventSiteId = contract.parminventSiteId(); //itemGroupId = contract.parmItemGroup(); _itemGroupId = contract.parmItemGroup(); locationId = contract.parmloationId(); select * from companyinfo where companyinfo.DataArea == curext(); itemwiseTmp.CompanyName = companyinfo.Name; if (_itemGroupId != null) { itemGroupIdIterator = _itemGroupId.getEnumerator(); while (itemGroupIdIterator.moveNext()) { itemGroupId = itemGroupIdIterator.current(); while select inventItemGroupItem where inventItemGroupItem.ItemGroupId == itemGroupId join inventTable where inventTable.ItemId == inventItemGroupItem.ItemId { itemwiseTmp.ItemId = inventTable.ItemId; itemwiseTmp.ItemGroupId = inventItemGroupItem.ItemGroupId; itemwiseTmp.Description = InventTable::find(inventTable.ItemId).itemName(); itemwiseTmp.UOM = InventTableModule::find(inventTable.ItemId,ModuleInventPurchSales::Invent).UnitId; itemwiseTmp.insert(); } } } }
I have not mentioned the controller class here .
While debugging the DP class I can able to fetch only one record inside this _itemGroupId (List type variable)
the following line inside the DP class ..Since I am getting only one value There is no use of iterating . I dont know where I am commiting the mistake ? Can someone please help me in this ?
_itemGroupId = contract.parmItemGroup();
Hi Komi ,
For Normal Parameters these two properties work . But for Multi Level Parameter it doesnt allow the Nullable property . I have referred the following post but there is no solution
You want the report to run even if the parameter is blank. You can set that on the report parameter property.
Report -> Parameters -> Your parameter
Allow blank and Nullable
Thanks for replying Judy and Alex . Restoring Dataset helped me to solve this But May I know why I am unable to allow Null values for the Multi-Select parameter . I have checked few posts regarding that . But I cannot get the answer for this.
Hi,
Have you tried to restart SQLReporting service and also restore dataset for the report and check?
Regards,
Hi NoobGamer,
Did you get your solution yet?
When I try to call the parm method from controller class (For Testing)!! I can fetch the List of item Groups .
But When I try to call it from DP class I get only the first value in that List
Is there is any issue in my code ?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,151 Super User 2024 Season 2
Martin Dráb 229,993 Most Valuable Professional
nmaenpaa 101,156