Solved

Mimic a sub report on a sub report

Posted on 2011-03-24
8
258 Views
Last Modified: 2012-05-11
Sub report layout
Group Header 1          Department
  Group Header 2          Personnel
    Group Header 3          Work Order Name
        Detail                          List of tasks completed
    Group Footer 3                   Sum of the Task Completed on Work Order

What I would like to do is mimic a subreport after the group footer.
 
I need to populate a section after group footer 3 with multiple items linked to Work Order Name.  Is this possible?
-------------------------------------------
Sample Data
Group Header 1    Maintenance Department
  Group Header 2     John, Doe
    Group Header 3     Maintenance 101                Total completed

          Details              vbr31 Prerequistes                   0
                                   vbr32 Required Reading           2  
                                   vbr33 Test                                0

    Group Footer 3          TOTAL COMPLETED                2

--------------------------------------------------------------------------
 Work Order Routing List: (mimicked sub report)
   
    Description                Signoff      Date Signed
    -----------                     -------      -----------

    Recommended           C.J.          23-Mar-11
    Submitted                  K.T.          24-Mar-11    
   
0
Comment
Question by:cookiejar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 35211741
Is that data available in the report data?
If so you could aggregate it into arrays and print it out when you need it.

If the data isn't available you could have another subreport in the main report that gets the daya and passes it into the subreport.

mlmcc
0
 

Author Comment

by:cookiejar
ID: 35211988
The data is available in the subreport.  I am not an advance Crystal Reports developer, so how can I aggregate into an array and print it after group footer 1 in this case?


    Description                Signoff      Date Signed
    -----------                     -------       -----------

    Recommended           C.J.          23-Mar-11
    Submitted                  K.T.          24-Mar-11    
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 35212196
Add a formula to the report header
WhilePrintingRecords;
Global StringVar Array DescriptionList;
Global StringVar Array SignoffList;
Global StringVar Array DateSignedList;
Global NumberVar Index;

In the group3 header add a formula
WhilePrintingRecords;
Global StringVar Array DescriptionList;
Global StringVar Array SignoffList;
Global StringVar Array DateSignedList;
Global NumberVar Index;
ReDim DescriptionList[1];
ReDim SignoffList[1];
ReDim DateSignedList[1];
Index := 0;
""

In the detail section
WhilePrintingRecords;
Global StringVar Array DescriptionList;
Global StringVar Array SignoffList;
Global StringVar Array DateSignedList;
Global NumberVar Index;
Index := Index  + 1;
ReDim Preserve DescriptionList[Index];
ReDim Preserve SignoffList[Index];
ReDim Preserve DateSignedList[Index];
DescriptionList[Index] := {DescriptionField};
SignoffList[Index] := {SignOffField};
DateSignedList[Index] := CStr({DateField},"dd-MMM-yy");
""

In the group3 footer add a formula too display each array
WhilePrintingRecords;
Global StringVar Array DescriptionList;
Join(DescriptionList,chr(13);

WhilePrintingRecords;
Global StringVar Array SignoffList;
Join(SignoffList,chr(13);

WhilePrintingRecords;
Global StringVar Array DateSignedList;
Join(DateSignedList,chr(13);

You can put the 3 display formulas in the group footer.  Make sure to format them to CAN GROW

mlmcc

0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:cookiejar
ID: 35244331
mlmcc,

When I populate the array in the detail section, there are some cases the desciption that is being loaded into the array is null.  That causes the descriptionlist  display height to increase.  See the attachment.  Is there a way that if the value is null not to load into the array?
display-array.png
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 35244699
Test for a NOT Null field

In the detail section
WhilePrintingRecords;
Global StringVar Array DescriptionList;
Global StringVar Array SignoffList;
Global StringVar Array DateSignedList;
Global NumberVar Index;
If Not IsNull({DescriptionField}) then
(
    Index := Index  + 1;
    ReDim Preserve DescriptionList[Index];
    ReDim Preserve SignoffList[Index];
    ReDim Preserve DateSignedList[Index];
    DescriptionList[Index] := {DescriptionField};
    SignoffList[Index] := {SignOffField};
    DateSignedList[Index] := CStr({DateField},"dd-MMM-yy");
);
""

mlmcc

0
 

Author Comment

by:cookiejar
ID: 35245191
Thank you.

I am not sure if there is a solution for the following:
 

Due to the number of array lists that I have to insert in the group footer, I can not adjust the array list so that an item in the list does not wrap.

The arrays placed on the report look like the following:
 
DisplayList  SignOffList

1 Recommend  1 Deparment
2 Recommend     Supervisor
3 Approve        2 Department Officer
                        3 Engineer Officer  

I would like it to look like this:
1 Recommend   1 Department
                            Supervisor
2 Recommend   2 Department Officer
3 Approve         3 Engineer Officer
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 35245315
Can you make the signoff list wider? smaller font?

You can also check when building the array as

If Length({SignoffField}) > 20 then
   DescriptionList[Index] := {DescriptionField} & chr[13]
Else
    DescriptionList[Index] := {DescriptionField};

mlmcc
0
 

Author Comment

by:cookiejar
ID: 35245427
Thank you, you are definitely an expert.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question