?
Solved

Report Control Toolbar during runtime

Posted on 2013-12-16
7
Medium Priority
?
677 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
DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

 
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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Introducing Priority Question, our latest feature.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

771 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