Click to See Complete Forum and Search --> : C#.NET crystal reports problem


lw0110
March 6th, 2006, 03:45 AM
I'm working on a c#.NET application that uses crystal reports.
How can I make crystal reports refer to the current folder for the database ? the problem that I'm facing is as follows:
during development of the application I specify the database location whenever I create a new report e.g. D:\myProject\mydatabase.mdb
after that I created a deployment project but whenever I install the software to another machine it keeps on refering to the old path that I specify during development although I kept the database in the same folder both during development as well as in the user's application folder.

How can I make a crystal report refer to the current folder as a relative path and not taking the full path?

I have done everything I possibly could but unfortunately I couldn't get any positive solutions. I've asked professionals, I've looked online, I've searched the forums no one could help out. Any help from your side would be appreciated even if you are not sure about your answer any suggestions would also be useful.

Thanks!

Athley
March 6th, 2006, 06:36 AM
I don't have an answer for your question, but merely are suggestion of how you might do instead.

I often add a typed Dataset for the DB to my app and then set the datasource of the Crystal Report to an instance of that DS. That way you could manage the path to the DB through the connectionstring instead.

/Leyan

stardv
March 6th, 2006, 09:45 AM
I have not worked with Acess DB but with MS SQL you can just set patth programaticly within your code and it overrides all setting in report istelf. Look into that

lw0110
March 6th, 2006, 08:51 PM
Thanks athley, your way is great. That is what i want. And it works fine now. =)

kolluru
March 7th, 2006, 05:08 AM
Good that you found the answer...

Set the datasource location as Application.StartUpPath + ur access file name.

Just try the same having subreports in your main report also...deploy in other system.. and check it out...

regards
Kolluru