drawing excel like grids on access reports

Hi All,
I want to draw excel like grids on my access reports. The line should start 
from the top of each label in the page footer to the bottom of the 
corresponding text box in the page footer.(For each text box in the detail 
section, there's one unbound text box in the page footer to display totals). 
I don't know how to do this. can anyone please help me?
-- 
from
chanakya
Baruva
0
Utf
4/16/2010 3:19:01 PM
access.reports 4434 articles. 0 followers. Follow

8 Replies
1094 Views

Similar Articles

[PageSpeed] 11

Can't you use rectangle or line controls in your various sections? These 
should work unless your sections are set to Can  Grow. If this is the case, 
you may need to use the Line method in the report's On Print events to draw 
the lines.

-- 
Duane Hookom
Microsoft Access MVP


"Access infant" wrote:

> Hi All,
> I want to draw excel like grids on my access reports. The line should start 
> from the top of each label in the page footer to the bottom of the 
> corresponding text box in the page footer.(For each text box in the detail 
> section, there's one unbound text box in the page footer to display totals). 
> I don't know how to do this. can anyone please help me?
> -- 
> from
> chanakya
> Baruva
0
Utf
4/16/2010 9:36:01 PM
I have tried what you told but it looks quite awkward when there's different 
groupheaders in between on a page. So, I will choose to use the code to draw 
lines  across different groups using line method if only i can get help from 
you
-- 
from
chanakya
Baruva


"
0
Utf
4/17/2010 3:00:01 AM
Any help from you regarding my comments on Can Grow? I generally set the tag 
property of controls that I want to add borders. I can then loop through the 
controls in a section and use the line method to draw vertical or horizontal 
lines using the Left, Top, Width, and Height of the appropriate controls as 
starting and ending points of the lines.


-- 
Duane Hookom
MS Access MVP


"Access infant" <Accessinfant@discussions.microsoft.com> wrote in message 
news:3B701491-E096-4A1B-990D-31539FCBAA80@microsoft.com...
> I have tried what you told but it looks quite awkward when there's 
> different
> groupheaders in between on a page. So, I will choose to use the code to 
> draw
> lines  across different groups using line method if only i can get help 
> from
> you
> -- 
> from
> chanakya
> Baruva
>
>
> " 

0
Duane
4/17/2010 7:02:38 PM
Actually i have added some unbound controls in the different group footers 
and the report and page footers also. so, in order to make sure that the line 
would be straight, can i take the left of a control in the detail section 
only and store it in a module level variable and use the same value in all 
sections 'on print' event. so that the line could be straight ? If you don't 
feel that i am expecting too much of you, could you please give me code for 
one section which i can use with changes (if needed)  for other sections 
also.Or at least direct me to a link where i can get some sample code.
-- 
from
chanakya
Baruva


0
Utf
4/18/2010 3:49:01 PM
I'm not exactly sure how you have these controls setup. But again, I like to 
put something in the tag property that identifies if a control should have 
lines on its left, top, right, or bottom. Consider entering any combination 
of LTRB for these sides into the tag. Then you might have code in the On 
Format event of a section like:

Dim ctl as Control
dim strTag as String
For Each ctl in Me.Controls
    strTag = ctl.Tag & ""
    If Instr(strTag,"L") Then  'left
       Me.Line (ctl.Left, clt.Top)-Step (0,clt.Height)
    End If
    If Instr(strTag,"T") Then  'top
       Me.Line (ctl.Left, clt.Top)-Step (clt.Width,0)
    End If
   'duplicate similar code for left and bottom
   'the line method uses the first (x,y) as the x and y position in the 
section
   '   the Step argument is used to set the (x,y) to relative to the first 
(x,y)
Next


-- 
Duane Hookom
MS Access MVP

"Access infant" <Accessinfant@discussions.microsoft.com> wrote in message 
news:D1879C01-B9D2-4611-807E-2248D13F94AA@microsoft.com...
> Actually i have added some unbound controls in the different group footers
> and the report and page footers also. so, in order to make sure that the 
> line
> would be straight, can i take the left of a control in the detail section
> only and store it in a module level variable and use the same value in all
> sections 'on print' event. so that the line could be straight ? If you 
> don't
> feel that i am expecting too much of you, could you please give me code 
> for
> one section which i can use with changes (if needed)  for other sections
> also.Or at least direct me to a link where i can get some sample code.
> -- 
> from
> chanakya
> Baruva
>
> 
0
Duane
4/18/2010 7:17:18 PM
Thanks a lot for the code. But i have been saying that i have controls in the 
group headers and footers  for each control in the detail section. for 
example if i have three controls x,y,z i have unbound controls in the page 
footer, report footer,other groupfooter to show the totals at various level 
for each control viz. x,y,z. So, if i follow your code and suppose control X 
changes in size(because of the can grow property), i cannot see the same 
change in the unbound controls displaying total for x. So, there is no 
guarantee that the lines look like grids because they do not fall on a 
straight line. To work this around, can i store the Left property of each 
control in the detail section in a module level variable and use the same 
wherever i want to use ctl.Left.
Any how i want to draw only vertical lines. Please suggest me if it is  
possible? 

Or to follow your code as it is, probably i need another piece of code to 
make sure that the ctl in the detail section and the corresponding ctls in 
the different sections have same left property and width property. If you 
think this is better, could you tell me how to ensure this
-- 
from
chanakya
Baruva



0
Utf
4/19/2010 4:26:01 PM
I would expect your controls in the different secitons to have the same left 
and width. Is there any reason why they couldn't?

I have asked twice before about the Can Grow and you have finally mentioned 
something about this. The grown Height of a control can only be determined in 
the On Print event (not the On Format). 

You don't need module level variables since your code can reference the 
properties of any control from any section of the report.

-- 
Duane Hookom
Microsoft Access MVP


"Access infant" wrote:

> Thanks a lot for the code. But i have been saying that i have controls in the 
> group headers and footers  for each control in the detail section. for 
> example if i have three controls x,y,z i have unbound controls in the page 
> footer, report footer,other groupfooter to show the totals at various level 
> for each control viz. x,y,z. So, if i follow your code and suppose control X 
> changes in size(because of the can grow property), i cannot see the same 
> change in the unbound controls displaying total for x. So, there is no 
> guarantee that the lines look like grids because they do not fall on a 
> straight line. To work this around, can i store the Left property of each 
> control in the detail section in a module level variable and use the same 
> wherever i want to use ctl.Left.
> Any how i want to draw only vertical lines. Please suggest me if it is  
> possible? 
> 
> Or to follow your code as it is, probably i need another piece of code to 
> make sure that the ctl in the detail section and the corresponding ctls in 
> the different sections have same left property and width property. If you 
> think this is better, could you tell me how to ensure this
> -- 
> from
> chanakya
> Baruva
> 
> 
> 
0
Utf
4/19/2010 6:46:01 PM
Thank you very much. I have so far thought that can grow property changes the 
width of a control. NOw i am clear about it.
At first i thought that code you gave in Me.controls refers to  only the 
controls in the section for which we are writing the code. But you have 
enlightened me that using the tag property for the controls in the detail 
section, i could make sure that lines in  every section would be drawn as per 
the left and other properties of the controls in the detail section only. 
Thanks a lot and lot for your help. It helped me a lot.
-- 
from
chanakya
Baruva



0
Utf
4/20/2010 2:42:01 AM
Reply:

Similar Artilces: