Solved

Report Control Toolbar during runtime

Posted on 2013-12-16
7
613 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

19 Experts available now in Live!

Get 1:1 Help Now