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

hide report preview titlebar

Status
Not open for further replies.

ameedoo3000

IS-IT--Management
Sep 20, 2016
233
EG
hi
how can i hide the titlebar of report preview
 
The Autocenter is set to .F. in frxPreviewForm for example, and you want it to be .T. to autocenter the form.
This was just the observation explaining why the preview is not autocentered despite the base class set to autocenter=.T.

I see several lines in frxpreviewproxy.Show() method setting the preview form (oForm) Left and Top properties, positioning the preview, so the autocenter loses its influence anyway.

There seems no good place to prevent some positioning going on.

You could try to directly set autocenter=.t. before the frxpreviewproxy.Show() method shows the previewform, as last step:

Code:
...
*-------------------------------
* Show the form:
*-------------------------------
[highlight #FCE94F]This.oForm.Autocenter = .T.[/highlight]

if THIS.oForm.ShowWindow = 2 
	*-----------------------------------
	* We're launching a top form which 
	* must always be modeless.
	*-----------------------------------
	iStyle = 0
ENDIF
...

That would override any previous manipulations of the positioning. But it also prevents loading the previous form state from the resource (foxuser.dbf), where Foxpro natively and also FoxyPreviewer stores and resets preview form settings.

Bye, Olaf.

PS: tested and works. You find the frxPreviewProxy class in the same library as the different preview forms. It is the class managing the preview, also choosing which of them to use under current conditions.
 
If you would read more attentively, you wouldn't need to ask, it's all been said.

myself said:
You find the frxPreviewProxy class in the same library as the different preview forms.
The code snippet I posted a very short part of is in the frxPreviewProxy.Show() method.

If all else fails, start "Code References" and search for [highlight #FCE94F]* We're launching a top form which[/highlight]. Double click on the search result and you'll be "beamed" into this method. Any specific code or comment in a project makes it discoverable quite easy via Code References. If you don't know that, yet another thing learned.

Bye, Olaf.
 
i was add the code in the specific place and recompile the project and replace it with the old in my project folder. but no change Happend!
Untitled_y8o2n8.png

Please . Be patient with me to the maximum degree ...
 
The modified foxypreviwer works for me doing:

Code:
DO FoxyPreviewer.APP
REPORT FORM HOME()+"\TOOLS\FILESPEC\90FRX.FRX" PREVIEW

Could you check that, too? The report is a testreport of VFP itself, must be available to you.
If that doesn't work out, I don't know what you missed. You added the AutoCentering at the right place.

Please double check, that the build could replace the old APP, if an EXE or APP is in use, it can't be replaced. This could have hindered the update both in the original place of the APP in the foxypreviewer project home folder and also in your project, if you tried to replace the app file while your EXE or IDE still had it loaded. If you close all VFP IDEs, just open foxypreviewer.pjx, build, then copy the app to all necessarry other places you can do that without that locking hindering the replacements. This is not about VFP, this is file locking behaviour of Windows, no file can be replaced while it executes or is open in any way.

If you want to see whether you have your newest version running, you can change the version of foxypreviewer and add your own additional number.

Open foxypreviewer.prg - it starts with:
Code:
* FoxyPreviewer Version info
#DEFINE  FOXYPREVIEWER_VERSION    2.99
#DEFINE  FOXYPREVIEWER_VERSION2   "v2.99z31 RC 2016.04.04" && <- Change here before each build

For example add
Code:
* FoxyPreviewer Version info
#DEFINE  FOXYPREVIEWER_VERSION    2.99
#DEFINE  FOXYPREVIEWER_VERSION2   "v2.99z31 RC 2016.04.04 [highlight #FCE94F]ameedoo mod 1[/highlight]" && <- Change here

Now after you Do Foxypreviewr.app you can check, whether you really started your newest version via
Code:
? _screen.oFoxyPreviewer.cVersion
OK?

Bye, Olaf.
 
I've implementation of all the steps and tests requested and the result is still negative. No change happened!
1_y35vww.jpg


2_ln2d63.jpg


3_fqqqvg.jpg


4_ztocol.jpg


So what is the reason !!
 
Ah, you could have showed that earlier. The preview for is the outer frame, it is centered, it can't be any other position, as it is maxed out.
What you may want to center is the page within the preview. But you don't have any control about how the pages appear in the inner preview form canvas.

AutoCenter only centers the form, and it does that. There is nothing more you can do, but try to change report margins. That would then not only influence canvas drawing, but also the output on paper, of course. And I think it would only reflect in the white paper area.

You can't control anything down to every single pixel, so either you live with that, or use something completely different for reporting, List&Label, Word, HTML output....

Bye, Olaf.
 
Does this mean that there is no hope for this problem?
 
Yes, get over it. Or write your own report rendering engine.

What do you think would happen, if AutoCenter would not only center the form in the screen/desktop, but also the inner objects? Everything would be placed in the middle of the form on top of each other. Besides: At the moment you autocenter the preview form, is BEFORE any output was rendered, there is nothing to center yet.

There are limits of what you can do and you reached one. You now only have cumbersome solutions, eg using htmllistener creating the report as HTML output, then display a "fake" preview to shopw that HTML in a webbrowser control, put under your own direction with CSS centering it the way you like and any additional bells and whistles you can think of. I am not eager digging that deep into a solution for you. This is the end of this thread for me, if you're still not satisifed, you're still not satisfied and that'll stay that way.

Maybe someone else has the endurance to pick up where I leave...

Bye, Olaf.
 
Thank you very much OlafDoschke . I am satisfied that in your opinion is the correct view. I apologize very much for your trouble with me. In any case, the findings of the results was satisfactory and beautiful. and it's enough .
Thank you OlafDoschke and to the meeting you in other post .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top