Solved

Mimic a sub report on a sub report

Posted on 2011-03-24
8
253 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
  • 4
  • 4
8 Comments
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:cookiejar
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you, you are definitely an expert.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
pairs challenge 5 44
Modeling a class in java 5 31
Running Jira on Raspberry PI 2? 3 117
Java Jpanels and Jframe 8 19
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now