tags:

views:

509

answers:

4

This really shouldn't be hard, I just can't figure out how to do it.

I am making a proposal report that needs to have a border around it. The problem is to get the vertical lines on the side. I can't figure out how to get a line to grow and shrink based on the height of the detail section.

I have used Crystal reports and sure wish Microsoft would learn a few things in regards to MS Access report writing!

I am very comfortable with VBA so have no fears there. :-)

Thanks, Jeff

A: 

No VBA needed.

  1. Make a dummy grouping that is unique to each detail. For that grouping, set footer to yes.
  2. In your new group footer section that you just created, add your line.
  3. In your detail section, select all the relevant fields that can grow and set Can Grow = Yes
  4. Done!

Edit

Off-topic, I agree that Access Reports could learn a lesson or two from Crystal. But Crystal isn't perfect either. [/flamewar]

PowerUser
But would that not just make the top and bottom lines and not do any side lines? I'm working through some ideas now using the detail height and resizing a vertical line based on that
Kevin Ross
True. I've gotten around this issue by just not having any side lines.
PowerUser
I might be considered a professional Access developer, I have no fear of horizontal lines, my problem is the vertical ones. I edited my original question for clarification.
Icode4food
Do you have to use Access? It's probably overkill if this is your only issue, but you could develop this report in Crystal and pull your data from the Access tables.
PowerUser
This is only one piece of a 60 hour Access project. The company I am working for already has an existing database that we need to connect to. Access really makes the most sense for this project.
Icode4food
Crystal Reports used to be vastly inferior to Access reports, but they stole a lot of the great ideas from Access. Same with SQL Server Reporting Services.
David-W-Fenton
A: 

Try this one.

Right click on the detail bar and select properties. Set the special effect to “Sunken”. This will put kind of a border around the detail section that resizes with the detail section.

I have tried to get a line to dynamically resize but its catch 22, by the time you know the height of the section (In the On Print event) you cant make any changes!

Kevin Ross
That is exactly the problem I am running into...I was hoping someone else could help me...
Icode4food
+1  A: 

You were right, this isn't so hard. The trick is to use 2 variables, top and bottom. In the PageHeader_Format event you set top to Me.Height, and in the PageFooter_Format event you set the bottom to Me.Top - correction, where correction is a fixed amound you use to fix the right length. I´m not sure where this amount comes from, you just have to try a little bit.

In the Report_Page event you can then draw your line from top to bottom.

dwo
That did it! Thanks a lot.
Icode4food
+1  A: 

Another method that nobody has mentioned is the one using the Line method of the report, outlined in Knowledge Base article 210321. I've used this one for years, and it can be used to draw both lines and rectangles. It's quite handy for invoices that have variable height subreports for the invoice details, but need the vertical lines to change according to the height of the main report detail.

David-W-Fenton
That is what ended up solving my problem
Icode4food