Print Page | Close Window

Report does not load in web server but local ok

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14584
Printed Date: 03 May 2025 at 12:35pm


Topic: Report does not load in web server but local ok
Posted By: tic.franca
Subject: Report does not load in web server but local ok
Date Posted: 04 Oct 2011 at 6:04am

I'm working with vs 2010 C#, iis7 and Crystal Reports 2010 .

I did a Report and it works fine when I'm in development environment debbuging in my local machine.

But , when I publish the application in the server, everything works fine, except the report.

When I click the buttin that calls it, the screen where it should be opened appear in blank.

Plaease help me..

Thanks in advance.

 

Thiqago

 

using

System;

using

System.Collections.Generic;

using

System.Linq;

using

System.Web;

using

System.Web.UI;

using

System.Web.UI.WebControls;

using

CrystalDecisions.CrystalReports.Engine;

using

CrystalDecisions.Shared;

using

JCI.Intranet.Business.Facade;

using

System.Configuration;

 

 

namespace

JCI.Intranet.Web.TwcPortal

{

public partial class ReportTwcSales :

PageBase

{

protected override void Page_Load(object sender, EventArgs e)

{

int idUserInsert = Convert.ToInt32(HttpContext.Current.Items["USERID"].ToString());

ReportDocument cryRpt = new ReportDocument();

TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();

TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();

ConnectionInfo crConnectionInfo = new ConnectionInfo();

Tables CrTables;

cryRpt.Load(Server.MapPath("TwcSales.rpt"));

crConnectionInfo.ServerName =ConfigurationManager.AppSettings["ServerName"];

crConnectionInfo.DatabaseName =ConfigurationManager.AppSettings["DatabaseName"];

crConnectionInfo.UserID =ConfigurationManager.AppSettings["UserID"];

crConnectionInfo.Password =ConfigurationManager.AppSettings["Password"];

CrTables = cryRpt.Database.Tables;

foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)

{

crtableLogoninfo = CrTable.LogOnInfo;

crtableLogoninfo.ConnectionInfo = crConnectionInfo;

CrTable.ApplyLogOnInfo(crtableLogoninfo);

}

cryRpt.RecordSelectionFormula = "{TB_TMP_TWCSALES.ID_UserInsert} = " + idUserInsert.ToString();

crvTwcSales.ReportSource = cryRpt;

crvTwcSales.RefreshReport();

}

 




Print Page | Close Window