Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8001893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:12:52+00:00 2026-06-04T16:12:52+00:00

I am creating an X++ report, and the requirement is that the user can

  • 0

I am creating an X++ report, and the requirement is that the user can multi-select on a form and when they click the report menu button the values are pulled in based on the selection.

So far this is easy enough, and I can pull in Str ranges i.e. order numbers, item id’s etc, but I want to be able to pull in a date range based on selection.

I have used a method which several MorphX reports use, with use of 3 key methods in X++ reporting;

setQuerySortOrder
setQueryEnableDS

and the main key one which is;

setQueryRange

The code for setQuery Range is as follows;

private void setQueryRange(Common _common)
{
    FormDataSource              fds;

    LogisticsControlTable       logisticsTable;
    QueryBuildDataSource        qbdsLogisticsTable;

    QueryBuildRange             qbrVanRun;
    str                         rangeVanRun;

    QueryBuildRange             qbrLogId;
    str                         rangeLogId;

    QueryBuildRange             qbrExpStartDate;
    str                         rangeExpStartDate;

    set                         vanRunSet       = new Set(Types::String);
    set                         logIdSet        = new Set(Types::String);
    set                         expStartDate    = new Set(Types::Date);

    str addRange(str _range, str _value, QueryBuildDataSource _qbds, int _fieldNum, Set _set = null)
    {
    str             ret = _range;
    QueryBuildRange qbr;
    ;

    if(_set && _set.in(_Value))
    {
        return ret;
    }

    if(strLen(ret) + strLen(_value) + 1 > 255)
    {
        qbr = _qbds.addRange(_fieldNum);
        qbr.value(ret);
        ret = '';
    }

    if(ret)
    {
        ret += ',';
    }

    if(_set)
    {
        _set.add(_value);
    }

    ret += _value;
    return ret;
}

switch(_common.TableId)
{
    case tableNum(LogisticsControlTable):

    qbdsLogisticsTable  = element.query().dataSourceTable(tableNum(LogisticsControlTable));
    qbrVanRun           = qbdsLogisticsTable.addRange(fieldNum(LogisticsControlTable, APMServiceCenterID));

    qbdsLogisticsTable  = element.query().dataSourceTable(tableNum(LogisticsControlTable));
    qbrLogId            = qbdsLogisticsTable.addRange(fieldNum(LogisticsControlTable, LogisticsId));

//       qbdsLogisticsTable  = element.query().dataSourceTable(tableNum(LogisticsControlTable));
//        qbrExpStartDate     = qbdsLogisticsTable.addRange(fieldNum(LogisticsControlTable, APMExpDateJobStart));

    fds = _common.dataSource();

    for(logisticsTable = fds.getFirst(true) ? fds.getFirst(true) : _common;
        logisticsTable;
        logisticsTable = fds.getNext())
    {
        rangeVanRun         = addrange(rangeVanRun, logisticsTable.APMServiceCenterID, qbdsLogisticsTable, fieldNum(LogisticsControlTable, APMServiceCenterID), vanRunSet);
        rangeLogID          = addrange(rangeLogID, logisticsTable.LogisticsId, qbdsLogisticsTable, fieldNum(LogisticsControlTable, LogisticsId), logIdSet);
//           rangeExpStartDate   = addrange(rangeExpStartdate,       logisticsTable.APMExpDateJobStart, qbdsLogisticsTable, fieldNum(LogisticsControlTable, APMExpDateJobStart), expStartDate);
    }



qbrLogId.value(rangeLogID);
    qbrVanRun.value(rangeVanRun);
    break;
}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:12:54+00:00Added an answer on June 4, 2026 at 4:12 pm

    Use queryValue to format your dates correctly for the query:

    set expStartDate = new Set(Types::String);
    
    rangeExpStartDate = addrange(rangeExpStartdate, queryValue(logisticsTable.APMExpDateJobStart), qbdsLogisticsTable, fieldNum(LogisticsControlTable, APMExpDateJobStart), expStartDate);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a report such that when you click on a data point
I'm creating a report that will take some data from one database (Company and
I'm creating a report that lists patient deaths by date and by doctor. There
I am creating a Generate Report button for some data in my application. The
I am creating an HTML report (it's to be a form for filling in).
I am creating a report. In that I am displaying total no of leads,
In Asp.Net for creating a huge pdf report iam using ThreadPool.QueueUserWorkItem, My requirement is
I have a requirement to create a report that is killing the processor and
I'm creating a report that needs to obtain data from a workspace that has
I am creating a report in SSRS 2005 and where there should be a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.