Solved

SQL or Crystal Reports Question

Posted on 2014-12-30
6
399 Views
Last Modified: 2015-01-05
I am trying to create a report that displays results from an inspection record that is in a database.  Currently there are approx. 2 dozen different "named attributes" but that list could increase slightly.  I would like to be able to, I guess, save each of these named attributes as a new field so that I could use that field anywhere in a report.   I want to be able to place the fields anywhere in the report instead of all in a row like it would display currently.  1.png My first file shows a picture of what my report will currently display, in a column, for the various Measurements (attributes).  
2.png The second image shows a word document of an inspection report that I am trying to mimic.  I need the various fields to populate in different places on the report, not in a row.

How should I proceed?
Mechanical-Sue.rpt
0
Comment
Question by:ITworks
  • 3
  • 3
6 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 40524808
You are going to have to use a group and build the report itself in the group footer.

Details section will be

WhilePrintingRecords;
Global StringVar HeatNumber;
Global StringVar Inspector;
Global StringVar Sampler;
...

If {MeasurementField} = "Heat Number" then
    HeatNumber := {InspectionValueField}
Else if {MeasurementField} = "Inspector" then
   Inspector := {InspectionValueField}
Else if {MeasurementField} = "Sampler" then
    Sampler := {InspectionValueField}
...
Else
   "";
""

Open in new window


You can then create the report with the lines and everything in the group footer and use formulas like

Name - Display Heat Number
WhilePrintingRecords;
Global StringVar HeatNumber;
HeatNumber

Open in new window


You will have one test and variable for each value you need and one display formula for each value for the report

mlmcc
0
 
LVL 4

Author Closing Comment

by:ITworks
ID: 40524820
Got it...... thanks!
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40524957
If you need more help, just ask.

mlmcc
0
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

 
LVL 4

Author Comment

by:ITworks
ID: 40525925
I need more help, please.  I guess I don't 'got it'.  

I'm having issues with suppressing the blanks.  It's showing spaces for blanks and I haven't figured out how to suppress them.

Also, There could be up to (4) individual inspections.  Therefore, there could be up to (4) results for each inspection name (attribute).  I want to group them and sort them.  {view_PT_InspectionItem_Measurement.ID} will have a numeric value.  It will be a sequential number and it just keeps going on and on in the database.  So on this inspection report, the number may start with 18413 and for each of the 22 attributes it will go up by one.  Then there will be another 22 if there is a second part inspected like there is in this case, etc.  Basically, I believe if I sort everything by the ID, I will be ok.
Mechanical-Sue.rpt
0
 
LVL 4

Author Comment

by:ITworks
ID: 40530747
.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40531522
I think this does what you want.

I set the GF to suppress when blank.

I also modified the main formula to include the yield test and the display yield to only display for the yield group

mlmcc
Mechanical-Sue.rpt
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

12 Experts available now in Live!

Get 1:1 Help Now