Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

The system cannot find the path specified

Posted on 2014-01-22
11
Medium Priority
?
4,485 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 4

Expert Comment

by:Hiran Desai
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

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

zstafa
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 1800 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 101

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

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

722 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