Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically change XSD filepath in Crystal Reports

I have a crystal report that is based on an XSD schema file.

Within the report definition, I can modify the datasource location, specifically, the file path. This is where I can set the file path to where the XSD schema file resides on my machine.

At this point, everything works correctly.

Here is the problem:

If the file path does not exist, the report has a runtime error.

This poses issues, specifically, with deployment since my local development environment is physically different from the testing/live environment. i.e. File paths are very different and I don't want to rely on a 'hard-coded' file path.

My question is, I'd like to know how I can either change this file path dynamically (in code) or set it in the report definition such that it is relative to where the report is?

like image 537
J.C. Avatar asked Oct 15 '09 16:10

J.C.


1 Answers

The easiest way would be to set the datasource location to be the same as the report file location. When you open up the Set Datasource Location dialog, expand the Properties plus-box, then right-click on the file path name and and choose "Same as Report".

like image 148
digital.aaron Avatar answered Oct 04 '22 04:10

digital.aaron