Unable to connect to oracle database

Posted by: venkatesan_rajendran on 17 August 2023, 4:27 am EST

    • Post Options:
    • Link

    Posted 17 August 2023, 4:27 am EST

    Hi,

    I am trying to setup oracle data provider in my active reports designer by following the steps provided in the samples page https://www.grapecity.com/activereportsnet/docs/latest/online/oracle-data-provider.html (Used Oracle.ManagedDataAccess package in the project to connect to oracle server)

    I added a connection string as suggested and tried validate data source, it throws connection string invalid error. Tried with different connection string types but still unable to connect. Not sure if anything is wrong in my setup. Appreciate if anyone could help on this. Thanks.

  • Posted 17 August 2023, 9:50 am EST

    Error reported by the tool,

    The connection to the data source could not be opened. Additional information: ‘ORA-50029: OracleConnection.ConnectionString is invalid’

  • Posted 18 August 2023, 7:52 am EST

    Hi,

    I was able to reproduce this issue at my end and this seems to be a bug. I have escalated this issue to our development team and will revert you back once I have any information from them.[AR-31393]

  • Posted 10 February 2025, 11:24 am EST

    Hi,

    We have updated our Active Reports to 18.2.1 version and it seems that now it supports to add custom data provider. Am trying to add the oracle data provider using UseDataProviders method like below as suggested in https://developer.mescius.com/activereportsnet/docs/latest/online/webdesigner_customdataproviders.html but it doesn’t seem to work as expected.

    app.UseReportDesigner(config =>
    {
    	config.UseReportsProvider(reportStore);
    	config.UseResourcesProvider(resourceProvider);
    	config.UseDataProviders([
    		new GrapeCity.ActiveReports.Web.Designer.DataProviderInfo("ORACLE",
    			typeof(Oracle.ManagedDataAccess.Client.OracleClientFactory).AssemblyQualifiedName,
    			typeof(OracleDataConnectionAdapter).AssemblyQualifiedName)
    	]);
    });

    I also tried to add a config file as suggested in https://developer.mescius.com/activereportsnet/docs/latest/online/oracle-data-provider.html. It still didn’t work.

    I don’t see any example related to connecting to Oracle in the web samples. Does the web designer supports oracle or is there anything we are missing ? Please help us on this.

    (Using Active Report Web Designer 18.2.1 in .Net 8)

    Thanks & Regards,

    Venkatesan R

  • Posted 11 February 2025, 4:24 am EST

    Hi Venkatesan,

    Please try out the following suggestions to see if they help:

    1. Install Oracle.ManagedDataAccess or Oracle.ManagedDataAccess.Core NuGet package to be able to use Oracle data.
    2. Add the key for the ORACLE data provider for the designer’s datasource in the script.js:

    arWebDesigner.create('#ar-web-designer', {
    //other code
        data: { dataSets: { canModify: true }, dataSources: { canModify: true, options: { predefinedProviders: [], customProviders: [
            { key: 'ORACLE', name: 'ORACLE' }
                    ]} } }, 
    //other code
    });

    If the issue persists, please share with us your sample replicating the issue along with the steps to replicate the same so that we can have a look at it and assist you further.

  • Posted 12 February 2025, 4:21 am EST

    Hi Katyayny,

    Thanks for the response. The suggested solution worked. Now am able to add Oracle Data Provider and preview the report. But am unable to print the pdf of the same report. Its throwing the following error

    “GrapeCity.ActiveReports.ReportException: ‘Specified data provider was not found: ORACLE.’”

    Using the following code to print the pdf of the report,

    var reportPath = new FileInfo(filePath);
    var pageReport = new GrapeCity.ActiveReports.PageReport(reportPath);
    
    var pdfSetting = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
    var pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
    var outputProvider = new GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider();
    
    pageReport.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);

    Tried adding GrapeCity.ActiveReports.Core.DataProviders reference but still it didn’t work. Please help to resolve this.

  • Posted 12 February 2025, 6:44 am EST

    Hi Venkatesan,

    Where are you using this code along with the Web Designer? Can you share with us your runnable, stripped-down sample application where the issue is replicable? Also, share with us the necessary database dump files so that we can run the sample as well.

  • Posted 13 February 2025, 1:37 pm EST - Updated 13 February 2025, 1:38 pm EST

    Hi Katyayny,

    We are following the steps from this page https://developer.mescius.com/activereportsnet/docs/latest/online/pdf-export-page-rdl.html mentioned under Export Report using PDF Rendering Extension. We were able to export a report with a SQL provider. But unable to export the report which has the custom ORACLE provider as we added above. I don’t have any local oracle db configured. So I am unable to share that. But I shared the code which you can use to add a oracle based report and replicate it. (Have added the button “Export PDF” to export a report where you can replicate the issue. )WebDesigner_CustomSharedDataSources.zip

  • Posted 14 February 2025, 5:41 am EST - Updated 14 February 2025, 5:46 am EST

    Hi Venkatesan,

    We are setting up our Oracle database environment, and it might take some time. Meanwhile, can you please confirm if you are facing this issue when using the inbuilt export option of the Viewer as well?

    Also, please share the screenshot of the issue so that we can share the same with our developers as well, if needed.

  • Posted 14 February 2025, 5:56 am EST - Updated 14 February 2025, 6:01 am EST

    Hi Katyayny,

    The export option inside the viewer works fine. But we have a use case where the user will export the report as PDF from somewhere else in our application. Hence we are using the pdf export library to achieve it. Attached the error screenshot.

  • Posted 14 February 2025, 6:19 am EST

    Hi Venkatesan,

    Oh, maybe the issue is because you are specifying the custom data provider just for the WebDesigner and it’s Viewer. For separate PDF export, try adding the ActiveReports.config file that contains the settings for using the Oracle data provider to your project with its Build Action set as Embedded Resource and Copy to Output Directory set as Copy Always and see if it helps.

    ActiveReports.zip

  • Posted 14 February 2025, 1:42 pm EST

    Hi Katyayny,

    The suggested solution worked. Thank you so much.

  • Posted 16 February 2025, 10:57 pm EST

    Hi Venkatesan,

    Glad to help.:blush:

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels