cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal viewer is empty (Crystal Report Server with Visual Studio)

Former Member
0 Kudos

Hello everyone,

I've some issues to display a basic report from a Crystal Server 2013 and Visual Studio 2010

Below, the code:

WebForm1.aspx.cs


CrystalReport's DLL are in revision 14.0.3500


using CrystalDecisions.Enterprise;

using CrystalDecisions.Enterprise.Viewing;

using CrystalDecisions.ReportAppServer.Controllers;

using CrystalDecisions.ReportAppServer.ClientDoc;


SessionMgr sessionMgr = new SessionMgr();

string username = "Administrator";

string password = "password";

string server = "server-name";

string auth_type = "secEnterprise";

EnterpriseSession enterpriseSession = sessionMgr.Logon(

                 username, password, server, auth_type);

EnterpriseService enterpriseService = enterpriseSession.GetService("InfoStore");

InfoStore infoStore = new InfoStore(enterpriseService);

enterpriseService = enterpriseSession.GetService("RASReportFactory");

Object psrfObject = enterpriseService.Interface;

ReportAppFactory psReportFactory = (ReportAppFactory)psrfObject;

string queryString = "Select * From CI_INFOOBJECTS "

                + "Where SI_PROGID='CrystalEnterprise.Report' "

                + "And SI_NAME Like 'TestRapportTexte'";


InfoObjects infoObjects = infoStore.Query(queryString);

InfoObject infoObject = infoObjects[1];

         

ReportClientDocument client = new ReportClientDocumentClass();

         

client = psReportFactory.OpenDocument(infoObject.ID, 0);

CrystalReportViewer1.ReportSource = client;

WebForm1.aspx


<CR:CrystalReportViewer  ID="CrystalReportViewer1" runat="server" AutoDataBind="True"

                        Height="550px" Width="1300px" BestFitPage="False"/>


The project has 7 references from Crystal:

CrystalDecisions.CrystalReports.Engine

CrystalDecisions.Entreprise.Framework

CrystalDecisions.Entreprise.InfoStore

CrystalDecisions.Entreprise.Viewing.ReportSource

CrystalDecisions.ReportAppServer.ClientDoc

CrystalDecisions.ReportAppServer.Controllers

CrystalDecisions.Web


Actually, I have no error and no exception but the 'CrystalReportViewer' is always empty.

In the C# file, ReportClientDocument client seems OK with the ID and the name of the report.

Thanks for your feedback


Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hi Marie

As you are using RAS I'd like you to have a look at a sample application called "NET-CS2003 RAS-Managed BE115 Add Tool-Tip" available for download from here:

Look at the code as used in the viewer.espx.cs page and pattern your code on that.

For a summary listing of more sample apps, please see:

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

https://twitter.com/SAPCRNetSup

Former Member
0 Kudos

Hi Ludek,

Thank you for your help.

I will try with the links and I go back to you.

Best regards.

0 Kudos

One other thing to check is the version of the Crystal Web viewer. Check the references and make sure it is version 14 also.

That can cause this issue.

Don

Former Member
0 Kudos

Yes, thank you for your answer, Indeed it was the cause.

I had first crystal viewer 13 and after replacing it with its version 14, the viewer becomes filled.

Answers (0)