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();
}