Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C5 Errors o Plenty
Message
 
À
01/04/2003 23:25:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Divers
Thread ID:
00772803
Message ID:
00772815
Vues:
8
>Post the code, please.
>

Some of this comes from Paul M's reports class...
this.oCR = createobject("CrystalRuntime.Application")
oReport = this.oCR.OpenReport(this.cReportName)
oPreview = createobject(this.cpreviewform) && VFPForm

with oPreview
	.oCR = this.oCR
	.oCRReport = oReport
        .PreviewReport(this.cReportName)
        this.SetPreviewWindow(loPreview)
	.show() && Crash
endwith

procedure setpreviewwindow(oPreview)
if vartype(oPreview) == [O]
	if !empty(this.previewheight)
		oPreview.height = this.previewheight 
	endif
	if !empty(this.previewwidth)
		oPreview.width = this.previewwidth
	endif
	if !empty(this.previewtop)
		oPreview.top = this.previewtop
	endif
	if !empty(this.previewleft)
		oPreview.left = this.previewleft
	endif

	if vartype(oPreview.oleCRViewer) == [O]
		with oPreview.oleCRViewer 
			.DisplayBackgroundEdge = this.displaybackgroundedge && .T.
			.DisplayBorder = this.displayborder && .T.
			.DisplayGroupTree = this.displaygrouptree && .F. 
			.DisplayTabs = this.displaytabs && .T.
			.DisplayToolbar = this.displaytoolbar && .T. 
			.EnableCloseButton = this.enableclosebutton && .T. 
			.EnableDrillDown = this.enabledrilldown && .F.
			.EnableExportButton = this.enableexportbutton && .T. 
			.EnableGroupTree = this.enablegrouptree && .F. 
			.EnableHelpButton = this.enablehelpbutton && .F.
			.EnableNavigationControls = this.enablenavigationcontrols && .T.  
			.EnablePopupMenu = this.enablepopupmenu && .F.
			.EnablePrintButton = this.enableprintbutton && .T. 
			.EnableProgressControl = this.enableprogresscontrol && .T.  
			.EnableRefreshButton = this.enablerefreshbutton && .T.
			.EnableSelectExpertButton = this.enableselectexpertbutton &&.T.   
			.EnableSearchControl = this.enablesearchcontrol && .T.
			.EnableSearchExpertButton = this.enablesearchexpertbutton && .T.  
			.EnableStopButton = this.enablestopbutton && .F.
			.EnableToolbar = this.enabletoolbar && .T.
			.EnableZoomControl = this.enablezoomcontrol && .T. 
		endwith
	endif 
endif
endproc

oPreview :: PreviewReport
lparameters tcReport

if vartype(tcReport) = "C"
	if vartype(this.oCRApp) <> "O"
		this.oCRApp = createobject("CrystalRuntime.Application")
	endif

	if vartype(this.oCRReport) <> "O"
		if file(tcReport)
			this.oCRReport = this.oCRApp.OpenReport(tcReport)
		endif
	endif
endif

if vartype(this.oCRApp) = "O" and vartype(this.oCRReport) = "O"
	if type("ThisForm.oleCRViewer") = "O"
		thisform.removeobject("oleCRViewer")
	endif
	thisform.addobject("oleCRViewer", "olecontrol", "CRViewer9.CRViewer.9.2")

	with thisform.oleCRViewer
		.width = thisform.width
		.height = thisform.height
		.visible = .t.

		doevents

		loReport = this.oCRReport
		.ReportSource = loReport

		.EnableExportButton = .t.

		doevents

		.ViewReport()
	endwith
endif
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform