Problems with data positioning on printed output

BrettM

just a pert, "ex" to come
Local time
Today, 14:46
Joined
Apr 30, 2008
Messages
134
I am wanting a way to always get data printed in the right place - say starting exactly 10cm down from the top of the page.

I have set up a page on a canon inkjet printer which has a specific non-printable header and I can calculate exactly where to put a line on the page for that printer. Print the same thing on a HP and the line is in a different place. The standard non printable header is different.

Is there a way of using VB to check what this non printable area length is before committing the job to print?

...or better still, a way of positioning data correctly first time every time no matter what the printer is?

Regards Brett
 
Let me guess you are using window envelopes to send out letters and the address is in the wrong place.

Am I correct?
 
Way off base!

Am using a prestructured page that requires additional text in a specific place or it looks cheap and unprofessional. The text must line up no matter what the printer is... hence the question.

Same principle though. Any ideas?
 
Ok so I bombed out again... So are you using pre printed paper and wanting to fill in the spaces. If I am wrong again then can you post a couple of images to show what you mean?
 
Simplist example...

I want to draw a line on a printed report exactly 7cm from the top of the page.

Using Page Setup (File Menu) I see the top margin is set for 4.23mm.

I set the line to be 6.577cm from the top of the report.

It prints 7cm from the top of the page.

Print the same report on a printer with a top margin of 4.73mm and the line prints 7.05cm from the top of the page.

Close but no cigar.

So... How do I get the top margin preset value for the default (or specified) printer.

Brett

(I learn something new everyday unfortunately I forget two)
 
Have you already tried:

Printer.TopMargin

this is just a wild guess - I have no experience with VB printing.
 
I have come up with a solution... that doesn't work (yet)!!!

Here is a Subroutine.

Code:
Public Sub SetMargins(strRptName As String)
    DoCmd.OpenReport strRptName, acDesign
    With Reports(strRptName).Printer
        .TopMargin = 1134
        .Copies = 1
    End With
    DoCmd.Close acReport, strRptName, acSaveYes
End Sub

Report in question has a top margin of 4.23mm.
If I rem the DoCmd.Close and look at the newly opened report I see the top margin is now 20mm. Close the report and it asks to save (with the 20mm top margin). Obviously I don't save it at this time.

Remove the rem from the DoCmd.Close line and all seems to work however the top margin remains at the original 4.23mm. What am I missing here? Can anyone enlighten me?

Regards Brett
 
Glad you are making some progresss.

I don't understand your confusion. You are using code to dynamically resize the margin at runtime. It doesn't surprise me that the margins revert back to original designer-size after the execution. (Maybe I misunderstood you).
 
I am wanting to dynamically resize the margin however it is supposed to stick - not revert.

If I don't run the DoCmd.Close and save the report without opening the File/PageSetup to view the margins it does not save either. It only saves if I view the settings. This is not what I want to accomplish.

There is an issue with some printers (HP to be specific) to modify the margin settings on reports and stuff them up for any other more compliant printers (Canon Epson etc).

This piece of code is supposed to correct the top margin to one that I want before a report is printed thus allowing me to preset where data is going to be positioned and have it look great anywhere.

My issue is with the DoCmd.Close statement (I think) and why it will not actually save the setting for me.

Brett
 
You could always design separate reports for specific printers
 
...just how many makes, models and variants do you think there are Rich?
 
You could always design separate reports for specific printers
Nice suggestion. The IT dept at my company had a governmnent form to populate. They found that different printers unfortunately resized the output - and they never solved it. I think your suggestion may be the only solution.
 
On the other hand both VB and VB.Net allow you to specify X,Y points on the page to print - if you want to try creating your own report manually using code (that's a lot of work, and I don't know for sure that it will overcome this auto-resizing problem). You can probably use the Courier New Font to help the columns align. For a simple tabular report, it might work okay. Or you could try automating Word (again, with the Courier New font) because it has margins-control but I doubt this would solve the auto-resize problem.
 
We seem to be deviating from the thread a little here.

The problem as I see it is that whilst the top margin is being changed, it is not actually being saved using the DoCmd.Close. acSaveYes

User intervention (by accessing Page Setup) does show it has been changed and will allow it to be manually saved.

There has got to be a way of forcing this function through VBA.
 
...just how many makes, models and variants do you think there are Rich?
How do you know that every printer you wish to print on has the specific paper sizes that you have to print on set as the default?
There were also problems in some versions of Access with the Auto correct function overiding changes to print settings, maybe worth looking there
 
Nice suggestion. The IT dept at my company had a governmnent form to populate. They found that different printers unfortunately resized the output - and they never solved it. I think your suggestion may be the only solution.

I had one like this once - and I think we solved it by scanning the form, inserting it as a bitmap into the report, then drop transparent fields over the top of it.
 
Hm...The fix didn't seem to work for me, maybe because I'm using Access 2003, the fix is for Access 2000.
 
Hi Jal,

Just checked out that MS article. Designed to create custom page sizes. No mention of margin adjustments.

I am using plain old A4 size anyway.

Nice call though. Thanks for the input.

Regards Brett
 

Users who are viewing this thread

Back
Top Bottom