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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

defaults print screen (forms)

Status
Not open for further replies.

yellowke

Programmer
Nov 5, 2002
48
BE
Hi,

when I have a form and I use the the print button on it I get a screen: the output screen.

By default the values stand on:
output type: print list from table
choose record: all

Is it possible to change this in
Output type: report
choose record: current?

thanx
Yellowke
 
Since the behavior you describing is the default behavior of the Print dialog form created by using the wizard, and the code for that is buried deeply in the wzbtns.vcx (the txtbtns class) and it also makes use of two other classes to generate the print dialog (_outputdialog,_reports), it isdifficult (and also not recommended) to modify these classes, since they are part of the VFP framework. I would suggest you override the behavior (by Using NODEFAULT in the print button) and create your own Print dialog form. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
ok I made myself a button print and I use this command to print:
REPORT FORM u218sub8 to PRinter prompt

But when I select a record in the form and press the button, the report prints everytime with the data of the first record of the database. So how can i print the selected record?

Anyone an idea?
Thanx
 
yellowke

1. Either you set a filter in your table on the current record.
2. Or instead, you create a cursor with the current record, with all the fields required for your report, and base your report on the cursor, instead of the original table.

Note: The second suggestion is the better one, bcause setting a filter on a large table is not recommend. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Yellowke

REPORT FORM u218sub8 to PRINTER PROMPT NEXT 1

:)
ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
REPORT FORM u218sub8 to PRINTER PROMPT NEXT 1
didn't help.
I still get the first record.

On the screen I have selected a different record than the one that's printed.

Anyone another idea?
 
Is there maybe a way to see on which record you are in the table?
 
yellowke

Have you tried my suggestion? Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Can you give me a bit more explanation mgagnon. I'm still a beginner ;)

I shall try to describe the situation as good as possible.

I have a single table. I want to print certain records of it on a report and I want to add and delete records in the table.
So I made a form and a report.
If you use the wizard you get a form with the buttons prev, next, ...
I made my own print button, and with this button I want to print the record I selected via the prev and next buttons on the form. The problem is that everytime I press the button I print the first record of the table but I want to print the selected record.

in the click event of the button stands the following code:
REPORT FORM u218sub8 to PRINTER PROMPT

Is it possible to find which record I selected in the form?
Maybe then I can use this code:
REPORT FORM u218sub8 to PRINTER PROMPT record x

Or can anyone give me some help with this cursor things?
 
In your print button, you can save off a value in the table; RECNO(), LastName + FirstName, SSN, etc. Then you can do something like:

STORE RECNO() TO nRec
REPORT FORM u218sub8 FOR RECNO() = nRec to PRINTER PROMPT

-or-
STORE LastName + FirstName TO cName
REPORT FORM u218sub8 FOR LastName + FirstName = cName ;
to PRINTER PROMPT
Dave S.
 
This works DsummZZZ :)

Everybody thanx for the help

Yellowke
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top