I'm not sure if this is something anyone is going to be able to help me with, it might be too shop-specific, but I thought I'd give it a shot to help a coworker out. We're using XI and SQL database.
I'll explain the logic, then what we've done in Crystal.
I have two orders, I'll call them original order and new order.
A doctor creates an original order for a patient, that order has a unique order#. Within one year, something breaks and the patient comes back in to have whatever material replaced. A new order is created, with its own unique order#. Since the issue is related to the original order, a Base_Order# is assigned to the new order that is the same number as the original order. This references the new order back to the original order. Nothing changes on the original order, the reference only goes one way:
Original order: Order# 123, NO Base_Order#
New order: Order# 456, Base_Order# 123
Where it starts to get complicated:
The doctor who creates the new order may not be the same doctor that created the original order, and the original order has to be within one year in the past by the end date in the date range.
We need to use the Base_Order# on the new order to pull the names of the doctors who created the original orders via Subreport, and put them in order on the report.
What we've been able to do so far:
New Dr NewOrder# Base_Order# Orig.Dr Orig.Order#
Booey, B 456 123 Griffin, P 123
Davis, S 432 234 Allen, T 234
NOTE: The Orig.Dr and Orig.Order# are coming from the subreport, the rest is on the main report.
What we'd like to see:
Orig.Dr Base_Order#
Allen, T 234
Griffin, P 123
Basically, we want the original doctor's name and the Base_Order# listed by doctor.
I have the subreport linked to the main report by Order#(subrpt) = Base_Order# (main), and {@Start Date} and {@End Date} being passed but not linked to any fields in the subreport. I'm using a formula in the subreport to pull original orders up to one year in the past from the End Date, table.date in {@End Date - 1 Year} to {?PM-@End Date}.
This is everything that I thought should give me the result we want, but we've been unable to get the original doctors to sort in order. I've tried doing it in reverse, getting the Base_Order# with a subreport, but it's still listing the doctors who created the new order.
My coworker made a post about sorting subreports a few days ago, in which we discovered subreports only sort by the field it's linked to the main report with, which gave us a little more direction, but now we're stuck again.
I realize this whole thing might be a little nebulous, so please let me know if you need more info... if anyone has any ideas, I'd sure appreciate them.
"I have no idea what's going on." -Towelie
I'll explain the logic, then what we've done in Crystal.
I have two orders, I'll call them original order and new order.
A doctor creates an original order for a patient, that order has a unique order#. Within one year, something breaks and the patient comes back in to have whatever material replaced. A new order is created, with its own unique order#. Since the issue is related to the original order, a Base_Order# is assigned to the new order that is the same number as the original order. This references the new order back to the original order. Nothing changes on the original order, the reference only goes one way:
Original order: Order# 123, NO Base_Order#
New order: Order# 456, Base_Order# 123
Where it starts to get complicated:
The doctor who creates the new order may not be the same doctor that created the original order, and the original order has to be within one year in the past by the end date in the date range.
We need to use the Base_Order# on the new order to pull the names of the doctors who created the original orders via Subreport, and put them in order on the report.
What we've been able to do so far:
New Dr NewOrder# Base_Order# Orig.Dr Orig.Order#
Booey, B 456 123 Griffin, P 123
Davis, S 432 234 Allen, T 234
NOTE: The Orig.Dr and Orig.Order# are coming from the subreport, the rest is on the main report.
What we'd like to see:
Orig.Dr Base_Order#
Allen, T 234
Griffin, P 123
Basically, we want the original doctor's name and the Base_Order# listed by doctor.
I have the subreport linked to the main report by Order#(subrpt) = Base_Order# (main), and {@Start Date} and {@End Date} being passed but not linked to any fields in the subreport. I'm using a formula in the subreport to pull original orders up to one year in the past from the End Date, table.date in {@End Date - 1 Year} to {?PM-@End Date}.
This is everything that I thought should give me the result we want, but we've been unable to get the original doctors to sort in order. I've tried doing it in reverse, getting the Base_Order# with a subreport, but it's still listing the doctors who created the new order.
My coworker made a post about sorting subreports a few days ago, in which we discovered subreports only sort by the field it's linked to the main report with, which gave us a little more direction, but now we're stuck again.
I realize this whole thing might be a little nebulous, so please let me know if you need more info... if anyone has any ideas, I'd sure appreciate them.
"I have no idea what's going on." -Towelie