ameetmore9
Programmer
I'm using BO XI R2.
I want to modify the report.
Following is a code snippet which throws InvalidCastException ;
and under that the Message is No Such Interfaces Supported .
Kindly suggest me a solution, if you have been able to crack it.
Also any ideas why such an exception.
using CrystalDecisions.CrystalReports.TemplateEngine;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.ObjectFactory;
using CrystalDecisions.ReportAppServer.DataDefModel;
using CrystalDecisions.ReportAppServer.Controllers;
using CrystalDecisions.ReportAppServer.CommonObjectModel;
using CrystalDecisions.ReportAppServer.ReportDefModel;
ReportClientDocument reportClientDocument = new ReportClientDocument();
SessionMgr sessionMgr = new SessionMgr();
EnterpriseSession enterpriseSession;
EnterpriseService enterpriseService;
InfoStore infoStore;
InfoObjects infoObjects;
InfoObject infoObject;
ReportAppFactory reportAppFactory;
string sampleReportName;
enterpriseSession = sessionMgr.Logon("administrator","","localhost","secEnterprise");
enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new InfoStore(enterpriseService);
sampleReportName = "World Sales Report";
infoObjects = infoStore.Query("Select SI_ID From CI_INFOOBJECTS Where SI_NAME='" + sampleReportName + "' And SI_INSTANCE=0");
infoObject = infoObjects[1];
reportAppFactory = (ReportAppFactory)enterpriseSession.GetService("","RASReportFactory").Interface;
reportClientDocument = reportAppFactory.OpenDocument(infoObject.ID,0);
Filter filter = new FilterClass();
filter.FreeEditingText = "{Trade.Trade Date} = '12/03/2009'";
reportClientDocument.DataDefController.RecordFilterController.Modify(filter);
reportClientDocument = reportAppFactory.OpenDocument(infoObject.ID,0);
code segment throws the Exception
Any alternatives to the above method since reportclientdocument is not getting created.
Regards,
Ameet
I want to modify the report.
Following is a code snippet which throws InvalidCastException ;
and under that the Message is No Such Interfaces Supported .
Kindly suggest me a solution, if you have been able to crack it.
Also any ideas why such an exception.
using CrystalDecisions.CrystalReports.TemplateEngine;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.ObjectFactory;
using CrystalDecisions.ReportAppServer.DataDefModel;
using CrystalDecisions.ReportAppServer.Controllers;
using CrystalDecisions.ReportAppServer.CommonObjectModel;
using CrystalDecisions.ReportAppServer.ReportDefModel;
ReportClientDocument reportClientDocument = new ReportClientDocument();
SessionMgr sessionMgr = new SessionMgr();
EnterpriseSession enterpriseSession;
EnterpriseService enterpriseService;
InfoStore infoStore;
InfoObjects infoObjects;
InfoObject infoObject;
ReportAppFactory reportAppFactory;
string sampleReportName;
enterpriseSession = sessionMgr.Logon("administrator","","localhost","secEnterprise");
enterpriseService = enterpriseSession.GetService("InfoStore");
infoStore = new InfoStore(enterpriseService);
sampleReportName = "World Sales Report";
infoObjects = infoStore.Query("Select SI_ID From CI_INFOOBJECTS Where SI_NAME='" + sampleReportName + "' And SI_INSTANCE=0");
infoObject = infoObjects[1];
reportAppFactory = (ReportAppFactory)enterpriseSession.GetService("","RASReportFactory").Interface;
reportClientDocument = reportAppFactory.OpenDocument(infoObject.ID,0);
Filter filter = new FilterClass();
filter.FreeEditingText = "{Trade.Trade Date} = '12/03/2009'";
reportClientDocument.DataDefController.RecordFilterController.Modify(filter);
reportClientDocument = reportAppFactory.OpenDocument(infoObject.ID,0);
code segment throws the Exception
Any alternatives to the above method since reportclientdocument is not getting created.
Regards,
Ameet