473,406 Members | 2,954 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,406 software developers and data experts.

How to find a position of a control on report's page?

20
Hi All,

I want to place a promotion message into a report's page if that page has a free/blank space.

Maybe it would be better to track last control's coordinates on page when page is generated, and then after that control to place a message. But I don't know how to find controls coordinates on page. Any ideas?
Jan 31 '11 #1

✓ answered by TheSmileyCoder

Hi bdmir

In your details Format event, you can use Me.Top to indicate where your detail STARTS.

If you need to know where you detail ENDS it depends on whether you have fields that can grow. If you dont its simply a matter of taking the lowest/bottom-most control on your detail (lets say tb_Example) and it would look like:
Expand|Select|Wrap|Line Numbers
  1. Dim lngBottom as long
  2. lngBottom=Me.Top+Me.tb_Example.Top+Me.tb_Example.Height
Now if you do have controls that can grow, you can use Stephen Lebans fCanGrow code to determine the height of the growing control, and adjust the code accordingly.

I have used code such as this myself, to determine whether or not to force a pagebreak after a detail.

3 3938
TheSmileyCoder
2,322 Expert Mod 2GB
Hi bdmir

In your details Format event, you can use Me.Top to indicate where your detail STARTS.

If you need to know where you detail ENDS it depends on whether you have fields that can grow. If you dont its simply a matter of taking the lowest/bottom-most control on your detail (lets say tb_Example) and it would look like:
Expand|Select|Wrap|Line Numbers
  1. Dim lngBottom as long
  2. lngBottom=Me.Top+Me.tb_Example.Top+Me.tb_Example.Height
Now if you do have controls that can grow, you can use Stephen Lebans fCanGrow code to determine the height of the growing control, and adjust the code accordingly.

I have used code such as this myself, to determine whether or not to force a pagebreak after a detail.
Jan 31 '11 #2
bdmir
20
Thanks for the quick reply. Yes, I do have growing controls. I will try to do something with Me.Top. Found Stephen Lebans fCanGrow, I will try with that one too. Thank you very much.
Jan 31 '11 #3
TheSmileyCoder
2,322 Expert Mod 2GB
Stephen Lebans CanGrow
You can still find that code, and alot of other usefull code on his site.
Jan 31 '11 #4

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

Similar topics

1
by: bradwiseathome | last post by:
I have some web-server-side code that may place a textbox anywhere on a page. It might be on the page itself, it might be within a <form>, it might be within a <div> in the form, or in a <div>...
1
by: Dan | last post by:
I have an asp.net page default.aspx with a user control and a placeholder control. <html> <body> <form id="myform" method="post" runat="server" /> <PageHeader:Header id="header1"...
2
by: David | last post by:
Say a asp:textbox control on the web form. Where is it in the hierarchy of the page object. I found out that it is not in page.Controls. Looking at the Locals window where stepping through the...
4
by: Edward | last post by:
hi, everyone, my Page_Load fill tblProducts with some TextBox. <form runat="server"> <asp:Table id="tblProducts" runat="server"></asp:Table> <hr> <asp:Button id="Button1"...
5
by: PCH | last post by:
I have an c# asp.net (.net 1.1) web page, viewstate on. The problem I am having is on the button click postback to update. Heres the situation: I have an asp table that has 1 header row. ...
1
by: Bruce | last post by:
I use btnSave.Attributes.Add("onclick", "ShowMessage()") to link my web control button to a JavaScript function. It works well until I added a Validation control into the page. After that,...
3
by: jkarpago | last post by:
Hi: I need to find what control is in some position given. I mean, if I give the values left: 200px and top 300px I need to know what control in the page is in that position, or if there is not...
5
by: gnewsgroup | last post by:
In my user control, I would like to find a Label control in the parent page (the page that uses my user control). I need to update that Label.Text when something happens in the user control. I...
2
by: shapper | last post by:
Hello, I have a control named Parent in my page. Parent has many child controls under it which also have other child controls under them. I need to find a control named "A" which i don't know...
2
by: Poofactory | last post by:
HI, I have a control on a content page that I need to access and modify a MasterPage variable. I can find the control alright: if (Parent.Page.Master.FindControl("Adserver_TopBanner1") !=...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.