Skip to Content
0
Former Member
Jul 02, 2014 at 09:30 PM

Access denied. Please check directory setting for files you can access.

94 Views

Hi ,

I am trying to run this code but i am faceing strange issue with this code that the path is access denied

can you please advice ?

RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\Server\LocalConnectionMgr");

if (key != null)

tempFilePath = key.GetValue("ReportDirectoryPath").ToString();

if (tempFilePath == "") //set the default

tempFilePath = @"C:\Program Files\Business Objects\Crystal Reports 12.0\Samples\EN\Reports\";

tempFilePath += @"NiceReporter\";

if (!Directory.Exists(TempFilePath))

Directory.CreateDirectory(TempFilePath);

tempFilePath += "Evaluators Trend.rpt";

CrystalDecisions.CrystalReports.Engine.ReportDocument rd = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument boReportClientDocument;

boReportClientDocument = new CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument();

boReportClientDocument.ReportAppServer = System.Environment.MachineName;

object path = (object)tempFilePath;

boReportClientDocument.Open(ref path, 0);

thanks

Fade