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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Missing Documents 1

Status
Not open for further replies.

unborn

Programmer
Jun 26, 2002
362
US
I am trying to create a report that reports back what documentation is missing. Currently I have a report I created that lists all the documents that they DO have but I would like it to report specifically what they dont and I am not sure where to begin I am still pretty new to the formula side of Crystal.

I have a list of 6 documents that they should have but I am not sure how I can have it create a list of what they have and compare it to what they should have and spit out the results.

Any help with this would be much appreciated! If you need for information please let me know.

Fields im using:
Prac.Name - Doctors name
Doc.Name - Name of document

I have it using 2 groups, the first one groups off the name and then the second is off of the Document name (this helped prevent duplicates that were caused if in details).

Running in circles is what I do best!
 
Create three formulas:

//{@reset} to be placed in the doctor group header:
whileprintingrecords;
stringvar z;
if not inrepeatedgroupheader then
z := "";

//{@accum} to be placed in the document group header or footer:
whileprintingrecords;
stringvar z := z + {table.docname}+",";

//{@chkdocs} to be placed in the doctor group footer:
whileprintingrecords;
stringvar array x := ["Doc1","Doc2","Doc3","Doc4","Doc5","Doc6"];//replace w/actual doc names
numbervar i;
numbervar j := ubound(x);
stringvar y := "";
stringvar z;
for i := 1 to j do(
if instr(z,x) = 0 then
y := y + {table.docname} + chr(13)
);
y

After placing this last formula in the doctor group footer, right click on it->format field->common tab->check "can grow." Then suppress the detail section. This will show a list in the group footer of the missing documents.

-LB
 
Thanks LB!

Ok.. wow.. incredible.. I have been trying to get those formulas to work all day and in doing so i have learned ALOT so thank you so much for helping me!! As I had finally given in and came here to post again for help from you on what was going on it just clicked in my head..

In chkdocs this line..
y := y + {table.docname} + chr(13)

It had been messing me up. It kept repeating the last document over and over and not showing any of the missing documents.

As I was posting here it came to my head I need not post whats in the table because it shouldn't be there so i replaced it with this..

y := y + x + chr(13)

I know you probably know but I am proud I finally figured it out on my own woot! Also if someone else needs something similar they have the solution now hehe.

Thanks again LB you rock!

Running in circles is what I do best!
 
So sorry. I tested this, but then wrote the formula from memory, and lost track of what I was doing. Glad you figured it out.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top