Solved

The system cannot find the path specified

Posted on 2014-01-22
11
3,790 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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