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!

Windowstate = 2 not fully working in report viewer 1

Status
Not open for further replies.

kamweng

Programmer
Jan 20, 2012
36
MY
I'm sure this is an old topic but my search in this forum is not fruitful.

Code:

I noticed the report viewer title bar showed the "Maximize" button and when I clicked it, the report will then maximized.

KEYBOARD "{CTRL+F10}" have no effect on the report viewer.

If I changed the windowstate to 1, the report viewer became very small. Thus, the windowstate is indeed 2 but it is not fully maximized.

All help is valued. Thank you.
 
Sorry, the code is as follow

OREPFORM = CREATEOBJECT("Form")
WITH OREPFORM
.WINDOWSTATE = 2
.SHOW()
ENDWITH
REPORT FORM J:\JMB\r_DBT_LOT NOCONSOLE PREVIEW WINDOW (OREPFORM.NAME)
OREPFORM.RELEASE()

Thank you.
 
The base form has the name Form1, also many forms, even scx form you design at runtime have name Form1, and so that may be a reason.

I actually never use the Window clause of REPORT FORM, but it should be better, if you set an explicit name, eg with

Code:
OREPFORM = CREATEOBJECT("Form")
WITH OREPFORM
.WINDOWSTATE = 2
.NAME = 'reportprreviewform'
.SHOW()
ENDWITH
REPORT FORM J:\JMB\r_DBT_LOT NOCONSOLE PREVIEW WINDOW reportprreviewform
OREPFORM.RELEASE()

By the way: If you want the report core page area to adapt to the full width of the window, that won't work that way. Even with the native preview window, you get no zoom, also previews look odd when zoomed. The preview is not meant to work that way, instead it adapts to the screen dpi and if you adapt that to a dpi filling the screen width, you won't get the desired layout on paper, that's a risky thing to do.

What you can do is save all settings of the preview toolbar, including zoom factor, insode foxuser.dbf and have it in place when repeating the report preview, but I never played with that and you'd need several settings for many monitor resolutions and densities. It would perhaps be easier to adapt the preview to the screen using the reportlistener class and it's gdiplus capabilities to draw the canvas. Be prepared you are reinventing the preview generation just for getting the zoomed look of the preview and may do this two times for the preview and the final print pass.

It's obviously easiest to live with the preview not auto panning and zooming, it's just a preview and if a user needs to zoom, he can.

Bye, Olaf.
 
This sounds like the old problems we had with BROWSE.

The WINDOW clause says where the report will get its appearance.
The IN WINDOW clause says where it will appear.

so you want WINDOW reportpreviewform IN WINDOW reportpreviewform

I think. It's been a while since I've tried this.
 
danfreeman said:
This sounds like the old problems we had with BROWSE

Thanks to the above hint, instead of WINDOWSTATE = 2, I changed it to
WINDOWSTATE = 0
HEIGHT = 900 && My form height
WIDTH = 1440 && My form width

Now my report viewer is as desired.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top