reference Oracle Data Provider for .net (Oracle.DataAccess.dll) script for rpx

Originally Posted 27 July 2017, 2:30 am EST

  • Originally Posted 27 July 2017, 2:30 am EST

    I would like to know if possible to reference Oracle Data Provider for .net (Oracle.DataAccess.dll) script for rpx file?

    If possible to reference where do I add this.

    public void ActiveReport_ReportStart()
    {


    }

    this file is in my c drive: C:\\oracle\\product\\11.2.0\\client_1\\odp.net\\bin\\4


    these are the two namespaces that I would like to add and use

    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;

    Please help and share if there is an example for this.

    thanks
  • Reply

    Thank you Deepak Sharma for replay.

    I know I can add the reference in the code behind but in this case I am using designer tool and rpx file is saved in the database and run from the application interface. I was hoping if there is a way to reference dlls from using the designer tool.

    thanks,
  • Reply

    I get attached error when I execute the above code. I am trying to reference Oracle Oracle.DataAccess.dll and use the namespaces:
    Oracle.DataAccess.Client;
    Oracle.DataAccess.Types;

    Please help and let me know what I am missing.

    thanks
    2017/08/error.docx
  • Reply

    private void ActiveReport_ReportStart(object sender, EventArgs e)
    {

    ActiveReport rpt = new ActiveReport();
    rpt.AddScriptReference(@"C:\Oracle12c\product\12.2.0\client_1\odp.net\bin\4\Oracle.DataAccess.dll");

    // Oracle Namespaces
    // rpt.AddScriptReference("Oracle.DataAccess.Client");
    // rpt.AddScriptReference("Oracle.DataAccess.Types");

    string oraDB = "Data Source=XE;User;Password=hr;";
    OracleConnection con = new OracleConnection(oraDB);
    con.Open();
    OracleCommand cmd = new OracleCommand();
    cmd.Connection = con;
    cmd.CommandText = "select department_id, department_name from DEPARTMENTS";
    OracleDataReader reader = cmd.ExecuteReader();


    }


    private void ActiveReport_DataInitialize(object sender, EventArgs e)
    {
    rpt.Fields.Add("department_id");
    rpt.Fields.Add("STATEPROJECTNUM");
    rpt.Fields.Add("VENDORNAME");
    }

    public bool ActiveReport_FetchData(bool eof)
    {
    try
    {
    reader.Read();
    rpt.Fields["department_id"].Value = reader["department_id"].ToString();
    rpt.Fields["department_name"].Value = reader["department_name"].ToString();

    eof = false;
    }
    catch
    {
    eof = true;
    }
    return eof;
    }
  • Marked as Answer

    Reply

    Hello,

    Here I found this blog which can help you to bind oracle data provider to ActiveReports:
    http://arhelp.grapecity.com/2012/12/02/binding-activereports-section-report-to-an-oracle-database/


    Thanks,
    Deepak Sharma
  • Reply

    Hello,

    Looking at the error message it looks the required dlls have not been added to the project both for ActiveReports and Oracle.
    Please make sure you are working in the code behind and using C# /vb.net to code. ActiveReports references are automatically added once you drop a viewer onto the Form or you work with a code based report. In case you do not see the dlls added to the project's references/bin folder please add it manually.


    Thanks,
    Deepak Sharma
  • Reply

    Hello,

    I have asked the developer to look into this issue. I will let you know as soon as I hear anything on this. The tracking id for this issue is 244500.

    Thanks,
    Deepak Sharma
  • Reply

    Thanks Deepak Sharma!!
  • Reply

    Hello,

    Looking at the code it seems you are accessing the Oracle dlls in report's code behind and not in script. In script it shows
    'public void ActiveReport_ReportStart()' but in your code it shows 'private void ActiveReport_ReportStart(object sender, EventArgs e)'.

    Also you are getting the error message for both ActiveReports and Oracle dll(as per the document shared by you). It looks that the references in your project are nor properly added.
    Could you please share the screenshot of the references window and code behind window for report project?

    Thanks,
    Deepak Sharma
  • Reply

    oracle is one of the biggest company who provides the database to us. Now Microsoft also takes help from Oracle. Oracle recently own java, one of the most popular powerful programming language for core development.For more information about Oracle contact https://quickbooksupports.co/customer-service/
Need extra support?

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

Learn More

Forum Channels