on 05-23-2014 3:08 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.