on 07-01-2015 6:08 AM
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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 = rptpath; instead 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.
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
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
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.