Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Logon Failed....?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00975044
Message ID:
00975071
Vues:
23
>Can you post the code that connects to the data?

Not sure if this is what you want, but it's the only thing that remotely deals with connecting to data that I have in my code.
*************************************************************************************************
* Program/Function: SetDataDirectoryForTables()
* Author: Ben Santiago
* Company: Eastern Suffolk BOCES
* Last Revision: 07/23/2004
* Description:
*		Set/Change data directory location for all tables in Crystal Report.
*************************************************************************************************
LPARAMETERS pcNewDataLocation, pcDefaultExtension

****************************************************
* Initialize Variables
****************************************************
LOCAL lcNewDataLocation
LOCAL lcDefaultExtension
LOCAL lnCounter
LOCAL lcFile

****************************************************
* Validate Parameters
****************************************************
lcNewDataLocation = ADDBS(pcNewDataLocation)
IF VARTYPE(pcDefaultExtension) == "L" THEN
	lcDefaultExtension = "DBF"
ELSE
	lcDefaultExtension = LEFT(UPPER(STRTRAN(pcDefaultExtension, ".")), 3)
ENDIF

****************************************************
* Loop through All Tables In Report
****************************************************
WITH THIS.CrystalReport.Database.Tables
	FOR lnCounter = 1 TO .Count
		****************************************************
		* Compile Full File & Path To Table
		****************************************************
		lcFile = lcNewDataLocation + JUSTFNAME(.Item(lnCounter).Location)
		IF (UPPER(RIGHT(lcFile, 4)) != "." + lcDefaultExtension) AND SUBSTR(lcFile, LEN(lcFile) - 3, 1) != "." THEN
			lcFile = lcFile + "." + lcDefaultExtension
		ENDIF
		
		****************************************************
		* Change Table Location
		****************************************************
		.Item(lnCounter).Location = lcFile
	ENDFOR
ENDWITH
________________________
Ben Santiago, MCP & A+
Programmer Analyst (SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS)
Eastern Suffolk BOCES - Student Data Services


Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-Rich Cook
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform