Link to home
Create AccountLog in
Avatar of valencehealth
valencehealth

asked on

Getting Columns to Wrap in a subreport

I'm trying to create a report that prints a deposit ticket for the bank.  I have 2 tables.  The first is a table containing all the totals (checks and cash) that are being deposited on the ticket.  The second is a listing of the ammount of each check being depositted.  So I created a report that puts the information from the first table on to the top portion of the deposit ticket, then I created a subreport to dsiplay the amount of each check at the bottom of the deposit ticket.

I set up the subreport to use 6 columns going down and then accross, and if I open up this subreport by itself it works fine, the check amounts wrap to the next column when they get to the bottom of the page.  However, when I open up the main report which contains the subreport in its detail section, the check amounts get the bottom of the page and then go onto the next page.  Does anyone know how I can fix this?

Thanks

Ben
Avatar of IT-Schubertz
IT-Schubertz

Hi,

set the "CanGrow" property of the according fields to true.
Also set the "CanGrow" of the sections to true and check the "KeepTogether" property of the section

hth

Andy
Avatar of valencehealth

ASKER

Those are already all checked to true
Avatar of thenelson
Try moving the subreport to the header or footer.
I just tried that and that didn't work either.
I will post a notice in the "experts message question" to see if anyone else has an idea.
ASKER CERTIFIED SOLUTION
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
I took off the can grow and can shrink and made the size of it to be the bottom 2/3 of the page and its working fine now.  Now I assume that if the data fills up all 6 columns then the second page will only be using 2/3 of the page as well.  If there is an easy way of fixing this so that subsequent pages use the full page that would be great, if not this shouldn't be too big of a deal.
Change the size of the section in the on format event of the page header section.  Add a control with a contorl source of "=page".  Let's call it "txtPageNumber".  Then in the on format event of the page header section put:
Private Sub Header_Format(Cancel As Integer, FormatCount As Integer)
If txtPageNumber > 2 Then Detail.Height = some number in twips
End Sub

twips = 1440/inch
> Now I assume that if the data fills up all 6 columns then the second page will only be using 2/3 of the page as well.

Sorry, but that assumption is wrong. There will be no second page. The data that does not fit will simply not be shown.

If your top portion of the report is also columnar, I see no easy solution. If not, consider doing it the other way around: use the main report for the columnar output and rewrite the top portion of the first page as a subreport in the report header.

If both portions are columnar, I think you will have to generate the report in a text processor and not in Access, but that is of course much more complex.

Good luck!
(°v°)