Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reports Load Very Slowly?
Message
From
08/06/2006 23:11:51
 
 
To
08/06/2006 08:15:43
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Miscellaneous
Thread ID:
01127794
Message ID:
01128035
Views:
25
Craig,
The report opens up without much time in CR9.2 Report Designer. But when the report loads from the VFP app it takes longer time.
Following below is my VFP code which is inside a REPORT class which calls the CR report on the SERVER in the applications subdirectory REPORTS


If This.PRINTDIRECTTOPRINTER
	This.Visible = .F.
Endif


Private OPRO
OPRO=Createobject("Processing")


If Empty(Thisform.REPORTFILEPATH)
	Thisform.REPORTFILEPATH= Addbs(Alltrim(OAPP.DEFAULTDIRECTORY)) +  "Reports"
Endif


CFILE=Addbs(Alltrim(Thisform.REPORTFILEPATH))+Alltrim(Thisform.REPORTFILENAME)
If !File(CFILE)
	=Messagebox("Report File : " +Alltrim(CFILE) +" is not existing. Kindly report this problem to the system administrator",16+0,'STOP')
	Thisform.XIT=.T.

Else
	OPRO.Show()

	With This
		* Instantiate Crystal Runtime
		* and add the report viewer to the form

		.OCRYSTALREPORTS 				= Createobject("CrystalRuntime.Application.9")
		.OREPORT 						= .OCRYSTALREPORTS.OPENREPORT(CFILE)
		.OREPORT.Papersize				= This.Papersize
		.OREPORT.PERFORMGROUPINGONSERVER= .T.
		.OREPORT.ENABLEASYNCQUERY		= .T.
		.OREPORT.PAPERORIENTATION		= Iif(This.PAPERORIENTATION>0,This.PAPERORIENTATION,0)
		.OREPORT.REPORTTITLE 			= Thisform.REPORTTITLE

		If Vartype(Thisform.PARAMETER1)#"L"
			.OREPORT.PARAMETERFIELDS(1).SETCURRENTVALUE(Thisform.PARAMETER1)
		Endif

		If Vartype(Thisform.PARAMETER2)#"L"
			.OREPORT.PARAMETERFIELDS(2).SETCURRENTVALUE(Thisform.PARAMETER2)
		Endif

		If Vartype(Thisform.PARAMETER3)#"L"
			.OREPORT.PARAMETERFIELDS(3).SETCURRENTVALUE(Thisform.PARAMETER3)
		Endif
		If Vartype(Thisform.PARAMETER4)#"L"
			.OREPORT.PARAMETERFIELDS(4).SETCURRENTVALUE(Thisform.PARAMETER4)
		Endif
		If Vartype(Thisform.PARAMETER5)#"L"
			.OREPORT.PARAMETERFIELDS(5).SETCURRENTVALUE(Thisform.PARAMETER5)
		Endif
		If Vartype(Thisform.PARAMETER6)#"L"
			.OREPORT.PARAMETERFIELDS(6).SETCURRENTVALUE(Thisform.PARAMETER6)
		Endif
		If Vartype(Thisform.PARAMETER7)#"L"
			.OREPORT.PARAMETERFIELDS(7).SETCURRENTVALUE(Thisform.PARAMETER7)
		Endif

		If Vartype(Thisform.PARAMETER8)#"L"
			.OREPORT.PARAMETERFIELDS(8).SETCURRENTVALUE(Thisform.PARAMETER8)
		Endif
		If Vartype(Thisform.PARAMETER9)#"L"
			.OREPORT.PARAMETERFIELDS(9).SETCURRENTVALUE(Thisform.PARAMETER9)
		Endif

		If Vartype(Thisform.PARAMETER10)#"L"
			.OREPORT.PARAMETERFIELDS(10).SETCURRENTVALUE(Thisform.PARAMETER10)
		Endif


		If Vartype(Thisform.PARAMETER11)#"L"
			.OREPORT.PARAMETERFIELDS(11).SETCURRENTVALUE(Thisform.PARAMETER11)
		Endif


		If Vartype(Thisform.PARAMETER12)#"L"
			.OREPORT.PARAMETERFIELDS(12).SETCURRENTVALUE(Thisform.PARAMETER12)
		Endif


		If Vartype(Thisform.PARAMETER13)#"L"
			.OREPORT.PARAMETERFIELDS(13).SETCURRENTVALUE(Thisform.PARAMETER13)
		Endif

		If Vartype(Thisform.PARAMETER14)#"L"
			.OREPORT.PARAMETERFIELDS(14).SETCURRENTVALUE(Thisform.PARAMETER14)
		Endif

		If Vartype(Thisform.PARAMETER15)#"L"
			.OREPORT.PARAMETERFIELDS(15).SETCURRENTVALUE(Thisform.PARAMETER15)
		Endif


		If Vartype(Thisform.RECORDSELECTIONFORMULA)#"L"
			.OREPORT.RECORDSELECTIONFORMULA = Thisform.RECORDSELECTIONFORMULA
		Endif


		If Vartype(Thisform.GROUPSELECTIONFORMULA)#"L"
			.OREPORT.GROUPSELECTIONFORMULA = Thisform.GROUPSELECTIONFORMULA
		Endif


		.AddObject("oleCRViewer", "oleControl", "crViewer9.crViewer")

		Thisform.Visible = .T.
		Thisform.Enabled = .T.


		If This.PRINTDIRECTTOPRINTER
			This.Visible = .F.
			.OREPORT.PRINTOUTEX
		Else
			With .OLECRVIEWER
				.Top = 1
				.Left = 1
				.Height = Thisform.Height - 2
				.Width  = Thisform.Width - 2
				.REPORTSOURCE        = Thisform.OREPORT
				.ENABLEREFRESHBUTTON = .F.
				.ShowInTaskbar=.T.
				.ShowTips = .T.
				.ENABLEEXPORTBUTTON=.T.


				.ENABLEANIMATIONCTRL=.T.
				.ENABLEDRILLDOWN=.T.
				.ENABLEGROUPTREE=.T.
				.ENABLEPRINTBUTTON=.T.
				.ENABLEPROGRESSCONTROL=.T.

				.VIEWREPORT()

			Endwith
		Endif

	Endwith

Endif

Thisform.Refresh
OPRO.Release()

If This.PRINTDIRECTTOPRINTER
	This.Release
Endif


TIA


>Does the report load slowly in Crystal Reports or just when running the report in VFP?
>
>>Hi,
>> I am having a problem with loading .RPT (CR9.2) file from VFP. It takes too long time to load. I searched the web and found out following answeres for my problem -
>> a) if you are re-importing subreports than it takes a while to load. Turning Re-importing Off can open the report faster.
>> b) You should have the NO PRINTER selected in CR so that the CR LOADER doesnt load the printer specific information and the loading will be faster.
>>
>>Well i did all the above but still my CR reports open slowly. After i see the CR Viewer on screen it processes fine. But just the initial loading of the report file causes lot of embarrassement.
>>
>>Does anybody had or have this problem? Any help/suggestions are appreciated.
>>
>>TIA
Sanjay Dhiraj Patel

MCSE, MCDBA

Net2Biz (Thailand)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform