Wednesday, March 28, 2012

Crystal Report + VS2010 (ASP.NET) -bobj is undefined

Below is the steps copied from this link.

1. You need to use Web Application Project,No Website Project because Web App will combine DLL to project also.
2. Copy C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13 (you'll got it when you install -CRforVS_redist_install_32bit_13_0.exe)   To your project such as  (ProjectName/crystalreportviewers13)
3. copy this below to your web.config
3.1
<configsections>
    <sectiongroup name="businessObjects">
      <sectiongroup name="crystalReports">
        </sectiongroup></sectiongroup></configsections>

<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, 
CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, 
PublicKeyToken=692fbea5521e1304, Custom=null">
           <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler">
      
3.2
 <businessobjects>
      <crystalreports>
        <rptbuildprovider>
          <add embedrptinresource="true">
        </add></rptbuildprovider>
        <crystalreportviewer>
              <add key="ResourceUri" value="/crystalreportviewers13">
      </add></crystalreportviewer>
      <crystalreports>
    </businessobjects>
Note: in case "/crystalreportviewers13" is not working, try to add "~" symbol.

3.4 Publish your web application with FTP Mode to your any folder,and copy this publish to your web server then TEST it!

My Note:
Another issue with the CR runtime installer is that it always install the necessary web files (such as javascript, icons, etc) to "C:\inetpub\wwwroot\aspnet_client\system_web\2_0_50727". So, if you changed your default IIS web folder to somewhere else, please make sure that you copy "crystalreportviewers13" from the above mention folder to your new IIS web folder.

Reference:
http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/ef56f72b-7ede-47d8-ba9e-9e63b9ac0203

No comments:

Post a Comment