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

Repeating Detal Field

Status
Not open for further replies.

Llazwas

IS-IT--Management
Feb 16, 2007
58
0
0
US
I'm using Crystal X with a ProvideX database trying to write a monthly billing report. Currently grouped by invoice number with the following output:
Code:
Invoice#	Request#	Qty	Service		Amt
1001		  76928		
1001				     5	 BC Check	   300
1001				     3	 Analysis	   250
1001				     1	 Screening	  125
1001		  78972					
1001				     3	 BC Test		 83
1001				     1	 AD Test		 24
1001				     6	 Rado		   300

I need to export this to Excel but need to copy the request number field down the column until the next request number. Generally I would do this manually in Excel but each invoice can contain up to 4K lines.

Below is what I'm trying to accomplish.
Code:
Invoice#	Request#	Qty	Service		Amt
1001		76928		
1001		76928		5	BC Check	    300
1001		76928		3	Analysis	    250
1001		76928		1	Screening	   125
1001		78972					
1001		78972		3	BC Test		  83
1001		78972		1	AD Test		  24
1001		78972		6	Rado		    300

I've tried looping until I'm loopy! Any help is GREATLY appreciated!
 
I'd suggest you add a parameter so that the report can be run in two modes. FOr a printed report, "Request" to be suppressed after the first instance. For export to Excel, to be shown.

You'd do this by conditional formatting, right-click on the relevant field and the options are there.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Create a formula {@Request}:

whileprintingrecords;
stringvar req;
if isnull({table.request#}) then
req := req else
req := {table.request#};
req

This assumes that the field is currently null when not displayed, not empty. File->report options should NOT have "convert nulls to default" checked.

-LB
 
I tried the formula lbass suggested but I only get the Request# in the same row that it's currently in. I assume the goal is to store the request number in memory and repeat it until the next instance is encountered?
 
I tested this and it worked, so I'm wondering how you implemented it. Please post your actual formula. Also, you might first try this:

whileprintingrecords;
stringvar req;
if isnull({table.request#}) or
trim({table.request#}) = "" then
req := req else
req := {table.request#};
req

-lb
 
Thanks lbass, the last formula you posted works perfectly!!!

whileprintingrecords;
stringvar req;
if isnull({table.request#}) or
trim({table.request#}) = "" then
req := req else
req := {table.request#};
req
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top