• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1245
  • Last Modified:

Thickness of lines using DrawWidth in reports

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
tbsgadi
Asked:
tbsgadi
  • 11
  • 6
1 Solution
 
puppydogbuddyCommented:
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
 
tbsgadiAuthor Commented:
That's my point..All the fonts are the same & I don't touch DrawStyle
0
 
puppydogbuddyCommented:
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
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
tbsgadiAuthor Commented:
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
 
puppydogbuddyCommented:
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
 
tbsgadiAuthor Commented:
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
 
puppydogbuddyCommented:
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
 
tbsgadiAuthor Commented:
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
 
puppydogbuddyCommented:
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
 
puppydogbuddyCommented:
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
 
puppydogbuddyCommented:
Gary,
How did you finally resolve this?
0
 
tbsgadiAuthor Commented:
I didn't!
0
 
puppydogbuddyCommented:
Oh....then you should have requested a refund.
0
 
tbsgadiAuthor Commented:
You deserve something for your hard work!
0
 
puppydogbuddyCommented:
Thanks Gary.  I will keep my eyes open for a solution and let you know if something turns up.
0
 
puppydogbuddyCommented:
Gary,
this link may have what you need to resolve your questions:

              http://safari5.bvdep.com/0789730049/ch09
0
 
puppydogbuddyCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 11
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now