cancel
Showing results for 
Search instead for 
Did you mean: 

Opening multiple reports in Crystal Reports from VS causes database connect limit in Progress/ Openedge 11.2

Former Member
0 Kudos

Hi Team,

I am working with progress/OpenEdge 11.2 and CR for generate reports, and progress does not support OLE DB drivers. Hence I must use the ODBC connection to run the reports using report viewer. I have followed all the steps in an another thread on the same issue but still the ODBC connection doesn't get closed.

Can you let me know any suggestion or changes I should make to the .net app.

FYI :- No connection string is specified in the .net app. The ODBC connection is inside the Crystal Report it self.

Thanks

Gihan.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

We'll need a heck of a lot more info. Like version of CR, version of .NET and more. Please see the following blog, then ad information to this post:

- Ludek

Former Member
0 Kudos

Hi Ludek

Sorry for the delay in response.

We tried with Crystal Report 2008, Crystal Report 9. The Viewer also tried with 11 and 13.

Progress Openedge 11.2.

MS VS 2010.

64 bit windows 7 OS.

Regards,

Gihan

former_member183750
Active Contributor
0 Kudos

I'm not sure you red the blog I suggested(?), CR 13, or CR 2008 or CR 9 tells me next to nothing - I need the precise version as this will tell me what Service aPck you are using.

In your code, are you closing and disposing of the report object once you are done with it (posting your code here may not hurt...)? Do your reports contain subreports? How many, what section are they in?

Remember, the more info, the faster the resolution.

- Ludek

Former Member
0 Kudos

Hi Ludek,

I'm using Visual Studio 2010 for the application development and Crystal report 8 has used for the report designing. I'm not creating any database connection within my code and connection string is defined within the Crystal report. Here is my full source code to view the Crystal report.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data.Odbc;

using System.Configuration;

using CrystalDecisions.Shared;

using CrystalDecisions.CrystalReports.Engine;

namespace Crystal

{

    public partial class ReportViewerForm : System.Web.UI.Page

    {

        private string reportId = string.Empty;

        ReportDocument report = new ReportDocument();

        protected void Page_Load(object sender, EventArgs e)

        {

            if (!IsPostBack)

            {

                string rptId = String.IsNullOrEmpty(Request.QueryString.Get("param"))

                                                 ? String.Empty

                                                 : Request.QueryString.Get("param");

                if (rptId == "1")

                {

                    ViewState["sPathToReport"] = (@"" + System.Configuration.ConfigurationManager.AppSettings["report1"] + "");

                }

                else if (rptId == "2")

                {

                    ViewState["sPathToReport"] = (@"" + System.Configuration.ConfigurationManager.AppSettings["report2"] + "");

                }

                else if (rptId == "3")

                {

                    ViewState["sPathToReport"] = (@"" + System.Configuration.ConfigurationManager.AppSettings["report3"] + "");

                }

                else if (rptId == "4")

                {

                    ViewState["sPathToReport"] = (@"" + System.Configuration.ConfigurationManager.AppSettings["report4"] + "");

                }

                else if (rptId == "5")

                {

                    ViewState["sPathToReport"] = (@"" + System.Configuration.ConfigurationManager.AppSettings["report5"] + "");

             

                }

             

                ViewState["reportId"] = rptId;

            }

            PrintReport(ViewState["sPathToReport"].ToString());

        }

        private void PrintReport(string rptpath)

        {

            try

            {

                report.Load(rptpath, OpenReportMethod.OpenReportByTempCopy);

               

                if (!IsPostBack)

                {

                    CrystalReportViewer1.ReportSource = report;

                    Session.Add("reoprtSource", report);

                }

                else

                {

                    CrystalReportViewer1.ReportSource = Session["reoprtSource"];

                }

                CrystalReportViewer1.RefreshReport();

            }

            catch (Exception ex)

            {

                throw ex;

            }

        }

        protected void btnClose_Click(object sender, EventArgs e)

        {

            if (this.report != null)

            {

                this.report.Database.Dispose();

                this.report.DataSourceConnections.Clear();

                this.report.Close();

                this.report.Dispose();

            }

            //Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closePage", "window.onunload = CloseWindow();");

        }

    }

}

I have tried with adding CrystalReportViewer1.ReportSource = rptpathinstead of CrystalReportViewer1.ReportSource = report; .  But, database sql connection is not closing when report close. There are no sub reports in my report.

My ODBC connection has configured with Progress Openedge 11.2.

Regards,

Gihan.

Former Member
0 Kudos

Hi Ludek

Do we have an update on this, we are stuck without no way out of this solution and your help is really appreciated.

Regards,

Gihan

former_member183750
Active Contributor
0 Kudos

Hi Gihan

I still do not know what version of CR you are actually using. Look at the version of the crpe32.dll and let me know what you find.

Also, reports are created in CR 8?! That's like 17 year old version of CR... See if you can update the reports to CR 2013. An eval of the CR 2013 designer can be downloaded from here:

SME Free Trials | SME Software | SAP

Test one report crated in CR 2013 from scratch and one update via "Save As".

- Ludek

Former Member
0 Kudos

Hi Ludek

I think we are deviating from the original issue.

We are using VS 2010 and CR Version 08.

We can open the reports 2 times using the VS solution. But third time we can't as CR doesn't release the ODBC connection to Progress.

Please note that the client is using CR 8 and we need to give the solution for CR 8.

Regards,

Gihan

former_member183750
Active Contributor
0 Kudos

I do not know what "CR Version 08" is. Never heard of it. Until I am clear on what you are actually using in your app, etc.

Please note that CR 8 is out of support, has been for years and years thus solution will possibly be difficult / impossible to provide...

- Ludek

Answers (0)