Solved

Thickness of lines using DrawWidth in reports

Posted on 2006-11-06
17
995 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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
 
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

696 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