Show Department names rather than Department numbers on report page headers criteria, possibly with a sub report

SUGGESTED

I'd like to be able to see the department name instead of the number in the selected criteria shown in the page header.

Currently I see "From '2' to '3' (inclusive)", or "All", or "1, 3, 4", depending on how or which departments I select to be included. This is very clever but only if the reader knows what the department numbers refer to.

The CRITERIA fields don't appear to offer a way to display the name instead.

I created a sub report with criteria that worked within the Report Designer showing only the department names for the selected departments, but when running the main/parent report, the department selection criteria were not passed to the sub report and all department names were displayed irrespective of which ones were selected.

Is there a way to pass the main report CRITERIA to the sub report, or display DEPARTMENT.NAME?

Parents
  • 0
    SUGGESTED

    It's feasible but not obvious/simple.

    In your sub report you need to add a criteria for DEPARTMENT.NUMBER. Then back in the parent report select the sub report and open the criteria property. NOTE: This is the criteria property for the sub report and NOT the criteria property of the main report so selecting the sub report first is important, otherwise you will likely open the wrong dialog. In the criteria dialog you should see one criterion called DEPARTMENT_NUMBER. Select this and click Edit. In the expression editor enter the value CRITERIA.DEPARTMENT_NUMBER_FULL and click OK, and then OK again on the criteria dialog.

    There is an overhead to a sub report but in this example it is unlikely to cause a significant performance issue provided the sub report is in the report header as that way it is only ever run once.

    Hope that helps

  • 0 in reply to Darron Cockram

    Thank you for the suggestion.

    I hadn't tried CRITERIA.DEPARTMENT_NUMBER_FULL previously as I assumed that it was a string.

    Using that I am only getting the first department now (whether it is in the criteria range or not).

    Report Designer sub report criteria

    Gives the result

    Subreport Runtime

  • 0 in reply to MarcGKepston

    On the surface it looks OK from your screenshots. Hard to say what isn't quite right but I've shared up a simple example report here that works in the way I think that you are after with the sub report showing all of the departments covered by the criteria set on the main report.

    Hope that helps

  • 0 in reply to Darron Cockram

    Thank you for the sample report. Even in your report I am still only seeing the Default department 0.

    Sample Report Criteria

    Sample Report Rendered

    I have had limited success changing the sub report criteria to CRITERIA.DEPARTMENT_NUMBER_TO or CRITERIA.DEPARTMENT_NUMBER_FROM. These only work in very specific situations.

    I tried creating a Switch Case expression (using a nested ?: )to set the criteria using the CRITERIA.DEPARTMENT_NUMBER_TYPE but that only partially worked and threw type conversion errors depending on which type was chosen from the drop down box.

  • 0 in reply to MarcGKepston

    The example report works OK for me I'm using the same criteria as you are and running it against the demo data:

  • 0 in reply to Darron Cockram

    What version of Accounts/Report Designer are you using?

Reply Children