cancel
Showing results for 
Search instead for 
Did you mean: 

getting a "path not found" error with this line rcd.PrintOutputController.Export(CrReportExportFormatEnum.crReportExportFormatPDF)

Former Member
0 Kudos

I have two test servers.  Both are running Windows 2012 with Crystal Reports 2012.

On the first server (which is working nicely), I has an ASP.net application which include Crystal Reports.  All the files for the IIS server are on the local D:\ drive.

On the second server, I copied the first server, and then moved the IIS files to a network share, and then configured IIS to use the network share.  I then took the Crystal Reports part of the application and put it back on the D:\ local drive.

Now in this code (same code on both servers), I have the following

             myBytes = New CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray

             myBytes = rcd.PrintOutputController.Export(CrReportExportFormatEnum.crReportExportFormatPDF)

On the first server, this works great,

On the second server, I get the following error message.

System.Runtime.InteropServices.COMException (0x80004005): The system cannot find the path specified.

   at CrystalDecisions.ReportAppServer.Controllers.PrintOutputControllerClass.Export(CrReportExportFormatEnum exportFormat, Int32 Reserved)

   at clsCR2008.buildPDF(String expDir, String reportPath, String strServer, String strDatabase, String strUser, String strPassword, String strUserID)

Any suggestions on how to fix this problem?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Maybe Process Monitor can tell you what path and to what is missing(?).

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter

Answers (1)

Answers (1)

former_member292966
Active Contributor
0 Kudos

Hi Stephen,

You've gotten that far so it's found the report.  So I assume that path is fine.  My guess is the path of where you are saving the PDF file is incorrect (expDir). 

Can you check values for expDir and reportPath?  Does that path exist or is available on this second machine?  If the path is a network folder, does the account running your application have permissions to that folder? 

Thanks,

Brian

Former Member
0 Kudos

Both expDir and reportPath exist.  In fact, the logging is done in the expDir directory.  The final result and the logging of steps is done to the same directory, and the logging of steps is how I was able to narrow which line is causing the error.

As for the reportPath, in a previous step (which is working fine), I am able to set and configure some labels and parameters in the report, and these seem to be working as well (at least the logging is showing the correct results.)

I suspected there was a files permission problem, but I have opened up the permissions so wide, you could drive a large truck through the permissions.  I may have missed a permission, but if I did, it is vey subtle. 

0 Kudos

Does it happen with all reports or just this one?

Try a report with no data source and just a "Hello World" text box in it to rule out DB connection issues etc.

How did you distribute the CR runtime? Using the MSI installer or ???

Don

Former Member
0 Kudos

My problem happens with all reports.

I used an MSI installer to install the runtime.  And it worked with the IIS files were on a local drive.  When I set up IIS to use a network space to read the same files, it stopped working.

Same server, just changed the IIS configuration.

former_member292966
Active Contributor
0 Kudos

Hi Stephen,

Does the service account IIS is using have permissions to the network folder?  This would explain why it worked when everything is local versus network.  For what you want to do, you need to assign a network service account to run IIS, not the machine's local service account.  Make sure the network account has permissions to the network folder. 

Crazy way to test it is to set the IIS services to use an account you know has admin permissions to your web server and permissions to the network folder and try your application.  If that works then create a service account with those same permissions and switch IIS to use this new account. 

Also have a look at the Windows Event logs when you get the error message.  It should indicate why it can't find the path properly.  Crossing my fingers it's as simple as that. 

Good luck,

Brian

0 Kudos

Fiddler may show you also....

Former Member
0 Kudos

I finally fixed the problem.  It took hours (more that I want to admit) of debugging and testing, but I finally found the problem.

First I will tell you what fixed the problem.  I was missing a <add assembly ...> line in the web config. 

The missing line was:

    <add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

Now we will discuss the why this fixed it.  Simple answer, I have no clue.

Here is the process I used.  First I created a Virtual Server, installed all my own software and also the run-time for the Crystal Reports.  All the ASP.net files were on the local D:\ drive. Everything was working fine.

