Multiple columns in a data report
-
Hello, I'm trying to set up a report so that it will have several different columns for the same set of fields (like creating columns in word) that my data will be displayed in. For example... I have about 100 records to display on each page of the data report... The way it is right now, if I want to print out a report of those records it prints off several pages with just one column of the set of fields. I want to set up multiple columns for the same fields so that they will all fit on one page. Instead of having Field1 Field2 Field3 on a page, I will have Field1 Field2 Field3 : Field1 Field2 Field3 : Field1 Field2 Field3 on a page I hope that made sense. Thanks so much for your anticipated help. TimDasa
-
Hello, I'm trying to set up a report so that it will have several different columns for the same set of fields (like creating columns in word) that my data will be displayed in. For example... I have about 100 records to display on each page of the data report... The way it is right now, if I want to print out a report of those records it prints off several pages with just one column of the set of fields. I want to set up multiple columns for the same fields so that they will all fit on one page. Instead of having Field1 Field2 Field3 on a page, I will have Field1 Field2 Field3 : Field1 Field2 Field3 : Field1 Field2 Field3 on a page I hope that made sense. Thanks so much for your anticipated help. TimDasa
How are you generating the report? Using Crystal Reports? Or are you using code you wrote to send data to the printer? How are you tracking your data? Using a RecordSet object? Or using an Array? Need just couple more details here! :) RageInTheMachine9532
-
How are you generating the report? Using Crystal Reports? Or are you using code you wrote to send data to the printer? How are you tracking your data? Using a RecordSet object? Or using an Array? Need just couple more details here! :) RageInTheMachine9532
Thanx for your response. I have the data in a microsoft access database. I designed the report using vb 6 data report which gets it data from a data environment. I then used an SQL statement to filter the records. If you have a better way of extracting the data from the tables pls let me have it. Thanx.
-
Thanx for your response. I have the data in a microsoft access database. I designed the report using vb 6 data report which gets it data from a data environment. I then used an SQL statement to filter the records. If you have a better way of extracting the data from the tables pls let me have it. Thanx.
OK. In that case, you should be using a RecordSet object to track the data in your app. Next, you didn't mention how you were generating your report, so I'll assume your writing the code for it yourself. Now, you'd have to print the data out, something like this (assuming 50 rows per column):
Rec(0).Field1 Rec(0).Field2 Rec(0).Field3 : Rec(50).Field1 Rec(50).Field2 Rec(50).Field3
Rec(1).Field1 Rec(1).Field2 Rec(1).Field3 : Rec(51).Field1 Rec(51).Field2 Rec(51).Field3A simplified view of the code might look something like this (not actual code):
Dim Index as Integer
Dim rsData as RecordSet (Your data is in here)
Dim strOutput as String'Output your headers here
'
For Index = 0 to rsData.Count - 1
strOutput = rsData(Index).Fields(1).ToString & " " & _
rsData(Index).Fields(2).ToString & " " & _
rsData(Index).Fields(3).ToStringTry strOutput = strOutput & " : " & \_ rsData(Index + 50).Fields(1).ToString & " " & \_ rsData(Index + 50).Fields(2).ToString & " " & \_ rsData(Index + 50).Fields(3).ToString Catch End Try Print strOuput
Next
Again, this is a greatly simplified example and will NOT compile! But it should be enough to give you an idea of what is going on. RageInTheMachine9532