Translate

Home > February 2012

February 2012

CR for VS2010, Server 2008/IIS7 "bobj is undefined"

Wednesday, February 29, 2012 Category : 0

This has driven me crazy for weeks and having tried nearly every fix I could find with no avail, I nearly gave up hope. If anyone is having trouble with thisthe solution is:

Copy the crystalreportviewers folder from:
C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\Crystal Reports 2011

Copy to:
C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319

In your website's root web.config file create the following sections taking special note of the resourceURI value. Remove the ~ so that it reads "/crystalreportviewers". Removing the ~ enables reports to display and got rid of the "bobj is undefined" javascript error.

Restart your web in IIS.

Hope this helps somebody!

<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" />
        <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" />
      </sectionGroup>
    </sectionGroup>
 
 </configSections> 
 
<businessObjects>
    <crystalReports>
      <rptBuildProvider>
        <add embedRptInResource="true" />
      </rptBuildProvider>
      <crystalReportViewer>
        <add key="ResourceUri" value="../../crystalreportviewers13" />
      </crystalReportViewer>
    </crystalReports>
  </businessObjects>

Add Custom Button in Gridview

Saturday, February 4, 2012 Category : , 0

Add this code in grid columns section
<asp:TemplateField>
                        <ItemTemplate>
                            <asp:Button ID="btnPay" runat="server" Text="Pay" OnClick="btnPay_Click" />
                        </ItemTemplate>
                    </asp:TemplateField>


Then add following code in CS file

DataControlFieldCell dcf = ((DataControlFieldCell)((Button)sender).Parent);
 GridViewRow gvr = dcf.Parent as GridViewRow;
lblMsg.Text = gvr.Cells[0].Text;

Powered by Blogger.