Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

SSRS Report Parameters are not showing string values in text box

(0) ShareShare
ReportReport
Posted on by 3,084

ParametersIssue.jpeg

Hi Experts,

In SSRS Report Parameters, in the drop down the values are showing as string which is correct but in in the text box it shows integers instead of string as shown in the above image. I want to show these integers as string as well.

Best Regards,

Shabir Ahmad

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: SSRS Report Parameters are not showing string values in text box

    Seems you have added the lookup from the source table where the enum is there and type is enum field. In the SQL enum field is stored as integer only. Therefore the lookup will save as integer only.

    As I said earlier that will be the better solution for you.

    One more workaround will be there will be a table named SRSAnalysisEnums table where all the enum will be saved. Try to add that table to that query and add the enum field as selection field in the table.

    But one drawback will be SRSAnalysisEnums table will store only Enum name not enum label. You can try that as a workaround, if that doesn't work you can go with creating new table.

    Thanks,

    Girish S.

  • Shabir Ahmad Profile Picture
    Shabir Ahmad 3,084 on at
    RE: SSRS Report Parameters are not showing string values in text box

    Hi Both,

    If you can add something more about my shared code.

    Best Regards,

    Shabir Ahmad

  • Shabir Ahmad Profile Picture
    Shabir Ahmad 3,084 on at
    RE: SSRS Report Parameters are not showing string values in text box

    class SLD_POStatusReportUIBuilder  extends SrsReportDataContractUIBuilder
    {
        SLD_POStatusReportContract               contract;
        DialogField                              PurchOrder;
        DialogField                              VendorIDList;
        DialogField                              POStatusList;
        List                                     POrderStatusList              = new List(Types::String);
        List                                     POrderApprovalStatusList      = new List(Types::String);
        List                                     POVendorIDList                =  new List(Types::String);
        List                                     PONumberList                =  new List(Types::String);
        TransDate                                fromDateRange,ToDateRange;
        utcDateTime                              dateFrom,dateTo;
        DialogField                              DfromDate;
        DialogField                              DtoDate;
        DialogField                               ExclInvPO, ExclUnconPO,ExclCanlPO;
        DialogField                              POApprovalStatusList;
        container                                 purchOrderCon, purchOrderVendorCon,purchOrderStatusCon,purchapprovalcon;
        
    
        public  void build()
        {
            contract                  =    this.dataContractObject();
            DfromDate                =    this.addDialogField(methodStr(SLD_POStatusReportContract,parmFromDate),contract);
            DtoDate                  =    this.addDialogField(methodStr(SLD_POStatusReportContract,parmToDate),contract);
            //ExclInvPO               =     this.addDialogField(methodStr(SLD_POStatusReportContract,parmExclInvPO),contract);
            // ExclCanlPO              =     this.addDialogField(methodStr(SLD_POStatusReportContract,parmExclCanclPO),contract);
            POStatusList           =    this.addDialogField(methodStr(SLD_POStatusReportContract,parmPOHeaderStatus),contract);
            POApprovalStatusList   =    this.addDialogField(methodStr(SLD_POStatusReportContract, parmpoApprovalStatus), contract);
            VendorIDList           =    this.addDialogField(methodStr(SLD_POStatusReportContract, parmPOVendor ), contract);
            PurchOrder             =    this.addDialogField(methodStr(SLD_POStatusReportContract, parmPONumber), contract);
        }
    
        public   void postBuild()
        {
            
            ////FromDate
            DfromDate   = this.bindInfo().getDialogField(contract,methodStr(SLD_POStatusReportContract, parmFromDate));
            DfromDate.registerOverrideMethod(methodStr(FormDateControl, leave), methodStr(SLD_POStatusReportUIBuilder, fromDateLeave), this);
    
            ////toDate Leave
            DtoDate   = this.bindInfo().getDialogField(contract,methodStr(SLD_POStatusReportContract, parmToDate));
            DtoDate.registerOverrideMethod(methodStr(FormDateControl, leave), methodStr(SLD_POStatusReportUIBuilder, toDateLeave), this);
    
            
            /* ///ExclInvPO
            ExclInvPO   = this.bindInfo().getDialogField(contract,methodStr(SLD_POStatusReportContract, parmExclInvPO));
            
            ///ExclUnconPO
            ExclUnconPO   = this.bindInfo().getDialogField(contract,methodStr(SLD_POStatusReportContract, parmExclUncPO));
            
            ///ExclCanlPO
            ExclCanlPO   = this.bindInfo().getDialogField(contract,methodStr(SLD_POStatusReportContract, parmExclCanclPO));
            */
            ///PO status
            POStatusList   = this.bindInfo().getDialogField(contract,methodStr(SLD_POStatusReportContract, parmpoheaderstatus));
            POStatusList.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(SLD_POStatusReportUIBuilder, POHeaderStatusLookup), this);
            POStatusList.registerOverrideMethod(methodStr(FormStringControl, leave), methodStr(SLD_POStatusReportUIBuilder, VendorIDLeave), this);
            POStatusList.lookupButton(2);
          
            //PO APproval lookup
            POApprovalStatusList  = this.bindInfo().getDialogField(contract,methodStr(SLD_POStatusReportContract, parmpoApprovalStatus));
            POApprovalStatusList.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(SLD_POStatusReportUIBuilder,POApprovallookup),this);
            POApprovalStatusList.registerOverrideMethod(methodStr(FormStringControl, leave), methodStr(SLD_POStatusReportUIBuilder, VendorIDapprovalLeave), this);
            POApprovalStatusList.lookupButton(2);
            
            ///VendorIDList
            VendorIDList   = this.bindInfo().getDialogField(contract,methodStr(SLD_POStatusReportContract, parmpovendor));
            VendorIDList.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(SLD_POStatusReportUIBuilder, VendorIdlookup), this);
            VendorIDList.registerOverrideMethod(methodStr(FormStringControl, leave), methodStr(SLD_POStatusReportUIBuilder, VendorIDListLeave), this);
    
            ///PONumber
            PurchOrder   = this.bindInfo().getDialogField(contract,methodStr(SLD_POStatusReportContract, parmPONumber));
            PurchOrder.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(SLD_POStatusReportUIBuilder,PONumberlookup), this);
    
        }
    
        /// 
        ///
        /// 
        /// 
        /// 
        public boolean fromDateLeave(FormDateControl _control)
        {
            if (_control.dateValue() != dateNull())
            {
                fromDateRange = _control.dateValue();
            }
            return true;
        }
    
        ///     ///    /// 
        public boolean toDateLeave(FormDateControl _control)
        {
            if (_control.dateValue() != dateNull())
            {
                ToDateRange = _control.dateValue();
            }
            return true;
        }
    
        //leave method for vendor ID list
        public boolean VendorIDListLeave(FormStringControl _control)
        {
            if (_control.valueStr() != '')
    
            {
                POVendorIDList = strSplit(_control.valueStr(), ';');
            }
            return true;
        }
    
        // for PO number lookup
        public void  PONumberlookup(FormStringControl _control)
        {
            Query                   query = new Query();
            QueryBuildDataSource    qbds;
            ListEnumerator          enum,enum1,enumapprove;
           
            qbds = query.addDataSource(tableNum(PurchTable));
            ///qbds.relations(false);
            qbds.fields().dynamic(true);
            qbds.fields().clearFieldList();
            qbds.addSelectionField(fieldNum(PurchTable, PurchId));
            qbds.addSelectionField(fieldNum(PurchTable, PurchName));
            
            dateFrom     = DateTimeUtil::newDateTime(fromDateRange,DateTimeUtil::time(DateTimeUtil::minValue()));
            dateTo       = DateTimeUtil::newDateTime(toDateRange,DateTimeUtil::time(DateTimeUtil::maxValue()));
            qbds.addRange(fieldNum(PurchTable, CreatedDateTime)).value(SysQuery::range(dateFrom,dateTo));
    
            if (POVendorIDList)
            {
                enum = POVendorIDList.getEnumerator();
    
                while (enum.moveNext())
                {
                    qbds.addRange(fieldNum(PurchTable, OrderAccount)).value(enum.current());
                  
                }
            }
            
            
            //filter based on purch status
            if (POrderStatusList)
            {
                enum1 = POrderStatusList.getEnumerator();
    
                while (enum1.moveNext())
                {
                    qbds.addRange(fieldNum(PurchTable, PurchStatus)).value(enum1.current());
                }
            }
    
            //filter based on approval staus
            
            if(POrderApprovalStatusList)
            {
                enumapprove  =  POrderApprovalStatusList.getEnumerator();
                
                while (enumapprove.moveNext())
                {
                    qbds.addRange(fieldNum(PurchTable, DocumentState)).value(enumapprove.current());
                }
            }
            
            // //for
            SysLookupMultiSelectGrid::lookup(query,
                                             _control,
                                             _control,
                                             _control,
                                             purchOrderCon);
        }
    
        public void POHeaderStatusLookup(FormStringControl _control)
        {
    
    
            Query                   query = new Query();
            QueryBuildFieldList fieldList;
            QueryBuildDataSource    qbds;
            qbds  = query.addDataSource(tableNum(PurchTable));
            qbds.fields().dynamic(false);
            qbds.fields().clearFieldList();
            qbds.addSelectionField(fieldNum(PurchTable,PurchStatus));
            qbds.addGroupByField(fieldNum(PurchTable,PurchStatus));
    
    
            SysLookupMultiSelectGrid::lookup(query,
                                             _control,
                                             _control,
                                             _control,
                                             purchOrderStatusCon);
    
        }
    
        public boolean VendorIDLeave(FormStringControl _control)
        {
    
            if (_control.valueStr() != '')
    
            {
                POrderStatusList = strSplit(_control.valueStr(), ';');
                
            }
            
    
            return true;
        }
    
        public boolean   VendorIDapprovalLeave(FormStringControl _control)
        {
            if(_control.valueStr() != '')
            {
    
                POrderApprovalStatusList  = strSplit(_control.valueStr(), ';');
    
            }
            return true;
        }
    
        public void VendorIdlookup(FormStringControl _control)
        {
                 
            Query query = new Query();
            QueryBuildDataSource qbdspurch,qbdsvend;
            QueryBuildFieldList fieldList;
            // ListIterator          listIterator,listIteratorappr;
            ListEnumerator                  enum,enumapprove;
            qbdspurch = query.addDataSource(tableNum(VendTable));
            qbdspurch.fields().dynamic(false);
            qbdspurch.fields().clearFieldList();
            qbdspurch.addSelectionField(fieldNum(VendTable,AccountNum));
            qbdspurch.addGroupByField(fieldNum(VendTable,AccountNum));
                
            //filter based on date new added
            /*
            dateFrom     = DateTimeUtil::newDateTime(fromDateRange,DateTimeUtil::time(DateTimeUtil::minValue()));
            dateTo       = DateTimeUtil::newDateTime(toDateRange,DateTimeUtil::time(DateTimeUtil::maxValue()));
            qbdspurch.addRange(fieldNum(PurchTable, CreatedDateTime)).value(SysQuery::range(dateFrom,dateTo));
    */
            //filter vendor based on PO
    
            /*
            if (POrderStatusList)
            {
                enum = POrderStatusList.getEnumerator();
    
    
                while (enum.moveNext())
                {
                    qbdspurch.addRange(fieldNum(PurchTable, PurchStatus)).value(enum.current());
                    
                }
            }
    
            if(POrderApprovalStatusList)
            {
                enumapprove  =  POrderApprovalStatusList.getEnumerator();
                
                while (enumapprove.moveNext())
                {
                    qbdspurch.addRange(fieldNum(PurchTable, DocumentState)).value(enumapprove.current());
                }
            }*/
            SysLookupMultiSelectGrid::lookup(query,
                                             _control,
                                             _control,
                                             _control,
                                             purchOrderVendorCon);
            
        }
    
        public void POApprovallookup(FormStringControl _control)
        {
            Query                   query = new Query();
            QueryBuildDataSource    qbds;
            QueryBuildRange         qbr;
            ListEnumerator          enum;
            qbds = query.addDataSource(tableNum(PurchTable));
    
            ///qbds.relations(false);
            qbds.fields().dynamic(false);
            qbds.fields().clearFieldList();
            qbds.addSelectionField(fieldNum(PurchTable, DocumentState));
            qbds.addGroupByField(fieldNum(PurchTable,DocumentState));
            //qbds.addRange(fieldNum(PurchTable, DocumentState)).value(queryValue(VersioningDocumentState::Approved));
            //qbds.addRange(fieldNum(PurchTable, DocumentState)).value(queryValue(VersioningDocumentState::Confirmed));
            //qbds.addRange(fieldNum(PurchTable, DocumentState)).value(queryValue(VersioningDocumentState::Draft));
            //qbds.addRange(fieldNum(PurchTable, DocumentState)).value(queryValue(VersioningDocumentState::Finalized));
            //qbds.addRange(fieldNum(PurchTable, DocumentState)).value(queryValue(VersioningDocumentState::InExternalReview));
            //qbds.addRange(fieldNum(PurchTable, DocumentState)).value(queryValue(VersioningDocumentState::InReview));
            //qbds.addRange(fieldNum(PurchTable, DocumentState)).value(queryValue(VersioningDocumentState::Rejected));
            SysLookupMultiSelectGrid::lookup(query,
                                             _control,
                                             _control,
                                             _control,
                                             purchapprovalcon);
    
        }
    
        //}
        public void postRun()
        {
            ///super();
        }
    
    }

    UI Builder class

  • Shabir Ahmad Profile Picture
    Shabir Ahmad 3,084 on at
    RE: SSRS Report Parameters are not showing string values in text box

    
    
    [DataContractAttribute,    SysOperationContractProcessingAttribute(classStr(SLD_POStatusReportUIBuilder))]
    public  class SLD_POStatusReportContract
    {    List     PurchOrderList;   
     List      VendorIDList;  
      List      POStatusList;    
    TransDate    fromDate,toDate; 
       NoYes           ExclInvPO, ExclUnconPO,ExclCanlPO;      
    List      POApprovalStatusList;   
       //fromadte  
    [DataMemberAttribute("fromDate"),     SysOperationLabelAttribute(literalstr("From Date")),     SysOperationDisplayOrder('1')]              public TransDate parmFromDate(TransDate _fromDate=fromDate)    {        fromDate=_fromDate;        return fromDate;    }                                                                                   //toDate  
    [DataMemberAttribute("toDate"),     SysOperationLabelAttribute(literalstr("To Date")),     SysOperationDisplayOrder('2')]              public TransDate parmToDate(TransDate _toDate=toDate)    {        toDate=_toDate;        return toDate;    }    
    //POstatus  
    [datamemberattribute("POStatusList"),        aifcollectiontype('return', types::Enum),     SysOperationLabelAttribute(literalstr("Purchase Order Status")),      sysoperationdisplayorder('3')]    public list parmpoheaderstatus(list _postatuslist=postatuslist)    {        postatuslist=_postatuslist;        return postatuslist;    }      //Unconfirmed/approval status
    //POstatus 
    [datamemberattribute("POApprovalStatusList"),     aifcollectiontype('return', types::string),     SysOperationLabelAttribute(literalstr("Purchase Order Approval Status")),      sysoperationdisplayorder('4')] 
    public list parmpoApprovalStatus(list _POApprovalStatusList=POApprovalStatusList)    {        POApprovalStatusList=_POApprovalStatusList;   
    return POApprovalStatusList;                                                                         }                                   //Vndor ID 
    [datamemberattribute("vendoridlist"),     Aifcollectiontype('return', Types::String),     SysOperationLabelAttribute(literalstr("Vendor")),      sysoperationdisplayorder('5')]    public list parmpovendor(list _vendoridlist=vendoridlist)    {        vendoridlist=_vendoridlist;        return vendoridlist;    }
    //PO number  
    [DataMemberAttribute("PurchOrderList"),        AifCollectionType('return', Types::String),     SysOperationLabelAttribute(literalstr("PO Number")),      SysOperationDisplayOrder('6')]   
    public List parmPONumber(list _PurchOrderList=PurchOrderList)    {        PurchOrderList=_PurchOrderList;      
    return PurchOrderList;    }
    }
    
    

    Contract Class

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: SSRS Report Parameters are not showing string values in text box

    Hi Shabir,

    I don't know how you have added lookup method.

    My suggestion will be creating a table with an string field. Loop through the enum values and insert the enum label id to the string field in the table.

    Use that table for the lookup.

    Thanks,

    Girish S.

  • Shabir Ahmad Profile Picture
    Shabir Ahmad 3,084 on at
    RE: SSRS Report Parameters are not showing string values in text box

    Hi Mohit Rampal,

    Have you added any code to manipulate lookup of this parameter?

    Can you explain a little more!

    Is this multi select lookup.

    correct, this is multi select lookup.

    Best Regards,

    Shabir Ahmad

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: SSRS Report Parameters are not showing string values in text box

    Hi Shabir, Have you added any code to manipulate lookup of this parameter? Is this multi select lookup.

    Also, Please check this thread

    community.dynamics.com/.../multiselect-lookup-in-a-ssrs-report-with-baseenum

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,074 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,900 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans