Solved

Report Control Toolbar during runtime

Posted on 2013-12-16
7
592 Views
Last Modified: 2013-12-17
Hi
I'm having following code to display report designer during runtime.
But report control toolbar is go behind of the desktop form
I tried DOCK WINDOW "Report Controls" POSITION 0
but no luck so far.

How resolve this issue.
thanks

PROCEDURE RptDesignMode(tcReportFileName)
LOCAL loform as Form 

loform=CREATEOBJECT("RptDesginForm")
WAIT CLEAR 

WITH loform as Form 
	.Show()
	
MODIFY REPORT (tcReportFileName) IN WINDOW (loForm.Name)

	.Release
ENDWITH 
ENDPROC 

DEFINE CLASS RptDesginForm as Form
	Desktop=.t.
	Width=SYSMETRIC(1)
	Height=sysmetric(2)

ENDDEFINE 

Open in new window

0
Comment
Question by:ziorinfo
  • 5
  • 2
7 Comments
 
LVL 41

Expert Comment

by:pcelba
ID: 39722440
UPDATE: This code works each the second time...
PROCEDURE RptDesignMode(tcReportFileName)
LOCAL loform as Form 

loform=CREATEOBJECT("RptDesginForm")
WAIT CLEAR 

WITH loform as Form 
	.Show()
	
	ACTIVATE WINDOW "Report Controls"
	SHOW WINDOW "Report Controls" IN WINDOW (loForm.Name)
	MODIFY REPORT (tcReportFileName) IN WINDOW (loForm.Name)

	.Release
ENDWITH 
ENDPROC 

DEFINE CLASS RptDesginForm as Form
	Desktop=.t.
	Width=SYSMETRIC(1)
	Height=sysmetric(2)

ENDDEFINE 

Open in new window

0
 
LVL 41

Expert Comment

by:pcelba
ID: 39722576
And this code should work a little bit better...
PROCEDURE RptDesignMode(tcReportFileName)
LOCAL loform as Form 

loform=CREATEOBJECT("RptDesginForm")
WAIT CLEAR 

WITH loform as Form 
	.Show()
	
	IF WEXIST("Report Controls")
		IF WVISIBLE("Report Controls")
			HIDE WINDOW "Report Controls"
		ENDIF
		SHOW WINDOW "Report Controls" IN WINDOW (loForm.Name)
	ENDIF
	
	MODIFY REPORT (tcReportFileName) IN WINDOW (loForm.Name)
	
	IF WEXIST("Report Controls")
		SHOW WINDOW "Report Controls" IN SCREEN
	ENDIF
	
	.Release
ENDWITH 

IF WEXIST("Report Controls")
	HIDE WINDOW "Report Controls"
ENDIF

ENDPROC 

DEFINE CLASS RptDesginForm as Form
	Desktop=.t.
	Width=SYSMETRIC(1)
	Height=sysmetric(2)

ENDDEFINE 

Open in new window

0
 

Author Comment

by:ziorinfo
ID: 39723152
Nope, it is not working , report control window is not exist
and as a result it does not satisfy WEXIST("Report Controls") to true.

That window is only active when Modify report command in used

I dont know how to solve .
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 41

Expert Comment

by:pcelba
ID: 39723309
Yes, my code works fine in VFP IDE but you probably need Run-time functionality... which is not so easy.

Do you need to display the Report designer in a separate window? Why don't you accept VFP screen which allows to display the Toolbar?
0
 
LVL 41

Accepted Solution

by:
pcelba earned 500 total points
ID: 39723342
Well... everything is possible:
PROCEDURE RptDesignMode(tcReportFileName)
LOCAL loform as Form, llResource, lcTname, lcDummyRepName

*-- The Toolbar name is language dependent...
*lcTname = "Ovládací prvky sestavy"
lcTname = "Report Controls"

lcDummyRepName = ADDBS(SYS(2023))+SYS(2015)+'.frx'

llResource = SET('RESOURCE') = 'ON'
SET RESOURCE OFF

MODIFY REPORT (m.lcDummyRepName) NOWAIT

loform=CREATEOBJECT("RptDesginForm")
WAIT CLEAR 

WITH loform as Form 
	.Show()
	
	IF WEXIST(m.lcTname)
		IF WVISIBLE(m.lcTname)
			HIDE WINDOW (m.lcTname)
		ENDIF
		SHOW WINDOW (m.lcTname) IN WINDOW (loForm.Name)
	ENDIF
	
	MODIFY REPORT (tcReportFileName) IN WINDOW (loForm.Name) NOWAIT
	MODIFY REPORT (tcReportFileName) IN WINDOW (loForm.Name)
	
	IF WEXIST(m.lcTname)
		SHOW WINDOW (m.lcTname) IN SCREEN
	ENDIF
	
	.Release
ENDWITH 

IF WEXIST(m.lcTname)
	HIDE WINDOW (m.lcTname)
ENDIF

*-- This command is also language dependent...
RELEASE WINDOW ("Report Designer - " + JUSTFNAME(m.lcDummyRepName))

IF m.llResource
	SET RESOURCE ON
ENDIF

ENDPROC 

DEFINE CLASS RptDesginForm as Form
	Desktop=.t.
	Width=SYSMETRIC(1)
	Height=sysmetric(2)

ENDDEFINE 

Open in new window

Remember the language dependency of the Toolbar and Report designer window name.  

SET RESOURCE OFF is used to ensure the Toolbar visibility. If you need to use SET RESOURCE ON even in this procedure then you have to ensure the Toolbar definition existence (and visibility) in the appropriate FOXUSER file. More info: http://www.ml-consult.co.uk/foxst-17.htm
0
 

Author Comment

by:ziorinfo
ID: 39723381
Excellent pcelba.

many thanks
0
 
LVL 41

Expert Comment

by:pcelba
ID: 39723722
Just a note: there are two MODIFY REPORT commands by mistake:

      MODIFY REPORT (tcReportFileName) IN WINDOW (loForm.Name) NOWAIT
      MODIFY REPORT (tcReportFileName) IN WINDOW (loForm.Name)

You may remove the first one.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now