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!

Unwanted watermark with @/say in print 2

Status
Not open for further replies.

Venkatvc

Programmer
Dec 18, 2019
24
IN
Hello guys.

This is my first post. I have been programming in Foxpro for DOS a long time ago. (1995 - 2000). Just now I am trying to learn myself Visual Foxpro 9, by trials and error.

I have generated a report the old style, (using @... say), but I observed that there is a light watermark like a marker pen around the fields that are printed. (This watermark got printed in dot matrix printer too.) Also I observed that the mark was not around character fields. (The numeric fields have been printed using 'picture 9999.99' clause.)

I don't know what exactly I have to do to remove that watermark?
invsamp_xivmkn.png


Help me please.
 
Welcome to the forum - and to Visual FoxPro.

You might find it difficult to get an answer to your question here, given that most of gave up using @/SAY many years ago. However, if you could show us one of the @/SAY commands that produced this effect, we might get somewhere.

And for future reference, you will get better results from this forum if you give you posts a meaningful title - one that reflects the nature of your question. In this case, something like "Unwanted watermark with @/SAY" would give a better idea of the question than "New to Visual Foxpro", which could apply to anything.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike.

I've changed the topic heading.

By the way here is my code:
Code:
@prow()+2,0 say padc('MOTOR VEHICLES MAINTENANCE DEPARTMENT',80)
@prow()+1,0 say padc('CENTRAL AUTOMOBILE WORKSHOP',80)
@prow()+1,50 say 'Invoice No.:' + str(INV_NO,5) + '/' + iif(FUEL = 'P','P',iif(FUEL = 'D','D','U')) + '/' + FIN_YEAR
VFUEL = FUEL
@prow(),20 say 'FUEL INVOICE'
@prow()+1,5 say 'To'
@prow(),50 say 'Date :' + dtoc(INVOICE_DT)
@prow()+1,5 say BILL_OFF
@prow(),50 say 'Month of supply:' + cmonth(VTEMP_DT) + ' ' + str(year(VTEMP_DT),4)
@prow()+1,5 say BILL_DEPT
@prow(),50 say LEDGER_PG
@prow()+1,5 say BILL_ADD
IF EMPTY(group_no)
	@prow(),31 say 'Vehicle No:' + VEHICLE_NO
	@prow(),60 say iif(FUEL = 'P', "Petrol   ", iif(FUEL = 'D', "Diesel    ", "Unleaded Petrol"))
endif
@prow()+1,5 say replicate('-',80)
@prow()+1,5 say 'Sl.'
*@prow(),5 say 'Vehicle No.'
@prow(),10 say 'Date of'
@prow(),24 say 'Indent'
@prow(),35 say ' Fuel '
@prow(),43 say 'Rate'
@prow(),53 say 'Amount'
@prow(),63 say 'Oil Qty.'
@prow(),75 say 'Amount'
@prow()+1,5 say 'No.'
@prow(),10 say 'Supply'
@prow(),26 say 'No.'
@prow(),33 say 'Qty(Ltrs)'
@prow(),63 say '(Ltrs)'
@prow()+1,5 say replicate('-',80)

****************************

*   THE FOLLOWING PART IS THE CODE THAT GENERATED WATERMARK
*   THE VALUES PRINTED ARE DIRECT FIELD NAMES FROM MY TABLE (EXCEPT THE vslno WHICH IS A VARIABLE)

****************************

@prow()+1,5 say VSLNO picture '999.'
@prow(),10 say SUP_DATE     && stands for DATE of SUPPLY
@prow(),23 say INDENT_NO picture '9999999'
@prow(),35 say PETROL_QTY picture '999'
@prow(),43 say RATE picture '99.99'
@prow(),52 say PETROL_QTY * RATE picture '99,999.99'
VPETROL_TOT = VPETROL_TOT + PETROL_QTY * RATE
VTOT1 = VTOT1 + PETROL_QTY * RATE
@prow(),63 say OIL_QTY picture '99.99'
@prow(),73 say round((OIL_QTY * OIL_RATE),2) picture '9,999.99'
 
Well, the only thing that's different between the numeric fields and all the others is your use of the PICTURE clause. I can think of no reason for that to cause the effect you are seeing. But it would be worth eliminating it, just to be sure.

So, just remove the PICTURE clause from any one of the @ / SAY commands with a numeric field, and see what happens. Never mind if the numeric formatting is incorrect. We can deal with that separately. Just see if it makes the problem go away.

Of course, the ideal solution would be to abandon this code entirely and to use the VFP report generator instead. I appreciate that you are just starting out with VFP and you will have a lot to learn, but you will be doing yourself a favour if you get to grips with the reporting tool sooner rather than later.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I have previously worked with CrystalReports, but this VFP Report Writer looks completely different. However I have to compulsorily move towards VFP reports.
 
