CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2006
    Posts
    9

    C#.NET crystal reports problem

    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!

  2. #2
    Join Date
    Oct 2002
    Location
    Växjö, Sweden
    Posts
    225

    Re: C#.NET crystal reports problem

    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

  3. #3
    Join Date
    Jun 2004
    Location
    New Jersey, USA
    Posts
    341

    Re: C#.NET crystal reports problem

    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
    "We act as though comfort and luxury were the chief requirements of
    life, when all that we need to make us happy is something to be
    enthusiastic about."

    - Einstein

  4. #4
    Join Date
    Feb 2006
    Posts
    9

    Re: C#.NET crystal reports problem

    Thanks athley, your way is great. That is what i want. And it works fine now. =)

  5. #5
    Join Date
    Aug 2005
    Posts
    44

    Re: C#.NET crystal reports problem

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured