Dream Viewer
Dream Viewer

Reputation: 43

Creating an array from table in crystal reports formula

I have a very small view created (only 6 rows and 2 columns). I wish to read the values of the view into a 2D array using crystal reports. Can this be achieved in using formulas in crystal reports? If yes, how can i do that? IF not, is there any other alternative.? CANNOT USE SUB-REPORT

I am a beginner to crystal reports. Any help would really be appreciated.

Thanks in advance.

Upvotes: 1

Views: 8769

Answers (2)

Siva
Siva

Reputation: 9091

Below is the code that takes the row from table and displays it in report.Create a formula add below code

local numberVar i1;
For i1:=1 to Count(table.field) do
(
Shared StringVar Array  a:=[Field1, Filed2 ,... Add as many fields you have];
);

Now create individual formulas for every column and place the forlumas side by side in details section

E.g
Formula 1:
Shared StringVar Array  a;

a[1];

Formula 2:
Shared StringVar Array  a;

a[2];

Report
Formula 1  formula 2 ......

Let me know if you still face any issue.

Upvotes: 0

Siva
Siva

Reputation: 9091

I am confused on why you need to read columns from database.

Pick the rows into array and use it in report.

If I am understanding wrong elaborate more on what you required exactly, I will try to help.

Upvotes: 0

Related Questions