This is a migrated thread and some comments may be shown as answers.

OCIEnvCreate failed while processing a Telerik report in design mode

10 Answers 302 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 17 Oct 2011, 11:07 PM
Unable to discover a solution to this issue in other forum posts.  I have an VS2010 Framework 4 ASP.Net application that uses a Telerik report.  I actually have two problems to solve today.

1) I started out to fix a bug where the report parameter seems to have been ignored for a master/detail report.  The data coming back is the record related to the default parameter value.

2) In the process if trying to get back into Design mode, I am forced to comment out the connection string code in Sub New() for the master report and all sub reports.  After doing this and setting the default parameter to zero I now get the OCIEnvCreate failed error and can't find out how to resolve it.  Oracle Home is not the problem as it worked fine in Design mode and App mode before I commented out the connection string code.  I also validated that the connection string in app.config had the correct userid and password (I had changed the userid to something invalid so that I could certify that the report was using the web.config connection string at runtime vs the app.config string used at Design time.)  It is in fact correct.

The (commented out) code in the Master report is given below.  All subreports (there are five of them) have the identical code sans the property code.

I have to say this is extremely irritating and frustrating to have to comment and uncomment these code snippets to work in design vs run mode.  I consider this a bug, and it really needs to be fixed.  It's a major source of wasted development time.  Once things get bollixed up one has to 'Clean' the project, recompile, sometimes exit the IDE and restart it, and in two cases last week I had to restore files from the day before to get back to a certain starting point.

If anyone knows a solution to this issue, I would be extremely grateful for any help that can be rendered!

Regards,

Rich

(

Partial

 

 

Public Class RequisitionMasterReport

 

 

 

Inherits Telerik.Reporting.Report

 

 

 

Public Sub New()

 

InitializeComponent()

 

 

'Me.DataSource.ConnectionString = ConfigurationManager.ConnectionStrings("WFL_TelerikReports").ConnectionString

 

 

 

'Me.DataSource.ProviderName = ConfigurationManager.ConnectionStrings("WFL_TelerikReports").ProviderName

 

 

 

End Sub

 

 

 

Public Property RequisitionObjectID As Integer

 

 

 

Get

 

 

 

Return Me.ReportParameters("ReqOI").Value

 

 

 

End Get

 

 

 

Set(ByVal value As Integer)

 

 

 

Me.ReportParameters("ReqOI").Value = value

 

 

 

End Set

 

 

 

End Property

 

End

 

 

Class

 

)

10 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 20 Oct 2011, 05:12 PM
Hi Richard,

The ConfigurationManager class searches for connection strings in the configuration file of the current executing application. Since at design-time the current executing application is Microsoft Visual Studio, the ConfigurationManager class cannot find your connection string, so the constructor of the Report crashes with an exception preventing the designer to start. To resolve this, do not use the ConfigurationManager class to specify your connection string. Instead you can assign the name of the connection string directly to the ConnectionString property of the SqlDataSource component (in this case specifying a value for the ProviderName property is not required). The SqlDataSource component has a special design-time logic to resolve the connection string from the configuration file of the report class library, while at runtime it uses the ConfigurationManager class to resolve the connection string as usual. This ensures that reports utilizing the SqlDataSource component 'just work', regardless of whether they are executed at design-time or at runtime.

Regards,
Ivan
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
Richard
Top achievements
Rank 1
answered on 25 Oct 2011, 05:19 PM
Hello Ivan!
I had actually looked at that documentation and didn't see the context of where that was supposed to work so I ended up using a different walkthrough document which showed the code I had used.  Anyhow, I changed it to match what you sent me but am still getting the OCIEnvCreate error, when attempting to preview the report.  I also get the same error when I go into the Properties dialog for the sqlDataSource object for the report.  This occurs as I progress through to execute the report's query as a validation step. 

I can't get to my real problem until the OCIEnvCreate error is resolved.  Can you tell me what causes this?

I still have this and the original problem I set out to solve, which is that the parameter I'm setting at runtime isn't being recognized.  The report has five subreports which are also supposed to receive the parameter according to the walkthrough document I followed.  I'm completely new to Telerik Reports and this is the first one I've ever done.  I tested each subreport independently and it works for the default parameter I set.  Each subreport has an identical parameter (to the master report), and also had a filter set such that the appropriate Fields member is set equal to the parameter as: =Fields.REQSUM_OI = Parameters.ReqOI.Value where ReqOI is the parameter in the master report, and also the subreport.

Here's what the code for the master report looks like now.  The ReqOI parameter is set at runtime from the calling page.

Format Code Block (

Imports

 

 

System.ComponentModel

 

Imports

 

 

System.Drawing

 

Imports

 

 

System.Windows.Forms

 

Imports

 

 

Telerik.Reporting

 

Imports

 

 

Telerik.Reporting.Drawing

 

Partial

 

 

Public Class RequisitionMasterReport

 

 

 

Inherits Telerik.Reporting.Report

 

 

 

Public Sub New()

 

InitializeComponent()

 

 

Me.DataSource.ConnectionString = "WFL_TelerikReports"

 

 

 

End Sub

 

 

 

Public Property RequisitionObjectID As Integer

 

 

 

Get

 

 

 

Return Me.ReportParameters("ReqOI").Value

 

 

 

End Get

 

 

 

Set(ByVal value As Integer)

 

 

 

Me.ReportParameters("ReqOI").Value = value

 

 

 

End Set

 

 

 

End Property

 

End

 

 

Class

 


 

 

'code from the calling page sets the report object's parameter

 

oTelerikReport =

 

New WFL_TelerikReportsLibrary.RequisitionMasterReport

 

oTelerikReport.RequisitionObjectID = ParameterValue


)
0
Steve
Telerik team
answered on 27 Oct 2011, 03:20 PM
Hi Richard,

Can you elaborate which help article/documentation you refer to and what part of "what you sent me" have you used. Since you state that you're now using the SqlDataSource Component, the connectionString should not be the problem and we suspect the issue might be related to Oracle itself. Check the following links:

Regards,
Steve
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
Richard
Top achievements
Rank 1
answered on 27 Oct 2011, 04:30 PM
Hello Steve!
FYI, we filed a ticket on this issue last week... it would be in the name of my boss since he's the only one who can log tickets.  I'm fine with pursuing this on the forum, especially if the answer is helpful to others.  I've done my share of lurking on these forums as I come up to speed on the various Telerik components.  FYI, I'm not a .net newbie... I've had my MCSD credentials for many years now and have been a developer for over 25 years.  I'm just new to Telerik.

The master/detail walkthrough I used was http://www.telerik.com/help/reporting/designing-reports-master-detail.html.  The original connection string code was from a sample project you had posted on http://www.telerik.com/community/forums/reporting/telerik-reporting/use-web-config-for-sql-connection.aspx called parameterconnstring.zip.  The code as written didn't work for me so I modified it to set the actual connection string and data provider properties.  At that point my project was able to run and successfully invoke the Telerik report.  I thought all was well at that point, but in testing we found that the report's default parameter was providing the results and that the parameter passed at runtime was being ignored.

The application uses the Oracle.DataAccess namespace for Oracle access as we use ODP.Net for our web apps.  I tried that provider in the report and it failed so I stayed with the (deprecated) System.Data.OracleClient namespace the report defaults to as that seemed to work fine.

I think the OCIEnvCreate problem has to be something to do with the report.  My reasoning is this: the report ran fine from the application before I tried to go back to design mode to figure out why the runtime parameter is being ignored.  I have a stable development machine and no new programs or updates have been made during this process.  I checked all the articles you referenced, and recall having seen most of them before to no avail.  The one I hadn't seen indicated that ASPNET needed permissions to the Oracle folders.  I checked that, and that was already set up.  ASPNET is a member of the USERS group on my machine and that group has full permissions on the parent Oracle directory and all children.

The rest of my application is behaving itself in all respects, including database access. SQLPlus and SQL Developer are working fine.  Other applications using the Oracle client are also working fine.  I checked the Oracle Home in the registry and it's set as it's supposed to be.

This current problem didn't occur until I uncommented the code to set the connection string in the reports constructor.  While I await a reply, I think I might try restoring the report files from a prior backup and see if this problem resolves itself.  That has worked before in my short experience with Telerik Reports, but it's a pain to have to do rework!  it seems that the reports get themselves confused and in design mode will show errors that are not easily cleared.  I've used the Build | Clean option in VS2010 and sometimes that works.  Other times I close and reopen the IDE and sometimes that works.  Yet other times I've had to restore report files from backups to get back to work.  That's just unacceptable!

Please let me know if you need more code samples.  I'd also like to know what the syntax is for code snippets.  Both times I did that it didn't look right so I must be misreading the legend on the forum.

Thanks!

Rich

0
Ivan
Telerik team
answered on 28 Oct 2011, 02:29 PM
Hello Richard,

The OCIEnvCreate error is too generic to guess what might be the problem, and you are the first one to report such an issue. Since we have already tested Telerik Reporting with ODP.NET and it works correctly on our end, we suspected that the error is related to something on your client machine. To diagnose the problem we need at least the full error message and the stack trace of the exception. To get the full error open Data Explorer and select the SqlDataSource component in the designer. When the error message appears at the bottom of the window click on the small plus (+) icon to expand it. We also need to confirm whether you receive the same or similar error when running the report from your Web application, or the error occurs only at design-time.

