Solved

Report Control Toolbar during runtime

Posted on 2013-12-16
7
672 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 
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

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

Question has a verified solution.

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

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…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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