C# with Ms Access , Crystal Reports and Windows Application.
-
Hi, I am not pretty sure whether this is the exact forum for my question, so if I am in the wrong one..I am sorry..! My problem : I am developing a Windows Application in C# and I have to play around with Crystal Reports. This would be my first DesktopApplication and I am really messing around. I am though fond of Web Applications. My application requires a MsAccess Database file and A crystal Report.This database file is to be kept in a shared location, from where it has to be accessed. For calling reports, I don't know how to set path. As of now I am setting the actual local path of the report on my machine where I am developing the code.. [@"C:\blah\blah\report1.rpt"] and setting this file in the reportDocument.Load(path) event. How should I go about it for setting this path as dynamic. I tried using server.mappath but there is no such method supported.How should I load report from a dynamic path into reportDocument..? Is there any other way out?? Also can I store both the crystal report files and Ms Access file, in one location and access it from my application..? Is this possible..? How should be the database file / connection string set for accessing the .mdb file on the shared folder..?? I am new to this publishing method.. so if someone can throw some light on the same ,so that I can run .exe file on any machine and can access the .mdb file from the shared server. Do post example path setting..!! Cheers..
Jimish
-
Hi, I am not pretty sure whether this is the exact forum for my question, so if I am in the wrong one..I am sorry..! My problem : I am developing a Windows Application in C# and I have to play around with Crystal Reports. This would be my first DesktopApplication and I am really messing around. I am though fond of Web Applications. My application requires a MsAccess Database file and A crystal Report.This database file is to be kept in a shared location, from where it has to be accessed. For calling reports, I don't know how to set path. As of now I am setting the actual local path of the report on my machine where I am developing the code.. [@"C:\blah\blah\report1.rpt"] and setting this file in the reportDocument.Load(path) event. How should I go about it for setting this path as dynamic. I tried using server.mappath but there is no such method supported.How should I load report from a dynamic path into reportDocument..? Is there any other way out?? Also can I store both the crystal report files and Ms Access file, in one location and access it from my application..? Is this possible..? How should be the database file / connection string set for accessing the .mdb file on the shared folder..?? I am new to this publishing method.. so if someone can throw some light on the same ,so that I can run .exe file on any machine and can access the .mdb file from the shared server. Do post example path setting..!! Cheers..
Jimish
Since you are an ASP.NET developer, I'm sure you keep all your connectionString information and other valuable configuration settings in web.config. You can do a similar thing with the app.config file in C# winforms. The rules of accessing the app.config are very similar, you call the ConfigurationManager class to extract values from the file. So if your .mdb file path is //192.168.0.1/something.mdb just add a key into the app.config, I guess. And yes it is possible to access both the .mdb and the .rpt files from a shared location. :)
var question = (_2b || !(_2b));
-
Since you are an ASP.NET developer, I'm sure you keep all your connectionString information and other valuable configuration settings in web.config. You can do a similar thing with the app.config file in C# winforms. The rules of accessing the app.config are very similar, you call the ConfigurationManager class to extract values from the file. So if your .mdb file path is //192.168.0.1/something.mdb just add a key into the app.config, I guess. And yes it is possible to access both the .mdb and the .rpt files from a shared location. :)
var question = (_2b || !(_2b));