Click here to Skip to main content
15,882,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using SAP Crystal report for showing report in web application.When i am run the application then report viewer is showing the report when i am uploading the page into web server then report viewer is not showing the report,it only showing the blank aspx page without the crystal report.Can anyone help me what is the problem is

ASPX Code:
XML
<%@ Page Title="" Language="C#" MasterPageFile="~/Mainmenu.Master" AutoEventWireup="true" CodeBehind="PFRV.aspx.cs" Inherits="ApexServices.PFRV" %>
<%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="tabtnvoiceransaction">

        <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
            AutoDataBind="True" EnableDatabaseLogonPrompt="False"
            GroupTreeImagesFolderUrl="" Height="1202px"
            ReportSourceID="CrystalReportSource1" ToolbarImagesFolderUrl=""
            ToolPanelWidth="200px" Width="1104px" />


    </div>
</asp:Content>


CS Code:
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;
namespace ApexServices
{
    public partial class PFRV : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ReportDocument cryRpt = new ReportDocument();
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
            Tables CrTables;
            //var path = Server.MapPath("reportfiles\\PTaxLoc.rpt");
            var path = Server.MapPath("reportfiles\\PFRpt.rpt");
            cryRpt.Load(path);
            crConnectionInfo.ServerName = ".";
            crConnectionInfo.DatabaseName = "Apex";
            crConnectionInfo.UserID = "sa";
            crConnectionInfo.Password = "admin123";
            CrTables = cryRpt.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }

            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.RefreshReport();
        }
    }
}
Posted
Updated 17-Mar-14 8:41am
v3
Comments
Sandip Paul 491984 18-Mar-14 2:46am    
please solve m problem
thatraja 31-Mar-14 7:14am    
You have data in your database? any error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900