Solved

The system cannot find the path specified

Posted on 2014-01-22
11
3,557 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 3

Author Comment

by:zstafa
Comment Utility
Exporting to excel format did not work either...

zstafa
0
 
LVL 100

Assisted Solution

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

Have you tried using the CR2008 SDK and assemblies?

mlmcc
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 3

Author Comment

by:zstafa
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
The table in the report was not being set because the name didn't match
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now