on 03-04-2019 5:06 PM
I'm attempting to create a server-side instance of the RAS. Here's the code:
using BusinessObjects.Enterprise.Framework;
using BusinessObjects.Enterprise.Infostore;
using CrystalDecisions.Enterprise;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.DataDefModel;
using BusinessObjects.Enterprise.Exception;
// token provided.
IEnterpriseSession enterpriseSession = CrystalEnterprise.GetSessionMgr().LogonWithToken(token);
// Interop type 'EnterpriseService' cannot be embedded. Use applicable interface instead
EnterpriseService enterpriseService = (EnterpriseService)enterpriseSession.GetService("RASReportFactory");
ReportAppFactory reportAppFactory = (ReportAppFactory)enterpriseService.Interface;
ReportClientDocument reportClientDocument = null;
try
{
// id provided
reportClientDocument = reportAppFactory.OpenDocument(id, 0);
// do something
}
catch (SDKException e)
{
Debug.Print(e.Message);
throw;
}
catch (Exception e)
{
Debug.Print(e.Message);
throw;
}
finally
{
if (reportClientDocument != null)
{
reportClientDocument.Close();
reportClientDocument = null;
}
}
Questions:
Edit. the project targets ".Net Framework 4.6.1".
I needed to change the CrystalDecisions.Enterprise.Framework assembly's Embed Interop Types setting to False to eliminate the error message.
I applied this to all CrystalDecsions.* and BusinessObjects.* assemblies.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.