Solved

The system cannot find the path specified

Posted on 2014-01-22
11
3,690 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
 
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 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

13 Experts available now in Live!

Get 1:1 Help Now