Solved

Formatting a Crystal Reports Report

Posted on 2016-08-02
9
55 Views
Last Modified: 2016-08-09
I have a situation where I need to format a Crystal Report to print. The problem is we have a form for a client's Drug and Alcohol Assessment and  this form was created in a proprietary forms designer program where they used three tables to hold the data for this form.  
This form has a lot of columns, something like 100 columns in the main table and another 60+ in the other tables. I do not have a lot of experience in CR. In the past for simple reports I would place the column header in the page header and the column values in the details so I can see the values for the different rows in the DB, then I could create a group to see each individual's records.

But in this case, what is important is to be able to print this for auditing.

To start with because there are three tables I used subreports.  Our assessment is set up by Dimensions. There are 6 Dimensions to each assessment. What I want to see is the report Header with general info then the Page header with the name of the Client and the Reason for assessment (and a few other columns), then I want to see the Dimensions of the assessment, so Dim one then Dim two, then three and so on.

But because DIM 1 and 2 are inside of their own tables I needed to use subreports. Which is causing me problems. What I did was I placed the subreports inside of the footer section because this was the only place where the data didn't repeat so Dim 1 and 2 are in the footer area but I have 100 or so more columns to add to the report.

What I did was I then added the rest of the columns (DIM 3 - 6)  from the main table in footer sections that I added i.e., so footer b, footer c, footer d and so on and then I placed the Dim 3 in footer b, Dim 4 in footer c etc., each Dim in it's own footer section. (SEE IMAGE).

While I don't want anything to repeat, I do need to be able to select an assessment from many assessments. And I'm not sure how to set this up. A client may (rarely) have more than one assessment, but we have many clients. So I'll need to have the report setup so one can select a client and see his assessment, and then print it.
 
As created now using the footers this form simply pulls the first client in the database! I think this is due to not using the details or another type of section correctly. I tried creating a group, and this inserted a group section that repeats the client name (what I grouped on) and this shows the other client's assessments but I lose data and if I select one of the other assessments I still see the data from the other assessment.
Were there no subreports I would place the info into the details section and select from the group selector on the left which should show the corresponding record. But, because I've got two tables that contain the data for Dim 1 and Dim 2 I can't figure out where I would place them.

  First setup that printshow I want it to display
0
Comment
Question by:John Mahoney
  • 5
  • 3
9 Comments
 
LVL 34

Assisted Solution

by:James0628
James0628 earned 250 total points
ID: 41741347
How about simply adding a parameter so that you can run the report for one client at a  time?

 James
0
 

Author Comment

by:John Mahoney
ID: 41741401
This may be my only option. I've been trying various things going about it using trial and error, and the subreports do not come in unless they are placed in the footer of the main report (as far as I can tell) I've tried placing them in separate detail sections, with suppression turned on, off, etc.,  and the reports don't seem to connect unless they are in the footer? Is that normal? Is that some rule about subreports?
0
 

Author Comment

by:John Mahoney
ID: 41741426
Why doesn't the subreport show when it's placed inside the details section, does it have to be in the footer?
0
 
LVL 34

Accepted Solution

by:
James0628 earned 250 total points
ID: 41741576
A subreport can be put in any section.  You wouldn't normally put a subreport in a detail section, because then it would (by default) be run for every record, which can be horribly inefficient.  But you _can_ put a subreport there.

 You presumably have the subreport linked to the main report, so that it shows the data for the correct client or whatever.  If the subreport isn't showing in some cases, it might be because of how they're linked.

 James
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

Assisted Solution

by:mlmcc
mlmcc earned 250 total points
ID: 41741637
Have you tried adding a group on the client then a group on the assessment.

You can use the client group header as the "report" header and the assessment group header as the page header.

Put the subreports in the assessment group footer and link them on the client and the assessment.

mlmcc
0
 

Author Comment

by:John Mahoney
ID: 41742974
Thank you for your help. It's strange but if I place the subreport anywhere but in the footer the data doesn't show up! The subreport works if I place it either in the group footer, or the report footer, but if I place it anywhere else, it fails.
The reason I wanted the report to be inside the details section is to be able to look through client's and their assessments. So, each subreport would indeed be run for each record.
 
I will try your suggestion and see if that works. But, it's weird that the subreport breaks when placed anywhere but the footer.
0
 
LVL 34

Assisted Solution

by:James0628
James0628 earned 250 total points
ID: 41743100
Like I said, you presumably have the subreport linked to the main report somehow (eg. using the client field).  If so, the results that you get from the subreport can vary, depending on where you put the subreport (because the current record at that point has different values in the linked fields).

 So, how is the subreport linked to the main report?

 James
0
 

Author Comment

by:John Mahoney
ID: 41748911
Tough one, I had to rebuild the views, and make changes to some of the joins. Thank you for your help here.
0
 

Author Closing Comment

by:John Mahoney
ID: 41748913
Thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

21 Experts available now in Live!

Get 1:1 Help Now