Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

error when i add tow Multi-Select Lookup for SSRS Report Dialog

(0) ShareShare
ReportReport
Posted on by 2,046

Greeting everyone 

here i add tow  Multi-Select Lookup for SSRS Report Dialog

and those take from companyInfo table and dimensionFinancialTag table 

and those doesn't have relation between them

but when i try to call report i got this error 

pastedimage1618408967312v1.png

and this is my code

pastedimage1618409173906v2.png

[SysEntryPointAttribute]
public void processReport()
{
    CompanyInfo companyInfo;
    DimensionFinancialTag   dimensionFinancialTag;
    Query                   query;
    QueryRun                queryRun;
    ListIterator            companyListIterator,branchListIterator;
    QueryBuildDataSource    qbdsCompany,qbdsbranch;

    PayrollPayPeriodRecId           payrollPayPeriodRecId,payrollPayPeriodRecIdscound;


    TotalSalaryByBranchContract  totalSalaryByBranchContract;

    this.insertTmpBranch();

    contract = this.parmDataContract() as TotalSalaryByBranchContract;

    payrollPayPeriodRecId=contract.parmPayrollPayPeriodRecId();
    payrollPayPeriodRecIdscound=contract.parmpayrollPayPeriodRecIdScound();


    companyListIterator = new ListIterator(contract.parmSalaryTotalcompany());

    branchListIterator = new ListIterator(contract.parmSalaryTotalbranch());


    qbdsCompany = query.dataSourceTable(tableNum(CompanyInfo));
    qbdsbranch = query.dataSourceTable(tableNum(DimensionFinancialTag));
    
    while(companyListIterator.more())
    {
        qbdsCompany.addRange(
            fieldNum(CompanyInfo, DataArea)).value(companyListIterator.value());
        companyListIterator.next();
    }
    
    
    while(branchListIterator.more())
    {
        qbdsbranch.addRange(
            fieldNum(DimensionFinancialTag, Value)).value(branchListIterator.value());
        branchListIterator.next();
    }
    

    queryRun = new QueryRun(query);

    while(queryRun.next())
    {
        companyInfo = queryRun.get(tableNum(companyInfo));
        dimensionFinancialTag = queryRun.get(tableNum(dimensionFinancialTag));
        this.populateTmpTable(companyInfo.DataArea,dimensionFinancialTag.Value,payrollPayPeriodRecId,payrollPayPeriodRecIdscound);
    }






}

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: error when i add tow Multi-Select Lookup for SSRS Report Dialog

    There are multiple errors in the code. I do not understand exactly what are you doing, but I will try to be as helpful as I can.
    First, let's discuss whether you need a query or not. If you do not want to add different ranges in the two tables mentioned, you already have values, in the Iterator, call your method. Maybe something like this;

    while(companyListIterator.more())
    {
        while(branchListIterator.more())
        {
            this.populateTmpTable(companyListIterator.value(),branchListIterator.value(),payrollPayPeriodRecId,payrollPayPeriodRecIdscound);
            branchListIterator.next();
        }
        companyListIterator.next();
    }

    Since the two tables are not related, it does not make much sense to use a query, but if you say "I will use it",  then you should either assign a new query with an existing query or create a query from scratch by making a new query and adding datasoruce to it.

  • mohammed.mqi Profile Picture
    2,046 on at
    RE: error when i add tow Multi-Select Lookup for SSRS Report Dialog

    how solve that problem ?!

  • mohammed.mqi Profile Picture
    2,046 on at
    RE: error when i add tow Multi-Select Lookup for SSRS Report Dialog

    thanks for replay

    how assign tow Multi-Select to query?

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: error when i add tow Multi-Select Lookup for SSRS Report Dialog

    You defined the query but did not assign anything. So its null, dont have any datasource etc.. It's very normal that you get a error.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,145 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,896 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans