Click to See Complete Forum and Search --> : Printing Database Field on Multiple Columns


mfdarvesh
March 26th, 2005, 01:03 AM
Dear Friends:

Is there any way exists, that may I print a database Fields on Multiple columns, like, I have a paper of bigger width approx 15", and I have only three fields i.e. PNo, Type, Amount to print to that Paper. The Type fields has certain values, like when the Type changes, the Fields may be printed on teh next part of the Paper. As I estimate, three protion can be printed on my page, but how to accomodate then, don't know, please help me.

Jukka
April 7th, 2005, 09:43 AM
I don't know what type of data source you have, but if you are using a relational database you could implement a stored procedure. First read the data into a cursor and based on some condition make the split to your final data structure returned by another cursor.

e.g.

Implement a counter that recieves a value (1,2,3) when looping your cursor

if counter = 1 Then
val1a := cursor_field1
val1b := cursor_field2
val1c := cursor_field3

if counter = 2 Then
val2a := cursor_field1
val2b := cursor_field2
val2c := cursor_field3

if counter = 3 Then
val3a := cursor_field1
val3b := cursor_field2
val3c := cursor_field3

Set counter := 1 and
write (val1a, val1b, val1c,val2a, val2b, val2c,val3a, val3b, val3c) to your return cursor.

- Jukka