我如何解决问题 [英] How Do I Resolved Problem

查看:136
本文介绍了我如何解决问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ReferenceError:没有定义bobj

当我访问部署在iis服务器上的基于水晶报表的应用程序时,这是错误

当我在本地主机上工作时我得到了相同的错误然后我已经在我的项目解决方案的资源管理器中放置了C:\inetpub \wwwroot \ aspnet_client \system_web \4_0_30319 \crystalreportviewers13脚本文件和文件夹然后问题得到解决但现在我已经部署来自另一台机器的iis上的相同应用程序,我也做了相同的设置意味着我已经在我的项目根文件夹中放置了相同的(aspnet_client \system_web \4_0_30319 \ crystallporterport13)脚本文件,但它不起作用,报告仍然是空白的浏览器,当我通过浏览器检查元素然后我得到ReferenceError:没有定义bobj



html如同belw



ReferenceError: bobj is not defined
this is the error when i am accessing crystal report based application which is deployed on iis server
while i was working on local host i was getting same error then i have placed "C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13" thse scripting files and folders in my projects solution's explorer then problem got resolved but now i have deployed same application on iis from another machine and there also i have made same setting means i have placed same(aspnet_client\system_web\4_0_30319\crystalreportviewers13") scripting files in my projects root folder but its not working and report is still blank on browser and when i am doing inspect element via browser then i am getting the ReferenceError: bobj is not defined

html is as belw

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="CRM_And_Quotation_System.WebForm2" %>

<%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
<script src="/crystalreportviewers13/js/crviewer/crv.js" type="test/javascript" ></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <br />
&nbsp;<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Generate PDF" />
        &nbsp;<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Send Mail" />
    
        <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True" GroupTreeImagesFolderUrl="" Height="1202px" ReportSourceID="CrystalReportSource1" ToolbarImagesFolderUrl="" ToolPanelWidth="200px" Width="1104px" OnInit="CrystalReportViewer1_Init2" />
        <asp:Label ID="lbl_QuotationId" runat="server" Visible="False"></asp:Label>
        <br />
    
        &nbsp;&nbsp;&nbsp;
        <br />
    </div>
    
    </form>
</body>
</html>





这是页面背后的代码





and this is the code behind page

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;
using CrystalDecisions;
using CrystalDecisions.CrystalReports;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.IO;

namespace CRM_And_Quotation_System
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        string CS = ConfigurationManager.ConnectionStrings["MyConnectionSQLServer"].ConnectionString;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["QuotationId"] != null)
            { 
                    int QuotationId = Convert.ToInt32(Session["QuotationId"]);            
                    lbl_QuotationId.Text = QuotationId.ToString();          
                    CrystalReportViewer1.Visible = true;
                    SqlConnection connection = new SqlConnection(CS);
                    SqlConnection connection1 = new SqlConnection(CS);
                    connection.Open();
                    SqlCommand command = new SqlCommand("Select QuotationId,Comp_CompanyName,Comp_CompanyCity,Comp_CompanyAddress,comp_Pin,comp_ContactNo,cust_CustomerName,Desccription,Price,Quantity,LineTotal,Country,DeliveryPeriod,Excise,Taxes,Freight,PayementTerms,RexrothPartNo From quotation where QuotationId="+lbl_QuotationId.Text.Trim()+ "", connection);
                    SqlDataAdapter adapter = new SqlDataAdapter(command);
                    FinalQuotation1 dataset = new FinalQuotation1();
                    adapter.Fill(dataset);              
                    ReportDocument Report = new ReportDocument();               Report.Load(Server.MapPath("FinalQuotationReport.rpt"));                 
                    Report.SetDataSource(dataset.Tables[1]);
                    CrystalReportViewer1.ReportSource = Report;              
            }
            else
            {
                string display = "Quotation Id Not Found";
                ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + display + "');", true);
            }
        } 
 protected void Button2_Click(object sender, EventArgs e)
        {
            int QuotationId = Convert.ToInt32(Session["QuotationId"]);
            lbl_QuotationId.Text = QuotationId.ToString();
            CrystalReportViewer1.Visible = true;
            SqlConnection connection = new SqlConnection(CS);
            SqlConnection connection1 = new SqlConnection(CS);
            connection.Open();
            SqlCommand command = new SqlCommand("Select QuotationId,Comp_CompanyName,Comp_CompanyCity,Comp_CompanyAddress,comp_Pin,comp_ContactNo,cust_CustomerName,Desccription,Price,Quantity,LineTotal,Country,DeliveryPeriod,Excise,Taxes,Freight,PayementTerms,RexrothPartNo From quotation where QuotationId=" + lbl_QuotationId.Text.Trim() + "", connection);
            SqlDataAdapter adapter = new SqlDataAdapter(command);
            FinalQuotation1 dataset = new FinalQuotation1();
            adapter.Fill(dataset);
            ReportDocument Report = new ReportDocument();
            Report.Load(Server.MapPath("FinalQuotationReport.rpt"));
            Report.SetDataSource(dataset.Tables[1]);
            CrystalReportViewer1.ReportSource = Report;
            Report.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true,"IND " + lbl_QuotationId.Text.Trim()+"-FY15-16");          
        }
    }
  }      





如何克服这个问题?需要帮助

提前谢谢



how do i overcome this problem???need help
Thanks in advance

推荐答案

我通过简单地提供javascript文件路径到crystal report的html页面(.aspx)来解决这个问题



i get rid of this issue by simply providing javascript file path to crystal report's html page(.aspx) as like

<script src="/crystalreportviewers13/js/crviewer/crv.js" type="test/javascript"></script></head>





并在项目文件夹中放置crystalreportviewers13文件夹



and placed crystalreportviewers13 folder in project's folder


这篇关于我如何解决问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