After updating to 4.4.0, my report no produces data

(5 posts) (2 voices)
  • Started by mark.mccray@tbwachiat.com
  • Latest reply from myDBR Team
  1. mark.mccray@tbwachiat.com, Member

    Strangely after updating to 4.4.0 my reports that were working are no longer producing rows, unless I enter information in some optional parameters.

    If I comment out all these case statements in the where clause, things work, or if I enter information in the all the parameters used in the case statements, then I get information:

    where tl.hours is not null
    and tl.day between vBeginDate and vEndDate
    /*and th.officeID in (select id from freelancer_office_id_data_tmp) */
    /*and tc.dtLocationID in (select id from freelancer_dt_location_id_data_tmp) */
    and case when vPayPeriodBeginDate is not null
    then p.payDate between vPayPeriodBeginDate and vPayPeriodEndDate
    else 1 = 1
    end
    /*and case when vFreelancerID is not null
    then tc.freelancerID = vFreelancerID
    else 1 = 1
    end*/
    and case when vClientID is not null
    then tl.clientID in (select clientID from freelancer_client_id_data_tmp)
    else 1 = 1
    end
    and case when vProductID is not null
    then tl.productID in (select productID from freelancer_product_id_data_tmp)
    else 1 = 1
    end
    and case when vDepartmentID is not null
    then tc.departmentID in (select departmentID from freelancer_department_id_data_tmp)
    else 1 = 1
    end
    and case when vRoleID is not null
    then tc.roleID in (select roleID from freelancer_role_id_data_tmp)
    else 1 = 1
    end
    and tl.postSessionID is not null

    group by tc.timesheetHeadID, tl.roleID, tl.clientID, tl.productID, tl.pirateJobNum, tc.rateType, tc.rateAmt
    order by dt.id, freelancer_name, tl.clientID, d.name, th.timesheetDate;

  2. mark.mccray@tbwachiat.com, Member

    At least with an int param like vFreelancerID, if there is nothing in there, it's getting sent over as 0 rather than null. Is this correct behaviour?

  3. myDBR Team, Key Master

    Mark,
    this is now a configurable parameter. If you add

    $mydbr_defaults['parameters']['empty_numeric_results_null'] = true;
    $mydbr_defaults['parameters']['empty_string_results_null'] = true;

    to your user/defaults.php, the optional numeric and string parameters when empty pass NULL to the report. After this, your reports should run unmodified.

    --
    myDBR Team

  4. mark.mccray@tbwachiat.com, Member

    Thanks for this.

    Is this in the PDF of documentation somewhere?

  5. myDBR Team, Key Master

    It is not. There are quite a few customization options in defaults.php.

    The change itself was introduces in 4.3.1 release to fix an issue in linked reports. Unfortunately it also broke some reports that depended on optional parameters. Sorry about that.

    The default option was introduced in a later 4.3.1 build to keep existing reports running unmodified.

    --
    myDBR Team


Reply

You must log in to post.