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

MSflexgrid to small in exe and Preview printout runs pagecount up instead of just priniting one page

Status
Not open for further replies.

Harry_Clipper

Programmer
Dec 2, 2020
12
DE
Hallo all,
sorry for my english...
I'm using VFP9 SP2

I have 2 problems:
1) I use msflexgrid on some forms (mandatory).
When I run it in VFP all my rows and cals are exactly so width and high as it should be.
In compiled exe the rows and col are very small:

here how it looks in the compiled exe:
in_exe_r8anch.jpg


should look like this in VFP environment:

in_VFP_asyhhm.jpg


It is all the same code!

Have anyone an idea how this comes?

2) I wanted to use Preview on some printouts.
I found this code :
************ start snippet **********7
LOCAL loRepPreview, loRepListener
loRepPreview = NULL

DO (_ReportPreview) WITH loRepPreview

loExtension = NEWOBJECT("MyInWindowFixer","preview_fixer.prg") && Contains the Class defined above

WITH loRepPreview
.Caption = "Druckvorschau"
.TopForm = .T.
.CanvasCount = 1
.ZoomLevel = 5
.Width = myform1.width + 200
.height = myform1.height + 100
.ToolbarIsVisible = .t.
ENDWITH

loRepPreview.SetExtensionHandler(loExtension)
loRepListener = NEWOBJECT('ReportListener')
loRepListener.ListenerType = 1
loRepListener.PreviewContainer = loRepPreview

Report Form anlage Range 1,1 NOCONSOLE OBJECT loRepListener &&Noconsole Preview

RELEASE loRepListener
RELEASE loRepPreview
******************* code snipped end **********
when I run the report with the above code i see the pagecounter runs up to 500 pages before I stop it.
It should be just one page.

When I run the report with :
Report Form anlage Range 1,1 NOCONSOLE preview

it just prints one page which is correct.

Have anybody an idea how this comes?

Thank you to all in advance.

Harald

then it prints one page (there should not more than one page)

when i run it with the
 
Hello all,

I solved it!

I want to let you know:

1) Solution for MSFLEXGRID to small in exe:
I have an sizer in the form but this gives a big problem because of the pixel to twips relation. The sizer worked strictly on pixel but flexgrid works with twips.
I removed the sizer from the form and than it works.

2) while printing, pagecount runs up when using preview reportlistener:
The solution was to shrink the height of the report (report consist only of head-band) to max 27,5 cm. Then the report got printed correctly with the rportlistener.

There is a diffenerenz in behavior from report form ... range 1,1 noconsole preview to Report Form ..... Range 1,1 NOCONSOLE OBJECT loRepListener in the max-length of the report.

harald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top