Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Array problem Post Reply Post New Topic
Author Message
copca
Newbie
Newbie
Avatar

Joined: 26 Apr 2009
Online Status: Offline
Posts: 3
Quote copca Replybullet Topic: Array problem
    Posted: 26 Apr 2009 at 5:39pm
Hi everybody,
I have the following query
IdField     Field1       Field2
1               CCC             8
1              
GGG            3
1              
DDD            2
2              
AAA             7
I want the following output
IdField
1               CCC GGG DDD    Field2 define different format to Field1
2               AAA
My report is grouped by IdField. As the output for Field1 has a different format depending on Field2. I want to write the Field1+Field2 values for each IdField in an Array, I have the following formulas, but the array looks empty, I have changed the array declaration as global and still is empty

Section: ReportHeader
Formula InitArray
             shared stringvar Array DataArray;
             redim DataArray[30];
             ""
Section: Details (Suppresed)
Formula AddDataToArray
            shared numbervar iCounter;
            shared stringvar Array DataArray;
            iCounter := iCounter + 1;
            DataArray[iCounter] := {Command.Field1} + "-" +
                                                 {Command.Field2};
Section: Footer Group1a
Formulla FillTextFromArray
            shared numbervar sDataVal;
            shared stringvar Array DataArray;
            sDataVal := DataArray[1];  //DataArray[1] shoud be = "CCC-8"
            left(sDataVal, len(sDataVal)-2);
            {@DisplayData1}= DataArray[1]; //This value is empty
Section: Footer Group1b
Display the following data
IdField     @DisplayData1  @DisplayData2  @DisplayData3 ...

I added 50 formulas to display each Field1 value with different formats. I know these columns are fixed, but I coudn't find any other way.
??? Is there another way to refence a formula or a text object different than FormulaName or TextObjectName?, like an object array or something, because I will be dealing with 50 formulas to write the value and to change the format
???
Thanks
 

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.