Creating Multiple Columns In Report?


I am trying to create a simple report that has multiple columns of the same data field. It is basically a list of all members of an organization. I would like to have the entire membership list printed on 1 piece of paper using 4 columns. I can create a report with the one text field and it will print a nice single column of names.

But I would like to have it fill in the first column of the report and when it reaches the bottom of the report go back up to the top of the report and fill in the next column and so forth, until all the names are listed in 4 columns on the report. Is there a way to do that?

Here is a picture of the one column. I would like 3 more columns.

The code for the single column is listed below. Can this be altered to include three more columns using the same data? Any help would be greatly appreciated.


[code]Dim ps As New PrinterSetup
if gPrintSettings <> “” then
ps.SetupString = gPrintSettings

Roster= new RealSQLDatabase
Roster.DatabaseFile = GetFolderItem(“Roster.sqlite”)

If not Roster.Connect Then
msgbox “Cannot open the database. Aborting.”

Dim rpt As New ReportRoster
Dim sqlook as String

sqlook = “select * from Members order by Upper(Members)”

Dim rs as Recordset

dim rsq as new Reports.RecordSetQuery(rs)

If rpt.Run(rsq, ps ) Then
If rpt.Document <> Nil Then
ReportViewer1.SetDocument rpt.Document
End If[/code]

I have a similar need and was curious if this was possible?

The report write is whats known as a banded report writer
So it takes on row of data & puts it in one “row” on the report

BUT that said you can in one of two ways

  1. change the query so it returns 4 names as one row (which is a bit twisted but it can be done)

  2. look at the Gas Report which uses a custom written data provider - you could create a custom one that will grab one name at a time and “fakes” it being several columns

Thanks for explanation, Norm. Maybe worth taking a step back…

Is there a recommended way, or plugin to generate multi column output in some editable format? (How’s that for ambiguity?)

Specifically in our case, we’re trying to output text with specific settings set for margins # number of columns. Everything else related to the app is pretty mcuh done, but we’re struggling with this last piece of formatting. What we’re generating is something like a book index where you might want 1 column of data in some instances, but to save space/money you might do 2 or even 3 columns if page space allows.

Any suggestions on how to tackle that, or is looking at the Gas Report still the best bet?

The gas report shows how to create your own custom data set for use with a report
By doing that you can actually make a single column data source (like your query) act like it returns several columns

For instance you could make the custom data set tell the report it has 4 columns with names column1, column2, column3, column4
It’s just names & indexes
But inside the custom data set when asked for column1 you get a name from the database
When asked for column2 you get another name from the database - still the same underlying column as for column1 - just this time it’s the second name from the single column list
And so on for column3 & column4

The Gas report takes a bunch of data that is not laid out like the report wants it and runs some code to make it be like how the report expects it

So with a custom Data Set you can fake whatever you want (which is probably a LOT simpler than running some sql to get what amounts to a single column to behave like it IS several columns

The other option would be to create a temporary table that DOES have as many columns as you are seeking
Then you insert the date from your original query into this temporary table and fill in all the columns you want
Then select from that temporary table for the report