Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Passing variables from subreport, parent/child rel Post Reply Post New Topic
Author Message
kuraki
Newbie
Newbie


Joined: 03 Oct 2013
Online Status: Offline
Posts: 2
Quote kuraki Replybullet Topic: Passing variables from subreport, parent/child rel
     Posted: 14 Oct 2013 at 5:07am
Hi, this is my first post, but I've spent a lot of time searching this forum for solutions and it has been a wealth of information for me. I really appreciate the level of technical knowledge displayed here.


I have a report that I have built that I am trying to add functionality to, in order to make it more useful for some of my employees. In this report, I'm pulling in "Jobs" by {jobnumber}. Each {jobnumber} consists of a parent child relationship tree of {assembly}, and each has a series of {operations}.

The top level of my report lists all of the current jobs scheduled to start by {operation} for a particular date range, so the people responsible for those areas can see the work they are scheduled to do in that time period.

What I would like to do, is indicate at that level, whether or not PREVIOUS operations in the tree have been completed, because if they have not, then although the work is scheduled to start, it's not available to work on until those operations have been completed.

I currently have a hyperlinked subreport that will break down by {jobnumber} every {assembly} and {operation} in the job, but it's time intensive to pour through every one to see it's level of completion.

I would like to pass a variable from that subreport, which would then allow me to highlight or otherwise conditionally format that line to indicate it is ready to be worked on.

Is that even possible with a hyperlinked report? Do I need an additional subreport that I can "hide" that solely exists to get that variable?

Have I even come close to explaining this thoroughly enough?   
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Oct 2013 at 5:16am

hyperlinked subreport cannot return a variable.

You can pass it from aubreports but they will slow your report down.
Can you post some sample data as you have it grouped now nad explain based on that sample data what you need to check for?
IP IP Logged
kuraki
Newbie
Newbie


Joined: 03 Oct 2013
Online Status: Offline
Posts: 2
Quote kuraki Replybullet Posted: 19 Oct 2013 at 5:38am
Ok, I can try. I'm not sure what format to post the data in, so I will start with screen shots and go from there.

This is the main report. WELD is group1, 750B is group2, and the date is group3. What I'm showing are jobs scheduled to start by the grouped date, for the grouped operation, in the grouped department. If we pick an example job, under 10/17 there is a job for a part called TURNTABLE WELDMENT. The job number itself is a hyperlink to my subreport.



In the subreport, I'm querying the job by it's unique number, then listing all assemblies and operations required to be completed for a finished component. Group1 here is that job number, group2 is the assembly sequence. You'll note I'm highlighting green and red, red would be incomplete operations, green would be complete operations. Each assembly number >1 has to be complete in order for 750B to have the parts it needs to start the 0 level assembly. (this is a bad example, if you'll note many operations are complete though the prior ones are not). In the right most column is an OpComplete field. If it's complete, 1, if not, 0.   

What I want to do, is show in the main report when all previous operations and assemblies are complete, so that the work is truly available.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 Oct 2013 at 4:59am
So to speak, here is the problem.

A hyperlinked report does not run when the main report is created, it only runs when someone clicks on the link. This allows the main report to load more quickly as it is not retrieving the data for all of the subreports.

There are 3 methods that I can think of that can get the data into your main report...DBlank correct me if am wrong....
1) Create a 'true' subreport that is not displayed by runs...so that the main report can see the values.
2) Create a command object that has the results that you need, so that the main report can use the values.
3) Create a stored procedure that returns the main report along with the information needed from the subreports

HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum