Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error with Opening Report with RAS in .Net

Status
Not open for further replies.

erinallen

Programmer
May 13, 2002
66
US
None of the examples I have are working...

I'm trying to open a report in CE via RAS.

My VB.Net keeps failing on this statement:
m_crReportClientDoc = m_crReportAppFactory.OpenDocument(Report)

It says m_crReportAppFactory doesn't have OpenDocument. According to the examples I have m_crReportAppFactory defined above using:

m_crReportAppFactory = IStore.EnterpriseSession.GetService("", "RASReportFactory")

This statement sets m_crReportAppFactory as a service and not a ReportAppFactory like the examples lead me to believe it should be.

If anyone can help I'd be very happy...Also, if anyone can point me to some good documentation on using RAS with .Net with CE...
Thanks,
Erin
 
Erin,

I'm having the same problem...Did you get it to work? If so, please send me an example.


Alex
 
Hey guys,
I think I found a solution to the problem. Crystal's API returns an EnterpriseService when you use GetService (the documentation is WRONG, surprise, surprise).

Get the EnterpriseService and then cast the Interface property to a ReportAppFactory. I used C# so the code would look like

EnterpriseService ceESession = ceSession.GetService("","RASReportFactory");
ReportAppFactory ras = (ReportAppFactory)ceESession.Interface;

Hope that helps.

-Eugene Kolovyansky
 
With Crystal's help I was able to get this working. The documentation is really missing some detail.

Dim SessionManager As SessionMgr
Dim m_crEnterpriseSession As EnterpriseSession
Dim m_crEnterpriseService As EnterpriseService
Dim IStore As InfoStore
Dim m_crReportAppFactory As Object

SessionManager = New SessionMgr()
'Log the user onto Crystal Enterprise.
Dim UserID As String
Dim Password As String
Dim APS As String
Dim Aut As String
Aut = "secEnterprise"

'Create the enterprise session.
m_crEnterpriseSession = SessionManager.Logon(UserID, Password, APS, Aut)

'Create the InfoStore object.
m_crEnterpriseService = m_crEnterpriseSession.GetService("", "InfoStore")
IStore = New InfoStore(m_crEnterpriseService)

'Initialize a RAS session
m_crReportAppFactory = IStore.EnterpriseSession.Interface.Service("", "RASReportFactory")

Hope this helps,
Erin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top