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

label preview

Status
Not open for further replies.

hyonos

Technical User
Apr 2, 2003
46
0
0
IT
for run normal report preview, i use this code:

PUBLIC oPrint
oPrint= CREATEOBJECT("printPreview")
oPrint.SHOW()
REPORT FORM (rp) PREVIEW WINDOW PrintPreview IN WINDOW PrintPreview IF VARTYPE(oPrint) = "O"
oPrint.RELEASE()
ENDIF


DEFINE CLASS printpreview as Form
titlebar = 0
Showwindow = 2 &&Top level
autocenter = .t.
name = "PrintPreview"
height = SYSMETRIC(2) && This will maximize the preview
width = SYSMETRIC(1)&& This will maximize the preview
ENDDEFINE


Now i want create a label preview and use this code:

LABEL FORM (rp) PREVIEW

this code open label preview in scren inside my application. but my form is top level form, and the form is over the preview.

how to have label preview like report preview?

tnx to all
 
hyonos,

I noticed that for the report, you had the line

REPORT FORM (rp) PREVIEW WINDOW PrintPreview IN WINDOW PrintPreview

but for the label you say you just have the line

LABEL FORM (rp) PREVIEW

Is that in fact what you have? It sounds to me like the label preview would work if you used the same syntax as for the report preview.

Hope that helps,

Stewart
 
solution found !
i want tnx Stuart D.

Stuart write me:
"I see that LABEL FORM has no documented IN WINDOW clause. But have you tried it anyway?"

LABEL FORM (rp) PREVIEW IN WINDOW PrintPreview

this code work fine :)

 
hyonos,
just in addition:

try avoiding label forms
use instead report form; also with that you can print labels use menu-> file than page-setup

label forms are backwards compatible with former visual foxpro versions

-Bart
 
Nifrabar

label forms are backwards compatible with former visual foxpro versions

I wonder what would make you say that? I'm looking at VFP7.0's help files and VFP8.0's help files and MS usually indicate if its for backward compatibility or not, and I noticed in VFP8.0 that added new label format. I think that it would cause a lot of problems if they were to discontinue. Is this fact documented?



Mike Gagnon

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

try avoiding label forms .. use instead report form ...label forms are backwards compatible

Are you sure about that? The label form has an important feature that report forms do not have: the ability to step and repeat across and down the page. I don't see how you can do that with the report designer.

I use the label designer quite a lot, and have seen no suggestion that it is for compatibility only.

Mike


Mike Lewis
Edinburgh, Scotland
 
Mike Lewis,

In March of this year I discussed with Anders Altberg this issue.
The reason for the discussion was that I liked to preview my labels in a custom window (e.g. using code like:

oRepForm=createobject("Form")
with oRepForm
.Titlebar=0
.WindowState=2
.Show
endwith

if lcSoort="report" && can be 'report' or 'label'
KEYBOARD "Z" PLAIN
&lcSoort form (this.parent.rptName) preview window(oRepForm.Name) to print prompt
else
KEYBOARD "Z" PLAIN
&lcSoort form (this.parent.rptName) preview
endif


He pointed me to the fact that the label command is retained for backwards compatibily only. (maybe therefore the optional clause 'in window' is left out for labels ?)

As he has a 'degree' on vfp I do believe him blindly.
(is this good english? <G>)

As far as I can see I don't miss an option by printing labels using the report command. Or do I oversee some ?

I can print that way in columns and I can decide to print the lables from top to bottom each column or from left to right each row.

-Bart
 

Nigrafar

As he has a 'degree' on vfp I do believe him blindly.
(is this good english? <G>)


I know Anders and what he does, and honestly if it doesn't come from Microsoft, I'm going to continue using labels and not worry about it.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,
Do you see any advantage for using labels versus reports ?
-Bart
 
Mike,

The label form has an important feature that report forms do not have: the ability to step and repeat across and down the page. I don't see how you can do that with the report designer.

I'm not sure I understand what you're saying, but I think a multi-column report would do that for you.

Mike and Bart,

Labels still have an advantage over reports in that you have huge flexibility with the dimensions of each label, in both height and width, and more flexibility in page length.



-BP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top