Solved

Thickness of lines using DrawWidth in reports

Posted on 2006-11-06
17
877 Views
Last Modified: 2009-07-29
Hi Experts,
I'm using the Line Function to draw some thicklines in my report
I've got lot's of code similar to this scattered around different reports.

Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
Me.DrawWidth = gBorderWidth
Me.Line (0, 0)-(0, 1000)
Me.Line (ScaleWidth, 0)-(ScaleWidth, 1000)

End Sub

The code works ..however in one report I set gBorderWidth=7 & in another I have to set it to 13 to get the same line thickness.

I've now changed both reports so that they have the same width, same margins etc etc.
I don't use Scalemode
The only difference in the reports is the length.
Why don't the thickness of the lines come out the same?
0
Comment
Question by:tbsgadi
  • 11
  • 6
17 Comments
 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 500 total points
ID: 17880973
Gary,

I believe the line thickness defaults to that of the font used in the report, unless the draw width is specified as shown below:

           Me.DrawWidth = 13              ' larger number, thicker line
           Me.DrawStyle = 0                ' 0 to 6 = solid to invisible

PDB
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 17881014
That's my point..All the fonts are the same & I don't touch DrawStyle
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17881204
Gary,
My mistake...it defaults to the thickness of the line in the line tool from the toolbox, unless the draw width is specified.  See this link:

            http://office.microsoft.com/en-us/access/HP051878451033.aspx
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 17881230
I do specify the draw width & I don't have any lines in the report.
In one report I specify 80 to get the same line as another where I write 7 !
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17881378
Gary,
In your code (above), you specified a relative size for your draw width (= gBorderWidth)....you did not specify any absolutes as I do in my code (Me.DrawWidth = 13).  In addition, you have changed other properties as well. I suggest that you go to the toolbox and set the (absolute) defaults for the drawing objects you use, as implied in the link I gave you.  Once you set the default properties for objects in your toolbox, you won't need to refer to these properties in code, unless you are overriding the default.
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 17881444
First of all I want a line thicker than 6 points & secondly I'm drawing lines in code.
gBorderWidth is just a property I set it to 7 ,13 ,or 80 depending on the report.
I get the same results if I put in an absolute.
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17881862
Gary,
I am not going to split hairs with you on this.  As I told you, the final presentation in your report is based on a combination of factors, including the font, the border width, line thickness, scale height and width....all of which have default properties. Until you eliminate your use of relative defaults and set absolute defaults ( either in code or in the property sheet) for each and every object that is impacting your final presentation, you will continue to have to adjust from report to report....unless, maybe if you create a template report via the auto format tool, that you will use for any new reports that you create.
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 17887370
I changed eveything to absolute defaults but it didn't help...:<
The only thing I can do is to build all the reports from scratch... which was what I was trying to avoid.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17888023
Gary,
Wow! The only thing I can think of is that there are some constraints that are not being followed.  For example:  If you set the BorderWidth property of the Line control greater than one, the BorderStyle property has no effect.

The only halfway decent reference I can find on the subject is at this link under the section entitled "Creating Graphics"  (about halfway down the web page):

           Que Platinum Edition Using Visual Basic 5 -- Bonus Chapter 1 -- Doing Graphics
         http://podgoretsky.com/ftp/Docs/Basic/Using%20Visual%20Basic%205/apc.htm

        Maybe this reference will help you ...it contains sample code.  If this doesn't help, let me know.  

Also. re doing your reports from scratch....I don't think you need to do that .......Before creating reports from scratch, I would use the customized autoFormat option to create templates as follows:
To use any existing form or report or a specially created form or report to use as a template:

From the Tools menu (View in Access 2), choose Options
select Form & report design
type the name of the form or report in Form Template or Report Template
Using Autoformat
In Access 2000 you can standardise Forms and Reports with autoformat (having a form/ report called Normal does not seem to work anymore). AutoFormat automatically applies a standard formatting styles to a form. To use AutoFormat, add a customized format to the Form AutoFormats list by the following method:
Create a form that uses your standard fonts, colours, borders, background bitmaps, and control properties.
With the form open in Design view, go to Format/ AutoFormat, and click Customize.
Under Customize options in the Customize AutoFormat dialog box, select Create A New AutoFormat Based On The Form and click OK.
Enter a name for the standard style in the New Style Name dialog box, and click OK.
Click Close.
When you want to apply the standard formats to a form, open the form in Design view, select Format/ AutoFormat, select your style from the Form AutoFormats list, and click OK.
If you need to update your standard style, create a form that includes the changes, select Format/ AutoFormat, and select the style you want to update from the Form AutoFormats list. Click Customize, and select the update option under Customize Options. Click OK twice.  

Hope this helps.

PDB
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17888123
Gary,
Maybe this will help.  Excel's macro recorder will record drawing objects and shapes.....crate your objects in excel, then you could look at the code generated in the macro.....and compare it to the code you have.

     http://support.microsoft.com/kb/213526/en-us

0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17946685
Gary,
How did you finally resolve this?
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 17946725
I didn't!
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17947341
Oh....then you should have requested a refund.
0
 
LVL 46

Author Comment

by:tbsgadi
ID: 17947356
You deserve something for your hard work!
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17947436
Thanks Gary.  I will keep my eyes open for a solution and let you know if something turns up.
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17948011
Gary,
this link may have what you need to resolve your questions:

              http://safari5.bvdep.com/0789730049/ch09
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17948092
Gary,
Excerpt from the link:  http://safari5.bvdep.com/0789730049/ch09lev1sec4#ch09lev1sec4
           Did You Know?
You can set control defaults. When you create a control, you can set the initial formatting. Create a control, format the control the way you want, click the Format menu, and then click Set Control Defaults
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now