Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with hacked report

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
Hi to all

For years I do hack a report at runtime to enable my users to use custom dimensions and orientation while printing an envelop.
Out of the blue the left part of the envelop does not print anything.
The hack exists of:
go top
replace expr WITH "ORIENTATION=" + lcOrientation + CHR(13) + "PAPERSIZE=" +lcPapersize

By removing
"ORIENTATION=" + lcOrientation + CHR(13) +
all is printed (but in wrong page-orientation)

any ideas?

KR
-Bart
 
Bart,

You say this happened "out of the blue". But something must have happened to trigger it. There must have been some change in the environment somewhere: the printer driver, the printer settings, the printer itself, the type of envelope, the method by which the user feeds the envelopes into the printer, or even the version of Windows.

If you could identify what has changed, you will be half-way to solving the problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I'm with you Mike.
The only difference has to do with the OS.
I always used win 7 and win 8.1. So far so good.
But both my two laptops, one holding XP and one holding win7 do show up the errors
I need to find an old win7 machine to see what happens than.
Also I will follow yr advice by checking printer(drivers)
-Bart
 
There are more printer settings than orientation and papersize. There are margins, for example. You can't control everything with expr, eg I don't know a margin setting, but you should simply take a look at printer settings. If there's no margin setting explaining that, take a close look at the paper feed tray on how to feed envelopes at which side and in which orientation.

Bye, Olaf.
 
The fact that this is happening on some machines and not others confirms that it is an environment problem rather than a programming issue. So, first check to see if different versions of the printer driver are installed. Also check the printer properties on each machine.

You might need to delve quite deeply. For example, with my HP Laserjet driver, the paper size is specified in two different places (on the Device Settings page, and in the Printing Preferences dialogue).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I was under the impression that for this fix to "take", you have to clear TAG and TAG2
 
Clearing the tag fields of a report you give the printer settings full control. It's ok o have some settings in these fields, other solutions are multiple printer installations with differen settings you just adress by name, eg HPNORMAL and HPENVELOPEs, then you don't need to hack the frxes to have the needed settings, instead you switch settings via SET PRINTER TO NAME ... This just requires a certain discpiline of the customer to keep the settings for the different printer names.

But in general just deleting the tag fields is not the only way to work with reports. In corner cases it also might be very OK to have embedded printer info in reports, if that is a solution customized to one work desk and printer.

Bye, Olaf.
 
Problem solved. After I reinstalled the printer it worked as before.
@drdolittle: yr right but my users do put the papersize and paper direction [landscape] of the envelop in here which [I found] is not always possible with every printerdriver.
Furthermore my users can choose their own font/size and location of sender and address on the envelop.
This all by hacking the report.
@Olaf : for years I give my users the opportunity to "set" a leftmargin just by hacking the report by shifting all controls in horizontal way according the requested margin. And yes, it's not a real margin and I have to take care while creating a report to not loose data from the most right control this way.

Anyway : all again thank for thinking over this behaviour.
-Bart
 
>for years I give my users the opportunity to "set" a leftmargin just by hacking the report by shifting all controls in horizontal way according the requested margin.
That's okay, but has nothing to do with what I said about the printer settings. Each printer has a different printable area, which is due to the physical limitations of the area the printhead can move to or the paper can be moved to, but there are also printer settings, that may limit and change that further, so these settings are on top of your margin. Restoring default by reinstalling the printer driver just confirms what I thought.

Bye, Olaf.
 
OLaf,
What I meant to say is [you may discuss wether or not you like to do so] that my users never set a margin at an other place than in my app; same for envelop size.
KR
-Bart
 
Bart,

Printer settings may also change without user intervention, eg due to windows update. I just said you should look at it, no matter if nobody changes these, because they are the most probable cause of this. You indirectly proofed the driver and most probably a setting were the cause by solving it with printer driver reinstallation.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top