I am using CR 8.5 connecting to SQL Server via ODBC. The reports I create track employee completion of federal compliance training courses for a financial institution. SQL Server tables are set up as follows:
Person
emp_id - pk
emp_status
group
region
market
cost_ctr
auto_event - fk
Event
event_status
auto_event - pk
locator_num - fk
Class
locator_num - pk
course_code
The intention of the reports I have just created is to list all of the employees in a given cost_ctr who are active, and then show which of those employees have completed compliance training for a predetermined course.
So I have a left-outer join like this:
Person -> Event -> Class
In my report I have the following grouping:
{Person.Group}
{Person.Region}
{Person.Market}
{Person.cost_ctr}
In the cost_ctr Group Header I have a subreport that is linked to the main report by ALL of the grouping fields. In the subreport I list all of the employees that are active for the cost_ctr. In the details I list the employees who have completed the course.
This all works as expected until ANY one of the fields that my subreport is linked on is NULL. If this happens then my subreport returns nothing.
Subreport Selection formula:
{Person.emp_status} = "A" and
{Person.group} = {?Pm-person.group} and
{Person.region} = {?Pm-Person.region} and
{Person.market} = {Pm-Person.market} and
{Person.cost_ctr} = {?Pm-Person.cost_ctr}
Even though I am using subreports, this runs at an acceptable speed (just a few minutes), but again it is inaccurate if one of the linked fields in null.
I tested this selection formula on a report that selects a small data set:
{Person.emp_status} = "A" and
(
isnull({Person.group}) or
{Person.group} = {?Pm-person.group}
) and
(
isnull({Person.region}) or
{Person.region} = {?Pm-Person.region}
) and
etc, and my results were correct. The problem is when I put this in my 'real' report (where the subreport fires several hundred times) it is unacceptably slow.
So 2 questions:
1) Is it possible to do this without subreports (SQL Server tables are stored on an external vendors server and I do not have access to creating Views or Stored Procs)
2) If not, is my subreport functioning in the expected way, i.e. can subreports not link on NULL values?
-Gary
Person
emp_id - pk
emp_status
group
region
market
cost_ctr
auto_event - fk
Event
event_status
auto_event - pk
locator_num - fk
Class
locator_num - pk
course_code
The intention of the reports I have just created is to list all of the employees in a given cost_ctr who are active, and then show which of those employees have completed compliance training for a predetermined course.
So I have a left-outer join like this:
Person -> Event -> Class
In my report I have the following grouping:
{Person.Group}
{Person.Region}
{Person.Market}
{Person.cost_ctr}
In the cost_ctr Group Header I have a subreport that is linked to the main report by ALL of the grouping fields. In the subreport I list all of the employees that are active for the cost_ctr. In the details I list the employees who have completed the course.
This all works as expected until ANY one of the fields that my subreport is linked on is NULL. If this happens then my subreport returns nothing.
Subreport Selection formula:
{Person.emp_status} = "A" and
{Person.group} = {?Pm-person.group} and
{Person.region} = {?Pm-Person.region} and
{Person.market} = {Pm-Person.market} and
{Person.cost_ctr} = {?Pm-Person.cost_ctr}
Even though I am using subreports, this runs at an acceptable speed (just a few minutes), but again it is inaccurate if one of the linked fields in null.
I tested this selection formula on a report that selects a small data set:
{Person.emp_status} = "A" and
(
isnull({Person.group}) or
{Person.group} = {?Pm-person.group}
) and
(
isnull({Person.region}) or
{Person.region} = {?Pm-Person.region}
) and
etc, and my results were correct. The problem is when I put this in my 'real' report (where the subreport fires several hundred times) it is unacceptably slow.
So 2 questions:
1) Is it possible to do this without subreports (SQL Server tables are stored on an external vendors server and I do not have access to creating Views or Stored Procs)
2) If not, is my subreport functioning in the expected way, i.e. can subreports not link on NULL values?
-Gary