Skip to Content

Subreports sorting by group

Hi, I have a question about sub report.

I have 4 reports to attach in my main report. 2 each reports have a date range, but these date range coming from two different tables, but should be same date range selection.

What is the best way to select one date range which will work for both as I donot want to enter twice same dates from my dynamic crystal report/ with sub report.

This is a drill down OK monthly statistical reports sorted by item location which are coming from following

1. charge table 2 charge renewal 3. charge history table and 4 charge history renewal table. Both renewal fields are coming from charge table and charge history table, but date select for charge and charge history table is date_time_charge and charhe renew and charge history renew table date is coming from date_time_renewed. I want to know how can I add these numbers as this is a statistical reports. second how can I make one date selection for both date selections. if my option is to create an unlinked subreports then how can I add up these numbers.

ex. charge table has 20 charge renew table has 50 and charge history has 60 and charge history renew has 30. I want all numbers to be added. Please help

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 12, 2018 at 06:18 PM

    The easiest way to set the date parameters for the subreports is to create them in the main report and then use them in the Subreport Links to provide values to the parameters in the subreports.

    For each charge/date_time_charge combination in the charge table, are there one or more records in each of the other tables? The answer to this will determine how I'll recommend to set up the report.


    Add comment
    10|10000 characters needed characters exceeded

  • Dec 12, 2018 at 09:01 PM

    Hi Christy,

    This is a statistical data. It may be possible if anybody has returned any item in the same month and re sign out next day or same day but still in the same month. All I need is one date selection which will work for date_time_renewed and date_time_charge as the date selection will be only one but this date range pulls data from both date selection when I attach my sub report.



    Add comment
    10|10000 characters needed characters exceeded

  • Dec 14, 2018 at 02:33 PM

    Assuming that you have a left-join outer from the table with date_time_charge to the table with data_time_renewed, I would try something like this:

      (IsNull(date_time_renewed) and {date_time_charge} in {?date range})
      ({date_time_renewed} in {?date range})

    {?date range} will be the date range parameter that is passed into the subreport through the subreport link. Note where I have parentheses - these are very important for getting this to work correctly if you have any other filter criteria in the select expert in the subreport.


    Add comment
    10|10000 characters needed characters exceeded