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

CR Basic Syntax problem - any suggestions

Status
Not open for further replies.

DerBillster

Programmer
Jan 28, 2002
2
0
0
DE
Hi,
Hashing around in CR 8 with no former exposure to CR has been a real challenge :) I'm stumped with trying to get CR Basic Syntax to format a footnote in a Crystal Report. Below is the code I'm using, if you spot my error I'll be very grateful.

'@array1 adds each string field, details by detail line,
'into the string array ... this uses BASIC Syntax
'this formula is placed into the details section
'the string values will be shoved into a text object placed in the
'Seitenfuß section for display

WhilePrintingRecords
Shared stringarray1() as String
Shared positionarray1() as String
Shared counter1 as Number

Shared x as Number

for x = 1 to 100
if len({datafield1}) > 1 then
stringarray1(counter1) = cstr(x,0)&". "&trim({datafield1})&chr(13)
formula = stringarray1(counter1)
end if
if len({datafield2}) > 1 then
stringarray1(counter1) = cstr(x,0)&". "&trim({datafield2})&chr(13)


formula = stringarray1(counter1)
end if
next

==========================================================
I initialize the arrays at the start of the report as well as the counters. I place the instances of the footnotes into a formula to hold the line which is put into a textbox in the footer. I do not get any output in the footer on the page if there is a footnote. Do I need to count the page and use it as a marker to trigger the footnote to appear in the footer on the page ? The counters and the array are placed into the details section of the report. Have I forgotten anything critical to stop me from getting a successful execution of this code ?

Here is the code used to initialize the arrays:

'this formula creates 2 string arrays of 100 null values
'it also resets the string array for each new group
'also a counter is reset, used later... the formula uses the BASIC syntax
'which is also used in the other associated formulae for this
'workaround for getting more than 255 characters printed out in the footnotes
'@resetarray1 is placed in the Group Header area for this configuration
'this is the array that will accept unique strings for output

Shared stringarray1(100) as String
Shared positionarray1(100) as String
Shared counter1 as Number
counter1 = 0
Dim populatearray1 as Number
populatearray1 = 0
Do While populatearray1 < 98
populatearray1 = populatearray1 + 1
stringarray1(populatearray1) = &quot;&quot;
positionarray1(populatearray1) = &quot;&quot;

Loop
Formula = &quot;&quot;

===========================================================

That's it for now. Thanks in advance for any help you can toss my way.

Best regards,
DerBillster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top