Solved

Report Control Toolbar during runtime

Posted on 2013-12-16
7
657 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 42

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 42

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
DevOps Toolchain Recommendations

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

 
LVL 42

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 42

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 42

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cannot create an instance of OLE DB provider "VFPOLEDB" 3 599
Import CSV Files 5 1,207
Controlling printer trays from browser 3 183
Need help compiling a Visual FoxPro program 14 33
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…
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

679 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