Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Mimic a sub report on a sub report

Posted on 2011-03-24
8
Medium Priority
?
263 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 101

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 101

Accepted Solution

by:
mlmcc earned 2000 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 101

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 101

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

636 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