473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Report Text Box Height - Always the same height as the detail section

Hi,

I'd like to produce a report that basically looks like an excel printout.

Description:
Profile Print Report
Detail Section with 3 bordered text boxes
all text boxes are 'abutted' against each other (where one ends, the next begins)
all text boxes have the 'can grow' property set to yes.
Detail Section with 'can grown' = yes

Desire:
allow that all 3 cells grow equally.

However, I would like the bordered cells to always be of the same height.

Basically, if one text box is taller than the other 2, the other two have adequate whitespace inside the textbox to cause all 3 to be of equal height.

What event of the detail section can I use so that either all 3 text boxes end up as tall as the detail section or each text box height = the height of the tallest text box after it has 'grown'?

Thanks!
Sep 20 '07 #1
7 13334
Jim Doherty
897 Expert 512MB
Hi,

I'd like to produce a report that basically looks like an excel printout.

Description:
Profile Print Report
Detail Section with 3 bordered text boxes
all text boxes are 'abutted' against each other (where one ends, the next begins)
all text boxes have the 'can grow' property set to yes.
Detail Section with 'can grown' = yes

Desire:
allow that all 3 cells grow equally.

However, I would like the bordered cells to always be of the same height.

Basically, if one text box is taller than the other 2, the other two have adequate whitespace inside the textbox to cause all 3 to be of equal height.

What event of the detail section can I use so that either all 3 text boxes end up as tall as the detail section or each text box height = the height of the tallest text box after it has 'grown'?

Thanks!
Have look at the LINE method in an Access Report to draw a rectangle around each of the text boxes. (examine the arguments that constitute that method, particularly the last argument if you wish to fill the rectangle with a specific colouring)

By looping through the controls you intend to work with ie: referenced in an zero based array you could thus draw a rectangle around each one commensurate with the height of the 'tallest' textbox control referenced.

This would then give the 'appearance' of each textbox having the same height with borders in effect 'drawn' at runtime. (you could set the actual border color property of each control itself to the same as the detail section)

If as you say the textboxes are butted up to each other arranged left to right in the detail section of the report with the controls set to grow, then try the following in the ON PRINT property of the detail section. (I,ll leave you to deal with your own error handling)

Expand|Select|Wrap|Line Numbers
  1. On Error Resume Next 
  2. Dim lngCounter As Long, dblMaxHeight As Double 
  3. dblMaxHeight = 0 
  4. ReDim strcontrol(3) 
  5. strcontrol(0) = "TheNameOfYourTextBoxOne
  6. strcontrol(1) = "TheNameOfYourTextBoxTwo
  7. strcontrol(2) = "TheNameOfYourTextBoxThree
  8. For lngCounter = 0 To UBound(strcontrol) 
  9. If Me(strcontrol(lngCounter)).Height > dblMaxHeight Then dblMaxHeight = Me(strcontrol(lngCounter)).Height 
  10. Next 
  11. For lngCounter = 0 To UBound(strcontrol) 
  12. If lngCounter = 0 Then 
  13. Me.Line (Me(strcontrol(lngCounter)).Left, Me(strcontrol(lngCounter)).Top)-Step(Me(strcontrol(lngCounter)).Width, dblMaxHeight), , B 
  14. Else 
  15. Me.Line (Me(strcontrol(lngCounter)).Left, Me(strcontrol(lngCounter)).Top)-Step(Me(strcontrol(lngCounter)).Width, dblMaxHeight), , B 
  16. End If 
  17. Next
  18.  
Hope this helps you

Regards

Jim
Sep 21 '07 #2
Jim,

Sorry for the late reply! I have introduced your code and it is near perfect on the first effort! I think I have something in my on print event or the properties of the text boxes that are causing some issues. I will address those and I believe this approach can give me exactly what I need.

Thank you so much and again my apologizes for the late response... I've been away from this project for some weeks.
Oct 6 '07 #3
Jim Doherty
897 Expert 512MB
Jim,

Sorry for the late reply! I have introduced your code and it is near perfect on the first effort! I think I have something in my on print event or the properties of the text boxes that are causing some issues. I will address those and I believe this approach can give me exactly what I need.

Thank you so much and again my apologizes for the late response... I've been away from this project for some weeks.
Glad it helps you. The line method is an appropriate use in reports in your case as a workaround because Access will throw an error if you try to resize a textbox 'in itself' once printing commences using the on format or on print events.

Regards

Jim
Oct 7 '07 #4
This code should do exactly what I am needing for a report I am working on as well. However, I am running into an odd problem. It is acting like the code is grabbing the control height before the can grow property runs. All of the lines are being drawn, but they are drawn to the size of the original text boxes (in the design view), not to the size of the text boxes after the can grow property. Any thoughts?
Jan 20 '08 #5
Jim Doherty
897 Expert 512MB
This code should do exactly what I am needing for a report I am working on as well. However, I am running into an odd problem. It is acting like the code is grabbing the control height before the can grow property runs. All of the lines are being drawn, but they are drawn to the size of the original text boxes (in the design view), not to the size of the text boxes after the can grow property. Any thoughts?
I've never had that issue myself, make sure you have no overlapping controls and that they sit horizontally side by side and that you are using this is the on print property. The 'growing' should be taking place before the on print with the lines drawn to the 'tallest' textbox one in any group

Jim :)
Jan 21 '08 #6
ramies
2
i never expect that it would be so difficult to draw lines on the report. tremendous to understand. unusual programmer . what i had in mind to do is to make spaces on every record. make a new table and fill them all with same amount of data for every record line.
Feb 22 '08 #7
ramies
2
i need to study the code that you presented. anyway thank you
Feb 22 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: dixie | last post by:
I know I've asked this question in the last week, but no matter how hard I look, I can't find it. So I'll type it again. Is it possible to set the height of the detail section of a report using...
1
by: Tom | last post by:
In the Developers Handbook, Getz provides a way to create a survey report that displays either a line, Yes/No or multiple choice for each question. It's done by placing three controls (one for each...
4
by: Lyle Fairfield | last post by:
I had a Sproc which returned a field called Details. I had the Form Wizard create a continuous form with the Sproc as the RecordSource (as a shell for me to modify). I renamed the Details...
4
by: Mal Reeve | last post by:
Hello, I have a report that has only 2 levels of grouping. The detail section is simply 1 large block for a memo field. I am finding that on some occasions the report errors and generates...
0
by: Tim Marshall | last post by:
Access 2003. A report of mine was hanging on print preview. It turned out the issue was a bound text box where the data was too big to fit all on one page. When I changed the "keep together"...
4
by: Karl | last post by:
How do you set the width of a control in the detail section of a report using the On Format event for the detail section?
10
by: sara | last post by:
Hi - Is it possible to hide the detail section of a report at run time? I have a report that prints all details, with summary lines. The user would like the report ALSO with just summary lines....
1
by: peterkennett | last post by:
OK, I’m new to all this, so forgive me if I missed some easy answer to this problem! I have a report, which is actually going to be a letter. I had no problem adding my return address, salutation...
2
by: emckesso | last post by:
Hello, I need to create conditional formatting of a text box in the detail section of a report. The formatting is based on multiple parameters that are stored in a query. For example, pretend...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.