DataFiles
DataFiles specifies the location of the database files or tables used in the report.
Syntax
[form.]Report.DataFiles(ArrayIndex)[= Location$]
- Enter the file name and path of each database file or table in your report for which you want to change the location.
- Use a separate line of code for each file for which you want to change the location.
- The order of files in the array must conform to the order of files in the report. (You can use the Database|Set Location command to determine the order of files in the report.)
- The first file in the report is array index (0), the second file is (1), etc.
For example, to change the location of the first and third files in a report (first.dbf and third.dbf) to the c:\new directory, use the following syntax:
CrystalReport1.DataFiles(0) = "c:\new\first.dbf"
CrystalReport1.DataFiles(2) = "c:\new\third.dbf"
Remarks
- DataFiles is an array property that is available at runtime only.
- Use this property if you want to run the report with files in different locations than specified in the report.
- When using this property, you do not have to change the locations of all files in the report. Just make certain that the array index for each file you do change matches the position of that file in the report.
- This property is cleared once the print job is printed. If you print a second time, the program reverts to the locations as originally specified in the report.
Data Type
Array of strings
Availability
Runtime
Related Report Engine Functions
PESetNthTableLocation