Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with Multi-Column Report 1

Status
Not open for further replies.

coco86

Programmer
Mar 13, 2002
296
DE
I'm setting up a report as multicolumn because I need to have three records print side-by-side on the page. Each record needs to have a subreport as well. Multiple columns was the only way I could figure out to make that work (except that it doesn't).

Problem 1: When I add the sub-report, I end up with one column on every other page. (Before I add the subreport, the columns sort of work--except that every fourth column is empty)

To get around the sub report problem I tried creating a query and putting the main report information into the header section for the account number and putting the subreport information in the detail section (so all the info was in one report, no sub-reports) and then I ended up with

Problem 2: Each detail line prints in its own column

or

Problem 3: No columns at all

Depending on how I set the "New row or col" property of the different sections

I really need to make this work, HOW it works is unimportant so if anyone has an alternate suggestion, I'm all ears...

-Coco

[auto]
 
To offer any help we would need to know what your thoughts were as to why you feel this is the solution.
What are you trying to print out and what is held in the sub-report?
 
Make sure the width of the subreports actually fit in the column widths you defined. Access won't bother to tell you if any of the fields on the report violate the column boundaries. You also need to check the columns to be sure you've defined them to print across then down.

Ex: If you have 3 columns and the report width is 10" with .5 left and right margins, there's actually 9" of printing or 3" per column. This means all of the fields in the Detail section must be 3" width or less and can't extend to the right beyond the 3" mark. If they do they'll be truncated. Anything positioned the right of the 3" mark will either not display properly or at all.

Page and Report hesders & footers will print all the way across the width, without regard to the columns.
------
You can accomplish the same thing without columns. Set up 3 textbox fields across where you want them, and make sure they're unbound. Name the fields so the last character is 1,2 and 3. You'll need a modular variable for counter/looping from 1 to 3, which needs to be set to 1 in the Report Open. (You can do the same thing with the subreports if you have to.)

In the DetailFormat check the counter to determine which field should get the current record's data. If the counter < 3 then you need to remain on the same report print position for the next record, so Me.MoveLayout=False. (MoveLayout automatically gets set to True at the start of each sections formatting.)

Module Header....
...
Dim mintCount as integer


ReportOpen
...
mintCount = 1


DetailFormat
...
Me(&quot;txtRec&quot; & intCount) = your data from current record
...
If FormatCount = 1 Then
If mintCount < 3 then
mintCount = mintCount + 1
Me.MoveLayout = False
Else
mintCount = 1
End If
End If
 
Trendsetter:
I'm printing invoices and the client wants them three to a page, side by side. The information is typical invoice stuff with one or more detail lines.

The sub-report I was using also contained a sub-report to show the detail lines

jigjag:
I did check all the margins and everything worked (I'd originally intended to include all the settings in my post but it got too long) I was able to get two columns to print on a page if I changed it to down and across instead of across and down, but still not three (and not in the right order of course)

Your alternate solution is really cool. It's nice to know that's possible. For this situation, however, there are too many fields involved to make it practical.

What I did do was this:
I created a table with three fields and used this table as the recordsource for my main report.

In the report open event, I open a recordset to get all the invoice numbers and then add them to the new table like this:

Invoice#1 Invoice#2 Invoice#3
Invoice#4 Invoice#5 Invoice#6
Invoice#7 Invoice#8 Invoice#9
etc

Then I added the subreport to the main report three times. On the first one, I linked the invoice # on the sub-report to field 1, on the second, I linked it to field2 and on the third, field 3.

It works like a charm. The only thing I'm worried about is that it may take awhile to open the report if there are a lot of records.

Thanks for the help. If you have any thoughts on my solution, I'd love to hear them.

-Coco

[auto]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top