Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Crystal ReportViewer not showing on the browser but the tool bar appears with Print, export etc.


I am struggling on displaying the Report on the Browser. I am using Visual Studio 2010 and loaded my development box with client Tools.

I am calling a report which is hosted on a Crystal Enterprise Server 13 on a remote location.

The problem I am having right now is I am able to connect to the report without issues and able to see the Control Toolbar like "Print", "Export" icons etc. On clicking on Print or "Export" it is perfectly working as expected with Data. But the Crystal Report View does not show the report on the browser. Not sure why that is happening. is there anything I am missing? Code also pasted below. Please review and do help me quickly in providing an answer as soon as possible please.

All the references are of CrystaDecisions 14.0.35000 versions.

Running the application from my Visual Studio. PLEASE HELP!!

SessionMgr ceSessionMgr = new SessionMgr();
            EnterpriseSession ceSession = ceSessionMgr.Logon("username",
                                    "servername:port", "Enterprise");

            EnterpriseService ceEnterpriseService = ceSession.GetService("", "InfoStore");
            InfoStore ceInfoStore = new InfoStore(ceEnterpriseService);

            EnterpriseService ceRASFactoryService = ceSession.GetService("", "RASReportFactory");
            object rrfObject = ceRASFactoryService.Interface;

            InfoObjects ceInfoObjects = ceInfoStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID='CrystalEnterprise.Report' AND SI_NAME='WMS_TIMESHEET'");

            InfoObject ceInfoObject = ceInfoObjects[1];

            ReportAppFactory myReportAppFactory = (ReportAppFactory)rrfObject;
            myReportClientDocument = myReportAppFactory.OpenDocument(ceInfoObject.ID, 0);
            reportAreaController = myReportClientDocument.ReportDefController.ReportAreaController;

            reportSource = myReportClientDocument.ReportSource;

            CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo connInfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
            CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfos connInfos = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfos();

            CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag propertyBag = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag();

            propertyBag.Add("Database DLL", "crdb_odbc.dll");
            propertyBag.Add("Server Name", "WMS");

            connInfo.Attributes = propertyBag;
            connInfo.UserName = "xxxxx";
            connInfo.Password = "xxxxx";


            //if (IsPostBack)

            //myReportClientDocument.DatabaseController.logon(userId, password);
            myReportClientDocument.DatabaseController.logon("xxxxx", "xxxxx");

            CrystalReportViewer2.Visible = true;
            CrystalReportViewer2.EnterpriseLogon = Session["ceSession"];
            //CrystalReportViewer2.ReportSource = ceReportDocument;
            if (myReportClientDocument == null)
                CrystalReportViewer2.ReportSource =  (ReportClientDocument) Session["ReportClientDocument"];
                CrystalReportViewer2.ReportSource = myReportClientDocument;

            CrystalReportViewer2.HasCrystalLogo = false;
            CrystalReportViewer2.HasExportButton = true;
            CrystalReportViewer2.HasPrintButton = true;
            CrystalReportViewer2.HasGotoPageButton = true;
            CrystalReportViewer2.HasPageNavigationButtons = true;
            CrystalReportViewer2.HasRefreshButton = true;
            CrystalReportViewer2.HasSearchButton = true;
            CrystalReportViewer2.HasToggleGroupTreeButton = true;
            CrystalReportViewer2.BestFitPage = true;
            CrystalReportViewer2.DisplayPage = true;
            CrystalReportViewer2.DisplayToolbar = true;
            CrystalReportViewer2.EnableDrillDown = true;
            CrystalReportViewer2.DocumentView = DocumentViewType.WebLayout;
            CrystalReportViewer2.RequestContext.FetchFromServer = true;

            //CrystalReportViewer2.ReuseParameterValuesOnRefresh = true;

            //CrystalReportViewer2.Width = 350;
            //CrystalReportViewer2.Height = 350;
            CrystalReportViewer2.Page.Title = "The information contained below is not for use or disclosure outside Convergys Corporation except under written agreement.";
            CrystalReportViewer2.PrintMode = CrystalDecisions.Web.PrintMode.ActiveX;

Former Member
Former Member replied

Hi Bhushan

I am using the IE8 and when I try to open the Report from the Crystal Enterprise by browing the url, I am able to open it. So, i believe it should not be the problem.

I think now I am able to resolve that. I am using the CrystalReprotViewer13 (javascript folder) instead of CrystalReportViewer

Now after updating that it worked perfectly.

Thank you once again for the followup here and much appreciated. But I know I have to go through lot many challenges because I am using the Crystal Reports for the first time with an Enterprise setup. I am sure I require everyones support here in this forum.

Thanks much.

-Srinivasa Nadella

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question