Click here to Skip to main content
14,875,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I am facing a path issue problem in RDLC Reports and below is the code, i am using for giving path.....

C#
string MainPath = Application.StartupPath;
string RptPath = MainPath.Replace(@"SEMIS_Start\bin\x64\Debug", "");          
           this.reportViewer1.LocalReport.ReportPath = RptPath + @"Zanzibar\XtraReports\Modules\Forms\EmployeeAttendanceGraphical_En.rdlc";


Please, let me know the correct path which i need to give where it works well while creating set up for the application.

please solve this problem.

Thanks,
Ramu.
Posted
Updated 10-Dec-12 18:31pm
v2

1 solution

Please follow the below code for ASP.Net and modify same code for WINforms

Server path:

XML
<add key="ReportServerUrl" value="http://Local/ReportServer"/>
<add key="ReportServerFolder" value="/Reports/"/>
<add key="ReportServerUser" value="User"/>
<add key="ReportServerPass" value="Password"/>
<add key="ReportServerDomain" value="ServerIP"/>



Getting Path :

C#
ReportServer = ConfigurationManager.AppSettings["ReportServerUrl"].ToString();
UserName = ConfigurationManager.AppSettings["ReportServerUser"].ToString();
Password = ConfigurationManager.AppSettings["ReportServerPass"].ToString();
ReportDomain = ConfigurationManager.AppSettings["ReportServerDomain"].ToString();
ReportServerFolder = ConfigurationManager.AppSettings["ReportServerFolder"].ToString();


C#
rptViewer.ProcessingMode = ProcessingMode.Remote;
           rptViewer.ServerReport.ReportServerUrl = new Uri(ReportServer);


rptViewer.ServerReport.ReportPath = ReportServerFolder + "RptGENERAL.rdl";
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900