Solved

Mimic a sub report on a sub report

Posted on 2011-03-24
8
257 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

763 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