9 Replies Latest reply: Jan 17, 2012 8:04 PM by Ludek Uher RSS

Version Mismatch on Deployment

Dan Hurwitz
Currently Being Moderated

Hi,

 

I think I have a version mismatch problem here on deployment, but cannot figure out how to resolve it. We have two ASP.NET web apps deployed, called App1 and App2. Both use Crystal Reports. The reports display fine in a report viewer on App1 but on App2 all I get is a blank viewer.

 

App1 was originally developed in Visual Studio 2008 along with CR2008, incorporating CrystalDecisions.Web ver. 12.0.2000. Then it was deployed to the server, along with appropriate redistributable. It all worked fine.

 

App2 came along, and I switched to VS2010 and CR2010. I also converted App1 to build and run on my dev machine in VS2010 and CR2010, using CrystalDecisions.Web ver. 13.0.2000. On my dev machine, both apps run fine and report fine.

 

I deployed App2 to the server, along with the appropriate redistributable for CR. I did not deploy the updated App1. So now on the server, App1 is looking for ver. 12.0.2000.0 of CrystalDecisions.Web in the GAC, and App2 is looking for ver. 13.0.2000.0.

 

I have verified that both versions of CrystalDecisions.Web are in the GAC.

 

Now App1 still reports fine on the server (although there were some non-reproducible hiccups), but App2 will not display the report. The viewer comes up blank. Again, this works on my dev machine.

 

Any suggestions as to why App2 will not view the reports? The relevant code from the App2 web.config is listed below.  The source code from the page that actually displays the report is in a followup reply, since it seems too large to put in this message.

 

Thanks.

--Dan

 

web.config

<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="businessObjects">
      <sectionGroup name="crystalReports">
        <section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null"/>
      </sectionGroup>
    </sectionGroup>
  </configSections>
  
     <appSettings>
       <add key="CrystalImageCleaner-Age" value="120000"/>
       <add key="CrystalImageCleaner-AutoStart" value="true"/>
       <add key="CrystalImageCleaner-Sleep" value="60000"/>
 
       <!--     DB credentials for CrystalReports -->
          <add key="ReportDatabaseName" value="MyDB"/>
          <add key="ReportPassword" value="myPassword?"/>
          <add key="ReportServerName" value="MyServer"/>
          <add key="ReportUserID" value="MyUser"/>
     </appSettings>
 
     <system.web>
      <compilation debug="true" targetFramework="4.0">
         <assemblies>
           <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
           <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
           <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
           <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
           <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
         </assemblies>
         <buildProviders>
            <add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
         </buildProviders>
      </compilation>
     
       <httpHandlers>
          <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
          <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
       </httpHandlers>
          
       <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
     </system.web>
 
     <system.webServer>
       <handlers>
          <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
          <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
       </handlers>
 
     </system.webServer>
 
   <businessObjects>
      <crystalReports>
         <rptBuildProvider>
            <add embedRptInResource="true"/>
         </rptBuildProvider>
      </crystalReports>
   </businessObjects>
