StiOracleDatabase Not Found

Stimulsoft Reports.NET discussion
Post Reply
Batuta
Posts: 11
Joined: Tue Aug 21, 2012 9:18 pm

StiOracleDatabase Not Found

Post by Batuta »

Hi,

I am getting this error when trying to run a report connecting to an Oracle database.

Database Stimulsoft.Report.Dictionary.StiOracleDatabase not found

This is part of the error message:

Code: Select all

[Exception: Database Stimulsoft.Report.Dictionary.StiOracleDatabase not found]
   Stimulsoft.Report.Dictionary.StiSqlDatabase.RegData(StiDictionary dictionary, Boolean loadData) +132
   Stimulsoft.Report.Dictionary.StiDictionary.CreateDatabases(Boolean loadData) +202
   Stimulsoft.Report.Dictionary.StiDictionary.Connect(Boolean loadData) +163
   Stimulsoft.Report.Engine.StiRenderProviderV2.ConnectToData(StiReport report) +140
   Stimulsoft.Report.Engine.StiRenderProviderV2.Render(StiReport report, StiRenderState state) +4686
   Stimulsoft.Report.Engine.StiReportV2Builder.RenderSingleReport(StiReport masterReport, StiRenderState renderState) +847
   Stimulsoft.Report.StiReport.RenderReport(StiRenderState renderState) +1588
   Stimulsoft.Report.StiReport.Render(StiRenderState renderState, StiGuiMode guiMode) +952
   Stimulsoft.Report.StiReport.Render() +48
The code I used for the report as follows:

Code: Select all

private void RetrieveReport(string dbSchema, string userName, string passWord)
        {
            string oracleConnection = "Data Source=" + dbSchema + ";User ID=" + userName + ";Password=" + passWord;
            StiReport appReport = new StiReport();
            StiDatabase stiDB = new StiOracleDatabase("Connection", oracleConnection);
            appReport.Load(Server.MapPath("Reports\\BatchPrinters.mrt"));
            appReport.Dictionary.Databases.Clear();
            appReport.Dictionary.Databases.Add(stiDB);
            appReport.Compile();

            //appReport.CompiledReport.Variables["ReportTitle"] = "Batch Printers";
            appReport.Render();

            StiPdfExportSettings pdfSettings = new StiPdfExportSettings();
            StiPdfExportService pdfExport = new StiPdfExportService();
            string strNewGUIId = System.Guid.NewGuid().ToString() + ".pdf";
            string strFileName = Server.MapPath("Reports") + "\\" + strNewGUIId;
            pdfExport.ExportPdf(appReport, strFileName);

            StiWebViewer1.Report = appReport;

            string strPDFFile = Request.ApplicationPath + "/reports/" + strNewGUIId;
            pdfViewer.FilePath = strPDFFile;
            pdfViewer.FilePath = strPDFFile + "#zoom=100";
        }
From the report designer itself, I can use the value of the oracleConnection string variable being built and run the report.

I have also included the DLL that is needed for the OracleClient. (Stimulsoft.Report.OracleClient.dll)

Any areas where I should look at?

Thanks.

B~
Batuta
Posts: 11
Joined: Tue Aug 21, 2012 9:18 pm

Re: StiOracleDatabase Not Found

Post by Batuta »

I am attaching herewith the report and the error message as it appears during VS debug.

Image

I highlighted some areas, because I am unsure why the report would default to that declaration when I am supposed to be connecting with an Oracle Database.

Appreciate your advice. Thanks.

B~
Attachments
BatchPrinters.mrt
Sample Report
(15.19 KiB) Downloaded 456 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: StiOracleDatabase Not Found

Post by Alex K. »

Hello,

Please try to use the following code:

Code: Select all

StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiOracleAdapterService());
StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiOracleDatabase());

string oracleConnection = "Data Source=" + dbSchema + ";User ID=" + userName + ";Password=" + passWord;
StiReport appReport = new StiReport();
StiOracleDatabase stiDB = new StiOracleDatabase("OracleConnection", oracleConnection);
appReport.Load(Server.MapPath("Reports\\BatchPrinters.mrt"));
appReport.Dictionary.Databases.Clear();
appReport.Dictionary.Databases.Add(stiDB);
appReport.Compile();
...
Thank you.
Batuta
Posts: 11
Joined: Tue Aug 21, 2012 9:18 pm

Re: StiOracleDatabase Not Found

Post by Batuta »

Thank you. The code provided made me an idea to make this work.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: StiOracleDatabase Not Found

Post by Andrew »

Hello,

Great!

If you still have issues please contact us. We will help you.
Thank you.
Post Reply