Regarding the help topic describing how to pass a connection string to SqlDataSource, it is located here: Connecting the SqlDataSource component to a Data Source.

Kind regards,
Ivan
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
Richard
Top achievements
Rank 1
answered on 02 Nov 2011, 12:26 AM
Hello Ivan!
Sorry for the delay, my project is in late stages and I'm supporting testing while at the same time trying to develop this report which is one of the final pieces the users need.

I've restored my report files to an earlier version and have reverted the provider to System.Data.OracleClient.  Telerik will simply not work at all with Oracle.DataAccess.Client even after I changed the references in the class library.

I changed the master and each subreport such that in Sub New() it's setting Me.DataSource.ConnectionString = "WFL_TelerikReports"

The report now runs in the application again, albeit it doesn't bring back the right data because of the parameter issue, but refuses to run in design mode.  I can change the ConnectionString property of the sqlDataSource by editing it, but it will not allow me to progress through the wizard.  As soon as I attempt to progress past the query itself, I get the OCIEvnCreate error.

Here is the stack trace as requested from the DataExplorer which reads: no data source:

The error is "OCIEnvCreate failed with return code -1 but error message text was not available."

Format Code Block(System.Exception: OCIEnvCreate failed with return code -1 but error message text was not available.
   at System.Data.OracleClient.OciHandle..ctor(OciHandle parentHandle, HTYPE handleType, MODE ocimode, HANDLEFLAG handleflags)
   at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)
   at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)
   at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.OracleClient.OracleConnection.Open()
   at Telerik.Reporting.Processing.Data.SqlProviderFactory.LoadSettings(IDbConnection connection, SqlCommandParser parser)
   at Telerik.Reporting.Processing.Data.SqlProviderFactory.CreateResolver(IDbConnection connection)
   at Telerik.Reporting.Processing.Data.SqlCommandProvider.ResolveStatement(IDbCommand command, SqlDataSourceParameterCollection parameters)
   at Telerik.Reporting.Processing.Data.SqlCommandProvider.CreateParameters(IDbCommand command, SqlDataSourceParameterCollection parameters)
   at Telerik.Reporting.Processing.Data.SqlQueryProvider.CreateCommand(IDbConnection connection, Boolean evaluateParameters)
   at Telerik.Reporting.Processing.Data.SqlSchema.FillSchema(SqlQueryProvider queryProvider)
   at Telerik.Reporting.Processing.Data.SqlSchema..ctor(SqlQueryProvider queryProvider)
   at Telerik.Reporting.Processing.Data.SqlQueryProvider.CreateSchema()
   at Telerik.Reporting.Processing.Data.MultidimensionalQueryProvider.GetSchema()
   at Telerik.Reporting.Design.DataSourceService.GetCurrentDataSourceSchema(Boolean throwOnError)
   at Telerik.Reporting.Design.DataExplorerControl.RefreshDataSource())
0
Ivan
Telerik team
answered on 02 Nov 2011, 12:51 PM
Hello Richard,

Thank you for the provided information. The error returned from the Oracle provider is not very informative, however the fact that the report runs from your application and fails only at design-time might be a clue. Can you provide us with more information about which version of the operating system and which version of the Oracle client are you using? The reason we are asking this is because we have run across some issues with the 64-bit Oracle client. Since Visual Studio is a 32-bit application, the designer runs in 32-bit mode, so it cannot use the 64-bit Oracle client, it needs the 32-bit one instead. The problem seems to resolve itself after installing Oracle Developer Tools for Visual Studio. The tools come with the right driver for Visual Studio, so you can use Oracle.DataAccess.Client at design-time. In fact this is the Oracle client we are currently using to test our design-time support for Oracle databases.

Best wishes,
Ivan
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
Richard
Top achievements
Rank 1
answered on 02 Nov 2011, 03:31 PM
Hello Ivan!
Here's the info you asked for (and a few bits more, not sure if they're all relevant, but no sense in making you ask for more if you need it!)

Windows OS version = 5.1 (build 2600.xpsp_sp3_gdr.101209-1647: Service Pack 3)
Physical memory available = 2GB

Oracle.DataAccess.dll
path=c:\oracle\ODAC111\ODP.NET\bin\2.x\Oracle.DataAccess.dll
runtime version = v2.0.50727
version = 2.111.6.20

System.Data.OracleClient.dll
path=C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.OracleClient.dll
Runtime Version = v4.0.30319
Version = 4.0.0.0

Microsoft Visual Studio 2010
Version 10.0.30319.1 RTMRel
Microsoft .NET Framework
Version 4.0.30319 RTMRel

Installed Version: Professional

Microsoft Office Developer Tools   01018-532-2002181-70410
Microsoft Office Developer Tools

