Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Group Header w/o Detail Records

Status
Not open for further replies.

doublej0

Technical User
Aug 26, 2005
7
US
Here is my situation:

I have essentially four tables that I am using to gather data:
1) Customer
2) Session
3) Question
4) Answer

- Within the Customer table is a customer id, name, address, etc.
- Within the Session table is the customer id, question id, subsection id, and answer id
- Within the Question table is a question id and the question
- Within the Answer table is the answer id and the answer
- Each question can have multiple answers and there is no rhyme or reason in the sequencing of numbers. (they designed it this way to make it harder for me [mad])

Without using a subreport, I need to list each question and the correspoding answer even if the question has not been answered. The report is grouped by customer id (so each customer is on a different page), then by subsection id (all answers fall under the same subsection id of the question they correspond to). The question is listed on the subsection id group header and the answers are listed in the details section.

RH - Supressed
PH - Customer Name Information
GH1 - Subsection ID
Details - Answers
GF1 - Suppressed
RF - Supressed
PF - Suppressed

A typical report will look like this:

Simpson, Homer
5555 Springfield Avenue
Springield, IL 99999
---------------------------------
1. How long have you lived in Springfield?
---------------------------------
5 Years
---------------------------------
2. What is your son's name?
---------------------------------
Bart
---------------------------------
3. What is your boss's asst's name?
---------------------------------
Smithers

The issue comes when question 2 has not been answered. It will just have question 1 then question 3.

I NEED to have question 2 listed even if there is no answer.

I have done multiple searches and multiple ways of trying to order the information, but have found no way to list the missing questions.

Any help will be greatly appreciated.
 
Prefilling the data using a View or SP is best.

In your case, you'll need to build out a list ofmissingnumbers for dispay:

GH1 - Subsection ID
whileprintingrecords;
Stringvar MissingNum:="";

Details - Answers right clikc and select insert sedction below and place this formula in the UPPER details section, and your {table.answernumber} in the lower one:
whileprintingrecords;
stringvar MissingNum;
numbervar X;
If previous({table.answernumber}) <> {table.answernumber}-1
and
{table.answernumber} <> 1 then
for x:= previous({table.answernumber})+1 to {table.answernumber}-1 do(
MissingNum:=MissingNum+ totext({table.answernumber},0,"") & ","
);
left(Output,len(Output)-1)

Looks about right...

-k
 
Vampire.... What does output represent? Is that a function or something I should know?

By the way, I am using Crystal 10 in case that makes a difference on the functions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top