We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Getting Columns to Wrap in a subreport

valencehealth
on
Medium Priority
536 Views
Last Modified: 2008-02-01
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
Comment
Watch Question

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

Author

Commented:
Those are already all checked to true
CERTIFIED EXPERT

Commented:
Try moving the subreport to the header or footer.

Author

Commented:
I just tried that and that didn't work either.
CERTIFIED EXPERT

Commented:
I will post a notice in the "experts message question" to see if anyone else has an idea.
Commented:
Hello,

For columns to work, the engine needs to know the page length, quite obviously. For subreports, it hence needs to know the size of the control. If you use "can grow", the virtual page length of the subreport is infinite. So you can only have columns in a subreport if the subreport control has a fixed length *without* the CanGrow property.

You might want to say "use the remaining available space, please", but I don't know of a way to specify that.

Cheers!
(°v°)

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
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.
CERTIFIED EXPERT

Commented:
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

Commented:
> 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°)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.