Next I cloned the Virtual Server, and tested it.  Everything was working fine.  Next I switched the IIS settings so that the ASP.net files were on a network attached drive.  (And of course moved the ASP.net files to the network attached drive.)  At this point, the Crystal Reports stopped working. 

So I am confused as to why when the ASP.net files are on a local drive it worked, but when I moved the ASP.net files to a network shared drive it stopped working.

To assist the next person with a similar problem, here is the full WEB.CONFIG file that is working.

<?xml version="1.0"?>

<configuration>

    <appSettings>

        <add key="CrystalImageCleaner-AutoStart" value="true"/>

        <add key="CrystalImageCleaner-Sleep" value="60000"/>

        <add key="CrystalImageCleaner-Age" value="120000"/>

    </appSettings>

    <connectionStrings/>

    <system.web>

        <!--

            Set compilation debug="true" to insert debugging

            symbols into the compiled page. Because this

            affects performance, set this value to true only

            during development.

        -->

        <compilation debug="false">

            <assemblies>

                <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>

                <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>

                <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>

                <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>

                <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.ReportAppServer.CommonObjectModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.ReportAppServer.ReportDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

                <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

                <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

                <add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

                <add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="CrystalDecisions.Data.AdoDotNetInterop, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/></assemblies></compilation>

        <!--

            The <authentication> section enables configuration

            of the security authentication mode used by

            ASP.NET to identify an incoming user.

        -->

        <authentication mode="Windows"/>

        <!--

            The <customErrors> section enables configuration

            of what to do if/when an unhandled error occurs

            during the execution of a request. Specifically,

            it enables developers to configure html error pages

            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

            <error statusCode="403" redirect="NoAccess.htm" />

            <error statusCode="404" redirect="FileNotFound.htm" />

        </customErrors>

        -->

        <httpHandlers><add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></httpHandlers></system.web>

</configuration>

0 Kudos

Hi Stephen,

Depending on what you are doing in the report determines what CR Assemblies are required for your site. I find If you can use the Object to search for the API being used or want to use and it does not show up then it's usually due to missing from the list of references and those CR references are in the web.config file.

Sometimes when upgrading a project either in the version of VS or the CR runtime we find the *.config files do not always get updated properly. Sometimes you will see the same assembly listed multiple times with different versions or some are updated and others are not... Not sure what causes this but we found having VS 2008 and CR 10.5 assemblies on the same PC as CR for VS ( 13.x.) assemblies can cause upgrade issue, we recommend removing CR 10.5 from VS first.

So bottom line is likely at some time some API was used and for whatever reason the assembly was not updated in the References or added to the "Using"... line

In my simply test WEB app in VS 2010 here's what I see:

And in my main default.aspx.cs file I have these:

using System;

using System.IO;

using System.Collections;

using System.Configuration;

using System.Data;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using CrystalDecisions.CrystalReports.Engine;

using CrystalDecisions.Shared;

using CrystalDecisions.ReportAppServer.ClientDoc;

using CrystalDecisions.ReportAppServer.Controllers;

using CrystalDecisions.ReportAppServer.ReportDefModel;

using CrystalDecisions.ReportAppServer.CommonControls;

using CrystalDecisions.ReportAppServer.CommLayer;

using CrystalDecisions.ReportAppServer.CommonObjectModel;

using CrystalDecisions.ReportAppServer.ObjectFactory;

using CrystalDecisions.ReportAppServer.Prompting;

using CrystalDecisions.ReportAppServer.DataSetConversion;

using CrystalDecisions.ReportAppServer.DataDefModel;

So not sure what may have been missing good to know you found the fix...

FYI, our PublicTokens (GUID's) do not change so if you see/find multiple versions you can simply change the version number to:

<add assembly="CrystalDecisions.Web, Version=13.0.2000.0......

The assembly version number never changes unless the framework does, 2000 in the above line is Framework 2.0, the actual file version you can get from the Assemby folder.

Hope that explain it for you....

Don