on 08-25-2015 10:29 AM
Hi,
I have an ASP.Net MVC solution (Visual Studio 2015 - C#) and I am trying to export a crystal report to pdf.
If I apply IIS Express to my project, then I can export successfully the report to pdf .
But when I change it to Local IIS and run the same code
reportDocument.ExportToStream(ExportFormatType.PortableDocFormat)
I get the error below :
System.Runtime.InteropServices.COMException: The system cannot find the path specified.
I googled it and found that it may be an authentication error, so I added the "IIS AppPool\DefaultAppPool" user to the security section of the folder that contains the Crystal Report files. But the problem remains..
Do you have any workaround about this?
Thanks in advance for your help!!!
Nicholas
Typically its the \temp folder permissions IIS uses, make sure it has full read/write access.
Also needs full access to the viewer folder:
C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13
Fiddler trace may tell you more....
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An update is that I get this error when I try to export a report that requires input parameters (from C#). The reports that require no params are exported successfully!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
They are CR parameters. Another clue that I found is that if I go to the AppPool user Advanced Settings and change the "Enable 32-bit Applications" to true then I get no error. But this configuration creates other errors in my site so I want to avoid it!!!I use 32bit ODBC Hana Drivers, because in Crystal Reports Designer I cannot use 64 bit drivers (the CR 2011 Application is 32 bit).......
The code is
ReportDocument cryRpt = new ReportDocument();
TableLogOnInfo crTableLogOnInfo;
cryRpt.Load(Server.MapPath("~/Content/Reports/Sol1.rpt"));
cryRpt.SetParameterValue("DocKey@", 353);
cryRpt.SetParameterValue("ObjectID@", 17);
CrystalDecisions.Shared.ConnectionInfo crConnectioninfo = new CrystalDecisions.Shared.ConnectionInfo();
crConnectioninfo.ServerName = @"xx.xx.xx.xx:30015";
crConnectioninfo.UserID = "userid";
crConnectioninfo.Password = "password";
crConnectioninfo.DatabaseName = "dbname";
foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in cryRpt.Database.Tables)
{
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectioninfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}
foreach (ReportDocument subrep in cryRpt.Subreports)
{
foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in subrep.Database.Tables)
{
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectioninfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}
}
crTable.ExportToStream(ExportFormatType.PortableDocFormat) <--Here I get the error message
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.