</configuration>



 

  • Re: Version Mismatch on Deployment
    Dan Hurwitz
    Currently Being Moderated

    Here is the rest of the source code, both declarative and code-behind.

     

    ReportPage.aspx

    <%@ Page Title="" Language="C#" AutoEventWireup="true" CodeFile="ReportPage.aspx.cs"
         Inherits="Reports_ReportPage" %>
    
    <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
         Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
         
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head2" runat="server">
         <title></title>
    </head>
    <body>
         <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager2" runat="server"></asp:ScriptManager>
         
         <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" 
          AutoDataBind="True"
              GroupTreeImagesFolderUrl="" 
              Height="1158px" 
              ToolbarImagesFolderUrl=""
              ToolPanelWidth="200px" 
              Width="1059px" />
    
         </form>
    </body>
    </html>
    

     

    ReportPage.aspx.cs

    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Text;                                   
    
    public partial class Reports_ReportPage : Page
    {
         ReportDocument rptDoc;
    
         protected void Page_Load(object sender, EventArgs e)
         {
              #region QueryStrings
              long lngKeyFieldID = -1;
              string strReportName = string.Empty;
              string strReportType = string.Empty;
              
              if (Request.QueryString["strReportName"] != null)
                   strReportName = Request.QueryString["strReportName"].ToString();
    
              if (Request.QueryString["strReportType"] != null)
                   strReportType = Request.QueryString["strReportType"].ToString();
    
              if (Request.QueryString["KFID"] != null)
              {
                   lngKeyFieldID = Convert.ToInt64(Request.QueryString["KFID"]);
              }
              #endregion          //  QueryStrings
    
              rptDoc = new ReportDocument();
    
              string strReportSourceFolder = ConfigurationManager.AppSettings["ReportSourceFolder"];
              rptDoc.Load(strReportSourceFolder + strReportName + ".rpt");
    
          #region parameters
          if (lngKeyFieldID > 0)
              {
             //  set parameters based on rpt name
                   switch (strReportName)
                   {
                        case "JobDetails":
                             rptDoc.SetParameterValue("JobID", lngKeyFieldID);
                             rptDoc.SetParameterValue("IsPaid", true);
                             break;
                   }          
              }
              #endregion          //  parameters
     
              #region DB connection
              //  from Deepu at SAP tech support
              //  this is necessary to pass db credentials programmatically
              //  the report must be designed in CR using an OLE DB connection type
              ConnectionInfo conn = new ConnectionInfo();
              conn.ServerName = ConfigurationManager.AppSettings["ReportServerName"];
              conn.DatabaseName = ConfigurationManager.AppSettings["ReportDatabaseName"];
    
              if (conn.ServerName == "Dev")
                   conn.IntegratedSecurity = true;
              else
              {
                   conn.UserID = ConfigurationManager.AppSettings["ReportUserID"];
                   conn.Password = ConfigurationManager.AppSettings["ReportPassword"];
              }
    
              Tables tables = rptDoc.Database.Tables;
              foreach (Table table in tables)
              {
                   TableLogOnInfo tableLogonInfo = table.LogOnInfo;
                   tableLogonInfo.ConnectionInfo = conn;
                   table.ApplyLogOnInfo(tableLogonInfo);
              }     
              #endregion          //  DB connection
    
              #region Viewer
              CrystalReportViewer1.DisplayGroupTree = false;          //  deprecated, but still works
              CrystalReportViewer1.DisplayToolbar = true;
              CrystalReportViewer1.HasToggleGroupTreeButton = false;
              CrystalReportViewer1.HasToggleParameterPanelButton = false;
    
              CrystalReportViewer1.Page.Title = strReportName;
    
              CrystalReportViewer1.ReportSource = rptDoc;
              #endregion          //  Viewer
         }          
    
         protected void Page_Unload(object sender, EventArgs e)
         {
              if (rptDoc != null)
              {
                   rptDoc.Close();
                   rptDoc.Dispose();
              }
         }
         
    }
    

     

  • Re: Version Mismatch on Deployment
    Dan Hurwitz
    Currently Being Moderated

    Still working this problem. Lots of hints but no answers yet.

     

    When the viewer comes up blank for App2, there is a yellow warning icon in the status bar. Double clicking gives the error msg:  "'bobj' is undefined"

     

    Looking at the the virtual directory for App1 (which works) there is the following folder structure:

        

    aspnet_client
          system_web
             2_0_50727
                crystalreportsviewers12
                  js
                  lots of other folders and files

    The js subfolder contains a number of folders and files containing JavaScript.

     

    There is no comparable folder under the App2 virtual directory, but I found something comparable in c:\program files\SAP BusinessObjects.  So I copied the crystalreportsviewers from there to the App virtual directory as follows:

        

    aspnet_client
          system_web
             4_0_30319
                crystalreportsviewers

    No luck.  The report viewer still comes up blank and the warning icon still indicates "'bobj' is undefined".

     

    Any suggestions?  This really smells like some javascript library is not getting loaded.

     

    Thanks.

     

    --Dan