Crystal Report and Ext.net

  1. #1

    Crystal Report and Ext.net

    Hello good morning :)

    For the last 2 days i've been banging my head over the wall, figuring out why my crystal report didn't appear on my aspx page.
    In the page that had my crystal report i had a few textboxes to create the report dinamically, these textboxes were created using ext.net.

    Anytime i would add a reference my ext.net reference always was sort of reloaded. Finally i decided to commentate these controls created with ext.net and just leave the page with the report, and now my report is correctly displayed.

    My question is this: Is it a bug or is it a conflict between CR and ext.net?

    Im using Visual studio 2010 + CR Version=13.0.2000.0 and Ext.Net 1.2

    Thx before hand :)

    This is the code of the asp page.

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="reporteKardex.aspx.cs" Inherits="reporteKardex" %>
    <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" 
        Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
    
    <%--<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>--%>
    
    <!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 runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
    <%--    <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:TextField ID="txtcod" runat="server" FieldLabel="COD PROD" />
        <ext:TextField ID="txtalmacen" runat="server" FieldLabel="almacen" />
        <ext:DateField ID="txtfechaini" runat="server" FieldLabel="Fecha ini" />
        <ext:DateField ID="txtfechafin" runat="server" FieldLabel="Fecha fin" />
        <ext:Button ID="btReporte" runat="server" Text="Reporte" Icon="ReportDisk" />--%>
    
        <div>
            <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" GroupTreeImagesFolderUrl="" Height="1202px" ReportSourceID="" ToolbarImagesFolderUrl="" ToolPanelWidth="200px" Width="900px" />
        </div>
        
        </form>
    </body>
    </html>
    This is the code behind:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data.SqlClient;
    using System.Data;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using CrystalDecisions.Web;
    
    public partial class reporteKardex : System.Web.UI.Page
    {
        sqlClase objSQL = new sqlClase();
        SqlDataAdapter Adaptador;
    
        protected void Page_Load(object sender, EventArgs e)
        {
            ReportDocument reporte = new ReportDocument();
            dsKardex ds = new dsKardex();
    
            Adaptador = objSQL.getDataAdapterReporte("0007", "1010", "2011-01-11", "2011-30-12", "Entrada");
            Adaptador.Fill(ds, "dtRes");
            reporte.Load(Server.MapPath(@"Reportes\CrystalReportKardex.rpt"));
    
            CrystalReportViewer1.ReportSource = reporte;
            
            reporte.SetDataSource(ds.Tables[0]);
            CrystalReportViewer1.DataBind();
            CrystalReportViewer1.RefreshReport();
    
    
            //Ext.Net.Notification.Show(new Ext.Net.NotificationConfig
            //{
            //    Title = "Kardex",
            //    Icon = Ext.Net.Icon.TableRowInsert,
            //    Html = ds.dtRes.Rows.Count.ToString()
            //});
    
            //this.btReporte.DirectEvents.Click.Event += new Ext.Net.ComponentDirectEvent.DirectEventHandler(Click_Event_btReporte);
        }
    Last edited by geoffrey.mcgill; Dec 23, 2011 at 4:27 AM. Reason: please use [CODE] tags
  2. #2
    Hi,

    What is the link I could download the Crystal Report dll to check?
  3. #3
    This is the crystal report that i downloaded for vs2010

    http://downloads.businessobjects.com...rVS_13_0_2.exe


    Thx in advance :)
  4. #4
    Is it required to install? I would prefer to use just a dll if possible.

    Just trying to keep my PC clear as much as I can:)
  5. #5
    hehehehe u've got it :)

    http://puu.sh/bKUu

    Also i managed to pull off the report thing by sending my variables to the web page that holds the crystal report using Session variables. But it'd be awesome to combine the cr and the ext.net.

    Thx :).
  6. #6
    Thanks a lot.

    I've just tried your example and discovered that it depends on a database and the CrystalReportKardex.rpt file.

    Any chance for me to have some basic example which I can run locally without any chance?

    Just I'm not experienced in Crystal Reports at all.
  7. #7
    Absolutely, i added all the files that you need to run this app.

    i added the page that holds the crystal report, i also added the crystal report itself, an example database, the dataset needed to fill the report. I've added a class that makes the connection betwen sql server all you need to do is fill in the blanks, a method to get the data adapter and pass it directly to the report.

    There is also the codebehind of the page that holds the report. :)

    Thx for your coop :)

    Files: http://puu.sh/bQFF

    P.S: The dataset must be in the folder called App_Code created by VS.

    This is my web.config file :D :http://puu.sh/bQG2
  8. #8
    I had to install Crystal Reports, because it requires 64 bit engine to be installed. I use Windows 7 64 bit.

    Regarding to the example.

    Thanks a lot for your efforts, but could you just share a VS project to download and test without tuning?

Similar Threads

  1. Replies: 3
    Last Post: Jan 09, 2012, 10:09 PM
  2. Crystal Report Viewer is not showing?
    By sadeque in forum 1.x Help
    Replies: 6
    Last Post: Nov 10, 2011, 3:43 PM
  3. [CLOSED] Crystal Report page Count?
    By Vasudhaika in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 23, 2010, 9:02 AM
  4. Crystal Report Viewer Overlap
    By EzaBlade in forum 1.x Help
    Replies: 0
    Last Post: Sep 23, 2009, 1:26 PM
  5. How to add crystal report within panel
    By sadeque in forum 1.x Help
    Replies: 4
    Last Post: Jul 28, 2009, 5:57 AM

Tags for this Thread

Posting Permissions