Solved

The system cannot find the path specified

Posted on 2014-01-22
11
3,893 Views
Last Modified: 2014-01-28
I am receiving this error while trying to export my report to pdf

The system cannot find the path specified. ---> System.Runtime.InteropServices.COMException: The system cannot find the path specified. at CrystalDecisions.ReportAppServer.Controllers.PrintOutputControllerClass.Export(CrReportExportFormatEnum exportFormat, Int32 Reserved)


using visual studio 2010
boexi3.1
using crystal dll versions 12.0.1100.0

thanks
0
Comment
Question by:zstafa
11 Comments
 
LVL 4

Expert Comment

by:ItWorked
ID: 39802105
You need to provide some markup of your code to review it and let you know where you have made mistake.
0
 
LVL 3

Expert Comment

by:Paul 1
ID: 39802145
can you try exporting to another format? I could be the PDF driver is not working.

It could also be something simple as the last location something was saved is not available and it cannot process the error. IE. a memory stick or network drive thats disconnected.
0
 
LVL 3

Author Comment

by:zstafa
ID: 39802921
InfoStore boInfoStore;
EnterpriseService boEnterpriseService;
InfoObjects boInfoObjects;
ReportAppFactory boReportAppFactory;

//Log on to the Enterprise CMS
SessionMgr boSessionMgr = new CrystalDecisions.Enterprise.SessionMgr();
EnterpriseSession boEnterpriseSession = boSessionMgr.Logon(......);

boEnterpriseService = boEnterpriseSession.GetService("", "InfoStore");
boInfoStore = new CrystalDecisions.Enterprise.InfoStore(boEnterpriseService);
string[] reportName = rptName.Split('\\');
string reportNameNoPath = reportName[reportName.Length - 1].Replace(".rpt", "");

string boQuery = "Select SI_ID From CI_INFOOBJECTS Where SI_NAME = '" + reportNameNoPath + "' AND SI_Instance=0";
boInfoObjects = boInfoStore.Query(boQuery);
CrystalDecisions.Enterprise.InfoObject boInfoObject = boInfoObjects[1];

boEnterpriseService = null;

//Retrieve the RASReportFactory
boEnterpriseService = boEnterpriseSession.GetService("RASReportFactory");
boReportAppFactory = (CrystalDecisions.ReportAppServer.ClientDoc.ReportAppFactory)boEnterpriseService.Interface;

//Open the report from Enterprise
ReportClientDocument boReportClientDocument = boReportAppFactory.OpenDocument(boInfoObject.ID, 0);
DatabaseController reportdatabaseController = boReportClientDocument.DatabaseController;
PrintOutputController reportPrintController = boReportClientDocument.PrintOutputController;

Report entity = new Report();
DataSet source = (DataSet)entity.GetListSourceFromCustomFunction(customFunction, argsListSource);

CrystalDecisions.ReportAppServer.DataDefModel.ISCRDataSet crDataset;
crDataset = CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.Convert(source);

reportdatabaseController.SetDataSource(crDataset);

CrReportExportFormatEnum rasReportExportFormat = CrReportExportFormatEnum.crReportExportFormatPDF;
CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray tempByteArray = reportPrintController.Export(rasReportExportFormat, 0);

Open in new window

It breaks on the export method. I will try another format.
thanks
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 3

Author Comment

by:zstafa
ID: 39803172
Exporting to excel format did not work either...

zstafa
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 450 total points
ID: 39803182
Are you trying to use the BOE assemblies on a Crystal Report?

Have you tried using the CR2008 SDK and assemblies?

mlmcc
0
 
LVL 3

Author Comment

by:zstafa
ID: 39803272
I guess I am getting a little confused about all of the different versions. I have added all of the dll's from the "businessobjects\common\4.0\managed" directory.

All of the versions are 12.0.1100.0 in the visual studio properties window.

thanks
0
 
LVL 3

Author Comment

by:zstafa
ID: 39804950
I still get the same error,  but when I added a blank report with no data it worked. Is there any trick to push the data into the report?

thanks
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39805183
Not really.  

There are 2 methods of providing data to a report, push and pull.

Pull is what you are using, the report is tied to a database and controls the access.  Push uses a recordset from the application and your application controls access to the database.

Many find the push method easier especially when building the application on your machine then running on a different system.

mlmcc
0
 
LVL 3

Author Comment

by:zstafa
ID: 39805232
Actually I am using the push method. I am using the .SetDataSource() method and passing in a dataset.

thanks
0
 
LVL 3

Accepted Solution

by:
zstafa earned 0 total points
ID: 39805314
Finally got it to work. Apparently when you use 'ReportClientDocument' the table in the dataset has to have the same name as the table/command in the report.

zstafa
0
 
LVL 3

Author Closing Comment

by:zstafa
ID: 39814574
The table in the report was not being set because the name didn't match
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jquery tab header text 1 23
asp Google Map 2 33
Running powershell scripts from ASP.NET 6 31
VB/ASP.Net "Value of type 'Date' cannot be converted to 'Integer'" 12 26
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question