Brad Hehe

The application we have deployed uses XSD files as the basis for the reports and the ADO.NET datasets are then passed into the ReportDocument objects at runtime. This seems to be a fairly common scenario.

At the time of deployment we ran into one small hiccup. In the CR report designer, the data source properties show that the absolute file path is referenced. In this case say it is [C:\MyProject\Schemas\MyReport.xsd]. The Report itself is located in [C:\MyProject\MyWebSite\Reports\MyReport.rpt]. In the deployment, the contents of [C:\MyProject\Schemas] are NOT deployed. They are simply a part of the VS solution/projects and not the deployed project itself. Furthermore, the absolute paths may not be the same between development and deployment. When we deployed the application & attempted to run the reports, it was looking for the XSD file in the original development path of [C:\MyProject\Schemas\MyReport.xsd]... which wasn't there nor would it ever be in a non-development deployment...

One of the other developers on the team was tasked to resolve this, and what he eneded up doing was a hack to get us by for the moment and now I'd like to find a more long-term "proper" solution to the real problem.

What he eneded up doing was setting up an absolute path that will always be available both locally on developer workstations and on deployed environments... he made a [C:\MySchemas\] path that would always need deployed at that very specific location. Then he "rebound" the reports... I'm not happy with that solution at all. I would rather not hard code anything and at worse, I'd prefer to retrieve a setting from [web.config] to find where my schemas are stored and somehow "update" the runtime instance of the report definition with that location.

During his investigation, I had challenged him to dig through the ReportDocument object and to find some property / some attribute / some piece of runtime meta-data where that original file path reference was being stored. It had to be in there somewhere! He was able to find it, I forget where at this time and I've not dug in to find it again myself, but what he found was a read-only attribute! So close... I then told him to try hitting it with reflection and setting the value, but I think that was too scary of an option for him (for whatever reasons) and he didn't pursue it... so perhaps that would have worked, albeit it was a hack in itself that I would prefer to not use in lieu of a "intended" approach to solving the problem.

So, is there a means through the API to set the location of that XSD at runtime



Re: Crystal Reports for Visual Studio How to set runtime location of XSD file for reports designed against XSD's...

Brad Hehe

Oddly enough, when I went to look at this a little further again via inspecting the ReportDocument object via "QuickWatch" during a debug session, I started getting "time outs" and then QuickWatch wouldn't allow me to inspect the object any further.

Still no luck finding the location that the path/filename was stored. We found it once before, but haven't found it again..





Re: Crystal Reports for Visual Studio How to set runtime location of XSD file for reports designed against XSD's...

Brad Hehe

Come on! No one else has encountered this as a deployment challenge I'm still looking for any suggestions/answers out there...




Re: Crystal Reports for Visual Studio How to set runtime location of XSD file for reports designed against XSD's...

Brad Hehe

I've not been able to get runtime debugging to work without having those timeout issues, so at this point I'm stuck with hard coding the path/filename... ugh!

Still looking for any solutions that someone else can offer... Somewhere there has to be a means of setting where the bound XSD file resides...





Re: Crystal Reports for Visual Studio How to set runtime location of XSD file for reports designed against XSD's...

Brad Hehe

Coming back to this thread hoping to renew it & get some type of answer!





Re: Crystal Reports for Visual Studio How to set runtime location of XSD file for reports designed against XSD's...

captJackSparrow

I dont know how to change it at runtime, but what you can do is Include this DataSet in your project, i guess right now you are using it directly in your report from some location.But if its included in your project also and when you compile ur project it will be automatically embedded in your executable if its windows app or DLL if its a web app.