I second Mike's recommendation because even when you fix this background shading, the invoice looks dating back to times you printed with a ball printer.

Also, if you still have Crystal in a version supporting COM automation Mike could tell you how to use that from VFP. I also guess it's not impossible with newer versions, but got more complicated.

Mike's observation is right, of course, but looking into the VFP help coming from VFPX including legacy commands and function reference I see the picture clause only is formatting output quite like TRANSFORM does with a format "@R....". This means, in case of your nines that's just specifying the number of decimal places, separator positions, and decimal point positions.

The help tells about color and style options not used, so the output should be by usual color scheme and therefore I'd bet you get the same color/shade effects as you get for @GET commands defining input boxes by coloring/shading character positions on screen in the same way. So you'd need to look into how such color schemes are defined. I never worked with the legacy FoxPro, a quick glance shows there is a SET COLOR OF SCHEME Command, but you'll have to dig into it to know which color would need to be set.

Bye, Olaf.

Olaf Doschke Software Engineering
 
I am terribly surprised. I just removed only one picture clause and see the result.

I have given the part which generated the watermark.
Code:
@prow()+1,5 say VSLNO picture '999.'
@prow(),10 say SUP_DATE     && stands for DATE of SUPPLY
@prow(),23 say INDENT_NO    && picture '9999999'       <-- The only line where I removed the picture clause
@prow(),35 say PETROL_QTY picture '999'
@prow(),43 say RATE picture '99.99'
@prow(),52 say PETROL_QTY * RATE picture '99,999.99'
VPETROL_TOT = VPETROL_TOT + PETROL_QTY * RATE
VTOT1 = VTOT1 + PETROL_QTY * RATE
@prow(),63 say OIL_QTY picture '99.99'
@prow(),73 say round((OIL_QTY * OIL_RATE),2) picture '9,999.99'

And the result is:
invsamp1_dditbp.png


I cannot think what was wrong earlier, and what went right now. [ponder]
 
So, you are saying that you only removed one PICTURE clause, but now all the shading has gone? If that's right, I am as surprised as you are. I've never seen this before. But I'm delighted that it works.

But our earlier advice still stands. You should definitely migrate to a proper report writer. Most of use here use the official VFP report generator (and many also use Foxypreviewer or XFRX in place of the VFP report preview window). But you can continue to use Crystal Reports (CR) if you prefer. You are right that CR is very different from the VFP report tool. I hesitate to say it is better. They each have their pros and cons. On balance, CR has many more features, but the VFP tool has the big advantage of being fully integrated with the main development environment.

Whatever approach you finally take to reporting, good luck with your migration to VFP.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Ha..ha..

It was just one day and the shading is back even without using the 'picture' clause. Additionally there is shading wherever I used the 'Style' clause.

invsamp2_yp87sb.png


However, my client said that this output was enough for them. But, this thing is driving me mad. (The text 'Vehicle No.:' wasn't supposed to print bold. I have styled BOLD the data only, but this caption also gets printed in bold. I don't understand the behavior.

I am trying to upgrade the program that I developed in 2000, and the software is still in use. I can't stop it until I learn to use report writer of VFP. (I wonder, how those fellows used this for nearly 2 decades. I quit that organization long back.)

They were using old machines which had the old-style printer ports, so they continued to use my DOS version program. Now, they had to compulsorily change the OS and motherboard which has only USBs, obviously the DOS version foxpro stopped printing. Only when they tried to take reports, they noticed it. Since all the data is already fed in the older version, I urgently had to upgrade the DOS version reports into a decent report.

Now I have time to explore the Report Writer.
 
If that's the case you get RS232 ports as USB Hardware device, have to set them up as COM1 or whatever you need once and then can address them in the legacy way. But if you really want to move to Windows, well, you have work to do, that could have been spread out over a decade.

It typically ends up in one of two ways: You find your way into hard/software keeping up enough compatibility or you have to reimplement.

Search for TameDos in this forum and you find a few threads.

Bye, Olaf.



Olaf Doschke Software Engineering
 
Since they got VFP, I don't want to go back to DOS. For data entry too, I have designed and given them few quick forms, so at present the problem is postponed.

Moreover as per their own experience, even when the DOS version was working, they had to quit Foxpro and then only the reports started spooling. Until then it was somewhere in the memory, it seems.

For me, it's like repairing an engine while it's running. Any wrong command could cause severe damage. Everytime I am taking a back up before trying out new program or report.

Thanks for the help, Mike & Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top