Microsoft Visual Basic 2010   01018-532-2002181-70410
Microsoft Visual Basic 2010

Microsoft Visual C# 2010   01018-532-2002181-70410
Microsoft Visual C# 2010

Microsoft Visual C++ 2010   01018-532-2002181-70410
Microsoft Visual C++ 2010

Microsoft Visual F# 2010   01018-532-2002181-70410
Microsoft Visual F# 2010

Microsoft Visual Studio 2010 Team Explorer   01018-532-2002181-70410
Microsoft Visual Studio 2010 Team Explorer

Microsoft Visual Web Developer 2010   01018-532-2002181-70410
Microsoft Visual Web Developer 2010

Crystal Reports Templates for Microsoft Visual Studio 2010  
Crystal Reports Templates for Microsoft Visual Studio 2010

Hotfix for Microsoft Visual Studio 2010 Professional - ENU (KB982218)   KB982218
This hotfix is for Microsoft Visual Studio 2010 Professional - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/982218.

IBM Rational Team Concert   3.0  I30_20101112-1327
IBM Rational Team Concert
Version: 3.0
If you need assistance with this  product, visit http://www.jazz.net
Licensed Material - Property of IBM Corp. © Copyright IBM Corp. and its licensors 2000, 2008.  All Rights Reserved. IBM, the IBM logo, Jazz, and Rational are trademarks of IBM Corporation, in the United States, other countries, or both.
Portions Copyright 2008, Microsoft Corporation.  All rights reserved.

Microsoft Visual Studio 2010 SharePoint Developer Tools   10.0.30319
Microsoft Visual Studio 2010 SharePoint Developer Tools

Telerik MVC VSExtensions   2011.01.315.0
Telerik Extensions for ASP.NET MVC VSExtensions Package

Telerik OpenAccess ORM   2011.1.316.10
Telerik OpenAccess ORM Copyright (C) 1996-2011 Telerik; OpenAccess is the Object-Relational Mapping Tool for the Microsoft .NET Platform. www.telerik.com

Telerik Reporting  
For more information please visit http://www.telerik.com/reporting. Copyright © 2005–2011 Telerik, Inc.

Telerik Silverlight VSExtensions   2011.01.315.0
Telerik RadControls for Silverlight VSExtensions Package

Telerik WebUI Test Studio   2010.3.1421.0
Telerik WebUI Test Studio Developer Edition. For more information see <http://www.telerik.com/automated-testing-tools/products/webui-test-studio-developer-edition.aspx>.

Telerik WebUI VSExtensions   2011.01.315.0
Telerik RadControls for ASP.NET AJAX VSExtensions Package

Telerik WinForms VSExtensions   2011.01.315.0
Telerik RadControls for WinForms VSExtensions Package

Telerik WPF VSExtensions   2011.01.315.0
Telerik RadControls for WPF VSExtensions Package

0
Ivan
Telerik team
answered on 07 Nov 2011, 12:53 PM
Hello Richard,

Thank you for the provided information. We have tried to reproduce your scenario (Windows XP SP3; ODAC 11.1.0.6.21; Visual Studio 2010), however we have failed to reproduce the OCIEnvCreate error on our end. According to our tests the design-time support in Visual Studio 2010 works without problems with the 'System.Data.OracleClient' data provider. This lead us to conclude that there is something wrong with the installation of ODAC on your machine. We have also noticed that you are using a rather old version of ODAC (11.1.0.6.21 as we have guessed from the assembly version you have given to us), which does not have support for .NET Framework 4.0 and integration in Visual Studio 2010. This explains why you cannot use the 'Oracle.DataAccess.Client' provider - your version does not have assemblies compiled for the .NET Framework 4.0. Our suggestion is to uninstall your outdated version of ODAC and perform a clean install of the most recent one, or better install the latest Oracle Developer Tools for Visual Studio, which come with ODAC and offer an improved integration with Visual Studio 2010.

Hope this helps.

Kind regards,
Ivan
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
Richard
Top achievements
Rank 1
answered on 15 Nov 2011, 05:40 PM
Hello, Ivan!
Sorry for the delay in responding... our project is going fast and furiously towards implementation.  FYI, I cannot update the ODP.net installation as we have to be at the version currently deployed on the webserver.  I'm a bit mystified at your response.  I'm using VS2010 with ODP.Net and Framework 4.0.  This Telerik report effort is the ONLY thing that isn't working properly.  Everything else is working perfectly.  I will have to return to this issue after this app is deployed.  I don't have time for this now.  I was really hoping Telerik Reports would be easy to use.  It appears not to be up to the standard of the rest of your products.  I'm in love with the RadGrid for example.

Regards,

Rich
Tags
General Discussions
Asked by
Richard
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Richard
Top achievements
Rank 1
Steve
Telerik team
Share this question
or