示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["LoginCom"] != null && Session["LoginUser"] != null)
            {
                Com_username = Session["LoginCom"].ToString();
                User         = Session["LoginUser"].ToString();

                if (Request.QueryString["name"] != null)
                {
                    name = Request.QueryString["name"];
                }

                if (Request.QueryString["type"] != null)
                {
                    type = Request.QueryString["type"];
                }
                try
                {
                    ReportDocument rptDoc = new ReportDocument();
                    RecipesDataSet ds     = new RecipesDataSet();
                    DataTable      dt     = new DataTable();

                    dt.TableName = "Crystal Report Example";
                    dt           = getAllRecords(name, type);

                    DataView dv = dt.DefaultView;

                    dt = dv.ToTable();
                    ds.Tables["Batchs"].Merge(dt);

                    rptDoc.Load(Server.MapPath("~/ar/Reports/Batchs.rpt"));
                    rptDoc.SetDataSource(ds);
                    CrystalReportViewer1.ReportSource = rptDoc;
                    CrystalReportViewer1.DataBind();

                    CrystalReportViewer1.DataBind();
                    rptDoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "ExportedReport");
                }
                catch (Exception ex)
                {
                    Response.Write(ex.Message.ToString());
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        con.Open();
        ReportDocument rpt = new ReportDocument();

        rpt.Load(Server.MapPath("~/CrystalReport.rpt"));
        SqlCommand     cmd = new SqlCommand("Select * from Raj_Table[tbl_name]", con);
        SqlDataAdapter da  = new SqlDataAdapter();
        DataSet        ds  = new DataSet();

        da.SelectCommand = cmd;
        da.Fill(ds, "Raj_Table[TableName]");
        rpt.SetDataSource(ds);
        con.Close();
        CrystalReportViewer1.ReportSource = rpt;
        CrystalReportViewer1.DataBind();
    }
示例#3
0
        private void showReport()
        {
            rprt.Load(Server.MapPath("~/CRVFiles/CrystalReport2.rpt"));
            rprt.FileName = Server.MapPath("~/CRVFiles/CrystalReport2.rpt");
            SqlCommand     cmd = new SqlCommand("select  concat(FisrtName,' ',LastName)FullName,sum(p.PaymentAmount)Balance,s.StudentID,t.AcademicYear,sum(p.PaymentAmount)-t.TuitionAmount Balance from studentsmaster s ,tuitions t ,tuitionpayments p where t.FormID=s.ClassNumber and p.StudentID=s.StudentID and s.StudentID='" + txtSID.Text.Trim().ToString() + "' group by s.StudentID ,t.AcademicYear,FisrtName,LastName,TuitionAmount", con);
            SqlDataAdapter sda = new SqlDataAdapter(cmd);
            DataSetEmp     ds  = new DataSetEmp();

            sda.Fill(ds, "DsOSbals");
            rprt.SetDataSource(ds);
            //  rprt.SetParameterValue("sid", txtSID.Text.Trim().ToString());
            // rprt.SetParameterValue("formid", txtform.Text.Trim().ToString());
            CrystalReportViewer1.ReportSource = rprt;
            CrystalReportViewer1.DataBind();
            pdfdemo();
            Response.ClearContent();
        }
示例#4
0
        protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataSet        prueba = (DataSet)Session["dsListProductos"];
            ReportDocument rep    = new ReportDocument();

            if (RadioButtonList1.SelectedValue == "0")
            {
                rep.Load(Server.MapPath("/reports/rptListProductos.rpt"));
            }
            else if (RadioButtonList1.SelectedValue == "1")
            {
                rep.Load(Server.MapPath("/reports/rptListProductos-det.rpt"));
            }
            rep.SetDataSource(prueba);
            CrystalReportViewer1.ReportSource = rep;
            CrystalReportViewer1.DataBind();
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        string path = Server.MapPath("~/Report/MKTSTUDENTDETAILS.rpt");

        rptStudent.Load(path);
        rptStudent.SetParameterValue("@LINKID", Request.QueryString["A"].ToString());
        rptStudent.SetParameterValue("@TERM", Request.QueryString["B"].ToString());
        rptStudent.SetParameterValue("@DEGREE", Request.QueryString["C"].ToString());
        rptStudent.SetParameterValue("@COURSE", Request.QueryString["D"].ToString());
        rptStudent.SetParameterValue("@groupcode", Request.QueryString["F"].ToString());

        rptStudent.SetDatabaseLogon("software", "DelFirMENA$idea");
        CrystalReportViewer1.ReportSource = rptStudent;
        CrystalReportViewer1.DataBind();

        CrystalReportViewer1.BackColor = System.Drawing.Color.White;
    }
示例#6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        con.Open();
        SqlCommand cmd = con.CreateCommand();

        cmd.CommandText = "SELECT     Order_Id,Bill_Id,Customer_Email,Product_Id,Product_Name,Product_Quantity,Order_Amount,Date FROM         dbo.[Order]";
        DataTable      dt = new DataTable();
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(dt);
        con.Close();
        CrystalReportOrder cr = new CrystalReportOrder();

        cr.SetDataSource(dt);
        CrystalReportViewer1.ReportSource = cr;
        CrystalReportViewer1.Zoom(75);
    }
    public void CrystallReportBind()
    {
        SqlConnection  con     = new SqlConnection("Data Source=162.222.225.88;Initial Catalog=rcipune2017;Persist Security Info=True;User ID=rcinfotech;password=Rci@1234");
        String         cl_name = ddClientNames.SelectedValue;
        SqlDataAdapter da      = new SqlDataAdapter("select * from rc_master where cl_name='" + cl_name + "'", con);
        DataSet        dset    = new DataSet();

        da.Fill(dset);
        ReportDocument cryRpt = new ReportDocument();

        cryRpt.Load(Server.MapPath("CLIENTLISTREPORT.rpt"));
        cryRpt.SetDataSource(dset.Tables[0]);

        CrystalReportViewer1.ReportSource = cryRpt;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.SeparatePages = false;
    }
        private void Page_Init(object sender, EventArgs e)
        {
            _ReadCookies();
            if (!IsPostBack)
            {
                lblsch.Text = Request.QueryString["Id"].ToString();
                lblprj.Text = Request.QueryString["Prj"].ToString();
                lbldiv.Text = "0";

                if ((Request.QueryString["div"] != null))
                {
                    lbldiv.Text = Request.QueryString["div"].ToString();
                }

                lblsch1.Text = lblsch.Text;

                Load_Master();
                Session["filter"] = "no";
                Session["zone"]   = "All";
                Session["flvl"]   = "All";
                Session["cat"]    = "All";
                Session["fed"]    = "All";
                Session["loc"]    = "All";

                Load_Filtering_Elements();


                Generate_Graph_Summary_New(lblsch.Text, "1");
                Generate_Reports();
                //if (lbldiv.Text == "0") tdback.Visible = false;

                if (Request.QueryString["Type"].ToString() == "0")
                {
                    tdback.Visible = false;
                }
            }

            else
            {
                if (Session["Report"] != null)
                {
                    CrystalReportViewer1.ReportSource = (ReportDocument)Session["Report"];
                    CrystalReportViewer1.DataBind();
                }
            }
        }
示例#9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        con.Open();
        SqlCommand cmd = con.CreateCommand();

        cmd.CommandText = "SELECT     Bill_Id,Customer_Email,Product_Amount,No_Products,Delivery_Address,Bill_Date FROM         dbo.[Bill]";
        DataTable      dt = new DataTable();
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(dt);
        con.Close();
        CrystalReportBill cr = new CrystalReportBill();

        cr.SetDataSource(dt);
        CrystalReportViewer1.ReportSource = cr;
        CrystalReportViewer1.Zoom(75);
    }
示例#10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Page.Title = "studentreport";
         //string s1 = Session["sid"].ToString();
         SqlConnection  con = new SqlConnection(DBUtil.ConnectionString);
         SqlCommand     com = new SqlCommand("select * from studentreport where Idno='" + Session["idno"].ToString() + "' ORDER BY omarks desc", con);
         SqlDataAdapter da  = new SqlDataAdapter();
         da.SelectCommand = com;
         DataTable dt = new DataTable();
         da.Fill(dt);
         CrystalReportSource1.ReportDocument.SetDataSource(dt);
         CrystalReportViewer1.ReportSource = CrystalReportSource1;
         CrystalReportViewer1.DataBind();
     }
 }
示例#11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         try
         {
             DropDownList1.DataSource     = objProceso.D_consultarProceso();
             DropDownList1.DataTextField  = "Nombre";
             DropDownList1.DataValueField = "IdProceso";
             DropDownList1.DataBind();
             DropDownList2.DataSource     = objPersona.D_consultarPersonaPorProceso();
             DropDownList2.DataTextField  = "Nombre";
             DropDownList2.DataValueField = "IdPersona";
             DropDownList2.DataBind();
             DropDownList2.Items.Add(new ListItem("Todos", "-1"));
         }
         catch
         {
         }
     }
     else
     {
         if (int.Parse(DropDownList2.SelectedValue) != -1)
         {
             ReportDocument crystalrpt = new ReportDocument();
             path = Server.MapPath("");
             crystalrpt.Load(Server.MapPath(@"~/Reportes/ReporteGenerico.rpt"));
             crystalrpt.Refresh();
             crystalrpt.SetParameterValue("@IdProceso", DropDownList1.SelectedValue);
             crystalrpt.SetParameterValue("@IdPersona", DropDownList2.SelectedValue);
             CrystalReportViewer1.ReportSource = crystalrpt;
             CrystalReportViewer1.DataBind();
         }
         else
         {
             ReportDocument crystalrpt = new ReportDocument();
             path = Server.MapPath("");
             crystalrpt.Load(Server.MapPath(@"~/Reportes/ReporteGenericoTodos.rpt"));
             crystalrpt.Refresh();
             crystalrpt.SetParameterValue("@IdProceso", DropDownList1.SelectedValue);
             CrystalReportViewer1.ReportSource = crystalrpt;
             CrystalReportViewer1.DataBind();
         }
     }
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string foldername = Server.MapPath("~/CS_REPORT/rpt/Credit Investigation Tab Info.rpt");

            try
            {
                string    tmp_acctcode   = "";
                string    cardcode       = StringHelper.ReCodeCharacters(DropDownList1.Text);
                DataTable user_counterid = SqlDbHelper.getDataDT("SELECT acctcode FROM customerheader WHERE acctcode='" + cardcode + "' GROUP BY acctcode");
                foreach (DataRow acctCode in user_counterid.Rows)
                {
                    tmp_acctcode = acctCode["acctcode"].ToString();
                }
                Label2.Visible = false;

                CrystalDecisions.Web.Parameter acctcode = new CrystalDecisions.Web.Parameter();
                acctcode.Name         = "Account Code";
                acctcode.DefaultValue = tmp_acctcode;

                ReportDocument rpt1 = new ReportDocument();

                CrystalReportSource1.Report.FileName = foldername;

                CrystalReportViewer1.ReportSource = CrystalReportSource1;
                TableLogOnInfos tblinfos = new TableLogOnInfos();
                TableLogOnInfo  tblinfo  = new TableLogOnInfo();

                tblinfo.ConnectionInfo.DatabaseName          = "ARMS";
                tblinfo.ConnectionInfo.UserID                = "sa";
                tblinfo.ConnectionInfo.Password              = "******";
                tblinfo.ConnectionInfo.ServerName            = "192.168.10.13";
                tblinfo.ConnectionInfo.IntegratedSecurity    = false;
                tblinfo.ConnectionInfo.AllowCustomConnection = true;
                CrystalReportSource1.Report.Parameters.Add(acctcode);

                CrystalReportViewer1.LogOnInfo.Add(tblinfo);

                CrystalReportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
                Label2.Visible = true;
                Label2.Text    = "Error: " + ex.Message;
            }
        }
示例#13
0
 protected void GenerateQuarantineBoxReport(int rptId, string name)
 {
     try
     {
         rptDoc = new ReportDocument();
         CrystalReportViewer1.HasToggleGroupTreeButton = false;
         CrystalReportViewer1.BestFitPage = false;
         CrystalReportViewer1.Width       = 920;
         DataTable dt = us_dll.GetReportData("dbo.spProductInvty");
         if (dt.Rows.Count > 0)
         {
             rptDoc.Load(Server.MapPath("~/Reports/ProductInvty.rpt"));
             rptDoc.SetDataSource(dt);
             rptDoc.SetDatabaseLogon("sa", "Pass2012", "GBLNJ4", "GPLS");
             rptDoc.DataSourceConnections[0].SetConnection("GBLNJ4", "GPLS", "sa", "Pass2012");
             //CrystalReportViewer1.Page.Title = name;
             rptDoc.SummaryInfo.ReportTitle = name;
             // rptDoc.DataDefinition.FormulaFields["cTitle"].Text = "'" + name + "'";
             CrystalReportViewer1.ReportSource = rptDoc;
             Response.ClearContent();
             Response.ClearHeaders();
             Response.ContentType = "application/pdf";
             rptDoc.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat,
                                         Response, true, name);
             CrystalReportViewer1.ToolPanelView = ToolPanelViewType.None;
             CrystalReportViewer1.SeparatePages = true;
             CrystalReportViewer1.DataBind();
             CrystalReportViewer1.HasExportButton = false;
             Response.Flush();
             Response.Close();
         }
         else
         {
             ErrorMessage("Current selection does not have data");
         }
     }
     catch (System.Threading.ThreadAbortException)
     {
         // ignore it
     }
     catch (Exception ex)
     {
         ErrorMessage(ex.Message);
     }
 }
示例#14
0
 //private string Get_ProjectName(string _prj)
 //{
 //    BLL_Dml _objbll = new BLL_Dml();
 //    _database _objdb = new _database();
 //    _clsuser _objcls = new _clsuser();
 //    _objcls.project_code = lblprj.Text;
 //    _objdb.DBName = "DBCML";
 //    return _objbll.Get_ProjectName(_objcls, _objdb);
 //}
 private void Page_Init(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string _prm = Request.QueryString[0].ToString();
         string _id  = _prm.Substring(0, _prm.IndexOf("_R"));
         string _rpt = _prm.Substring(_prm.IndexOf("_R") + 2);
         Generate_Reports(_rpt, Convert.ToInt32(_id));
     }
     else
     {
         if (Session["Report"] != null)
         {
             CrystalReportViewer1.ReportSource = (ReportDocument)Session["Report"];
             CrystalReportViewer1.DataBind();
         }
     }
 }
示例#15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        con.Open();
        SqlCommand cmd = con.CreateCommand();

        cmd.CommandText = "SELECT     Customer_name, Customer_email_id, Mobile_No, Customer_address FROM         dbo.Customer WHERE Active=@a";
        cmd.Parameters.AddWithValue("@a", "yes");
        DataTable      dt = new DataTable();
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(dt);
        con.Close();
        CrystalReportCustomer cr = new CrystalReportCustomer();

        cr.SetDataSource(dt);
        CrystalReportViewer1.ReportSource = cr;
        CrystalReportViewer1.Zoom(75);
    }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
            CrystalReport1 crystalReport = new CrystalReport1();

            if (Request["page"] != null && Request["page"].ToString() == "page1")
            {
                crystalReport.SetDataSource(SampleData.Persons.Where(r => r.PersonName.StartsWith("廖")));
            }
            else
            {
                crystalReport.SetDataSource(SampleData.Persons.Where(r => r.PersonAddress.Contains("台中市")));
            }


            CrystalReportViewer1.ReportSource = crystalReport;
            CrystalReportViewer1.RefreshReport();
        }
示例#17
0
 private void Page_Init(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         lblprj.Text = Request.QueryString[0].ToString();
         //lblbz.Text = Request.QueryString[1].ToString();
         GenerateReport();
         Session["Report"] = null;
     }
     else
     {
         if (Session["Report"] != null)
         {
             CrystalReportViewer1.ReportSource = (ReportDocument)Session["Report"];
             CrystalReportViewer1.DataBind();
         }
     }
 }
示例#18
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string foldername = Server.MapPath("~/CS_REPORT/rpt/mrktprogactivitiesupdate.rpt");

            try
            {
                CrystalDecisions.Web.Parameter myparamss = new CrystalDecisions.Web.Parameter();

                myparamss.DefaultValue = TextBox1.Text;
                myparamss.Name         = "Marketing Program No";

                ReportDocument rpt1 = new ReportDocument();
                rpt1.Load(foldername);

                CrystalDecisions.Web.Report rpt_web = new CrystalDecisions.Web.Report();

                rpt_web.FileName = foldername;
                rpt_web.Parameters.Add(myparamss);

                CrystalReportSource1.Report       = rpt_web;
                CrystalReportViewer1.ReportSource = CrystalReportSource1;
                //CrystalReportSource1.Report.FileName = foldername;
                //CrystalReportSource1.Report.Parameters.Add(myparamss);
                //CrystalReportSource1.Report.Parameters.Add(myparamss2);
                TableLogOnInfos tblinfos = new TableLogOnInfos();
                TableLogOnInfo  tblinfo  = new TableLogOnInfo();

                tblinfo.ConnectionInfo.DatabaseName          = "MATIMCO";
                tblinfo.ConnectionInfo.UserID                = "sa";
                tblinfo.ConnectionInfo.Password              = "******";
                tblinfo.ConnectionInfo.ServerName            = "192.168.10.15";
                tblinfo.ConnectionInfo.IntegratedSecurity    = false;
                tblinfo.ConnectionInfo.AllowCustomConnection = true;

                CrystalReportViewer1.LogOnInfo.Add(tblinfo);


                CrystalReportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
                Label2.Text = "Error-" + ex.Message;
            }
        }
示例#19
0
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        System.IO.MemoryStream stream1 = new System.IO.MemoryStream();
        string Path = "";

        if (RbtStatistics.Checked == true)
        {
            Path = Server.MapPath("~/Report/Followuptobedone-satistics.rpt");
        }
        else
        {
            Path = Server.MapPath("~/Report/Followuptobedone_Detail.rpt");
        }

        myReportDocument.Load(Path);
        myReportDocument.SetParameterValue("@flag", ChkDate.Checked == true ? 1 : 0);
        myReportDocument.SetParameterValue("@fromdate", ChkDate.Checked == false ? DateTime.Now :Report(txtFromDate.Text));
        myReportDocument.SetParameterValue("@todate", ChkDate.Checked == false ? DateTime.Now : Report(txtToDate.Text));
        myReportDocument.SetParameterValue("@groupcode", ddlCountry.SelectedValue);
        myReportDocument.SetParameterValue("@empid", ddlemp.SelectedValue);
        myReportDocument.SetParameterValue("@callerstatus", ddlStudentStatus.SelectedValue);
        //myReportDocument.SetParameterValue("@SemID", drpSemester.SelectedValue);
        myReportDocument.SetDatabaseLogon("software", "DelFirMENA$idea");
        CrystalReportViewer1.ReportSource = myReportDocument;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.HasExportButton          = true;
        CrystalReportViewer1.HasPrintButton           = true;
        CrystalReportViewer1.HasSearchButton          = true;
        CrystalReportViewer1.HasToggleGroupTreeButton = false;

        System.IO.Stream oStream   = null;
        byte[]           byteArray = null;
        oStream   = myReportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        byteArray = new byte[oStream.Length];
        oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
        Response.ClearContent();
        Response.ClearHeaders();
        Response.ContentType = "application/pdf";
        Response.BinaryWrite(byteArray);
        Response.Flush();
        Response.Close();
        myReportDocument.Close();
        myReportDocument.Dispose();
    }
示例#20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack == false)
        {
            GetConnection();
            GetData();
        }
        GetConnection();
        GetData();
        ds.WriteXml(Server.MapPath("~") + "\\App_Code\\invoice.xml");
        ds.WriteXmlSchema(Server.MapPath("~") + "\\App_Code\\invoice.xsd");

        ReportDocument rd = new ReportDocument();

        rd.Load(Server.MapPath("~//bill.rpt"));
        rd.SetDataSource(ds);
        CrystalReportViewer1.ReportSource = rd;
        CrystalReportViewer1.DataBind();
    }
示例#21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CrystalReportViewer1.DisplayPage = true;
        if (Environment.MachineName.ToString().Trim() != "ANN-LIN")
        {
            db1 = "[EIPB].[dbo].";    //如果不是在Ann本機, 則指定資料庫
            db2 = "[EIPA].[dbo].";    //如果不是在Ann本機, 則指定資料庫
            db3 = "[barcode].[dbo]."; //如果不是在Ann本機, 則指定資料庫
        }

        SmoothEnterprise.Database.DataSet rs = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead);
        rs.Open("select min(item) minitem,packing from " + db1 + "shipment_body where aid='" + Request.QueryString["id"] + "' group by packing");
        if (!rs.EOF)
        {
            this.QUERY_ITEM.Text = rs["minitem"].ToString();
        }

        if (!IsPostBack)
        {
            CrystalReportViewer1.DisplayPage = false;
        }
        else
        {
            query();
        }
        myReportDocument.Load(Server.MapPath("shipment_print.rpt"));

        TableLogOnInfo logoninfo;

        foreach (CrystalDecisions.CrystalReports.Engine.Table mytable in myReportDocument.Database.Tables)
        {
            logoninfo = mytable.LogOnInfo;
            logoninfo.ConnectionInfo.ServerName   = "192.168.0.238";
            logoninfo.ConnectionInfo.DatabaseName = "EIPB";
            logoninfo.ConnectionInfo.UserID       = "smooth";
            logoninfo.ConnectionInfo.Password     = "******";

            mytable.ApplyLogOnInfo(logoninfo);
        }

        CrystalReportViewer1.ReportSource = myReportDocument;
        CrystalReportViewer1.RefreshReport();
    }
示例#22
0
 protected void fillReports()
 {
     try
     {
         string   Fromdate = string.Empty;
         string   Todate   = string.Empty;
         DataSet1 ds       = new DataSet1();
         if (txtFrom.Text != string.Empty)
         {
             Fromdate = txtFrom.Text.Substring(6, 4) + txtFrom.Text.Substring(3, 2) + txtFrom.Text.Substring(0, 2);
         }
         else
         {
             Fromdate = string.Empty;
         }
         if (txtTo.Text != string.Empty)
         {
             Todate = txtTo.Text.Substring(6, 4) + txtTo.Text.Substring(3, 2) + txtTo.Text.Substring(0, 2);
         }
         else
         {
             Todate = string.Empty;
         }
         ds = csfee.fncStudentDateWisePaymentReport(Int32.Parse(ddlyear.SelectedValue), ddlAdmission.SelectedValue, ddlclass.SelectedValue, Fromdate, Todate, ddlPayMode.SelectedValue);
         if (ddlclass.SelectedIndex == 0 && (ddlAdmission.SelectedIndex > 0 || ddlAdmission.SelectedIndex > 0) && ds.Tables["StudentDateWisePayment"].Rows.Count > 0)
         {
             ddlclass.SelectedValue = ds.Tables["StudentDateWisePayment"].Rows[0]["Class"].ToString();
         }
         reportfilepath = Server.MapPath("CR_StudentDateWisePayment.rpt");
         CrystalReportViewer1.EnableDatabaseLogonPrompt = false;
         ReportDocument FeeDetails = new ReportDocument();
         FeeDetails.Load(reportfilepath);
         FeeDetails.SetDataSource(ds.Tables["StudentDateWisePayment"]);
         CrystalReportViewer1.ReportSource = FeeDetails;
         CrystalReportViewer1.DataBind();
         CrystalReportViewer1.RefreshReport();
     }
     catch
     {
         txtFrom.Text = string.Empty;
         txtTo.Text   = string.Empty;
     }
 }
示例#23
0
        private void LoadReport()
        {
            string foldername = Server.MapPath("~/CS_REPORT/rpt/Disc-RunningMTD-IndividualAccount.rpt");

            try
            {
                CrystalDecisions.Web.Parameter customercode = new CrystalDecisions.Web.Parameter();
                string    tmp_acctcode   = "";
                string    cardname       = StringHelper.ReCodeCharacters(DropDownList1.Text);
                DataTable user_counterid = SqlDbHelper.getDataDT("SELECT cardcode FROM SAPSERVER.MATIMCO.dbo.arms_vw_discount WHERE cardname='" + cardname + "' GROUP BY cardcode");
                foreach (DataRow acctCode in user_counterid.Rows)
                {
                    tmp_acctcode = acctCode["cardcode"].ToString();
                }
                customercode.Name         = "CustomerCode";
                customercode.DefaultValue = tmp_acctcode;


                ReportDocument rpt1 = new ReportDocument();

                CrystalReportSource1.Report.FileName = foldername;

                CrystalReportViewer1.ReportSource = CrystalReportSource1;
                TableLogOnInfos tblinfos = new TableLogOnInfos();
                TableLogOnInfo  tblinfo  = new TableLogOnInfo();

                tblinfo.ConnectionInfo.DatabaseName          = "MATIMCO";
                tblinfo.ConnectionInfo.UserID                = "sa";
                tblinfo.ConnectionInfo.Password              = "******";
                tblinfo.ConnectionInfo.ServerName            = "192.168.10.15";
                tblinfo.ConnectionInfo.IntegratedSecurity    = false;
                tblinfo.ConnectionInfo.AllowCustomConnection = true;

                CrystalReportSource1.Report.Parameters.Add(customercode);
                CrystalReportViewer1.LogOnInfo.Add(tblinfo);

                CrystalReportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
                Label2.Text = "Error-" + ex.Message;
            }
        }
示例#24
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataSet1   ds  = new DataSet1();
            SqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from issue_book where book_return_date= ' '";
            cmd.ExecuteNonQuery();
            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            da.Fill(ds.DataTable1);
            CrystalReport1 cp = new CrystalReport1();

            cp.SetDataSource(ds);
            CrystalReportViewer1 cpv = new CrystalReportViewer1();

            crystalReportViewer1.ReportSource = cp;
        }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        pnlReportViwer.Visible = true;
        string FromDate;
        string ToDate;

        try
        {
            FromDate = (DateTime.Parse(txtFromDate.Text)).ToShortDateString();
        }
        catch
        {
            FromDate = DateTime.Now.ToShortDateString();
        }
        try
        {
            ToDate = (DateTime.Parse(txtToDate.Text)).ToShortDateString();
        }
        catch
        {
            ToDate = DateTime.Now.ToShortDateString();
        }
        StudentRegistrationDAL s = new StudentRegistrationDAL();
        //DataSet dt = s.PrintReport(ddlDegreeType.SelectedValue, ddlStudentStatus.SelectedValue, FromDate, ToDate, Session["EMPID"].ToString(), "0", "0", "CSS");
        string path = "";

        path = Server.MapPath("~/Report/CMS_FOLLOWUP_REPORT.rpt");
        rptStudent.Load(path);
        rptStudent.SetParameterValue("@degreetype", ddlDegreeType.SelectedValue);
        rptStudent.SetParameterValue("@fromdate", FromDate);
        rptStudent.SetParameterValue("@todate", ToDate);
        rptStudent.SetParameterValue("@createdby", Session["EMPID"].ToString());
        rptStudent.SetParameterValue("@GROUPCODE", ddlCountry.SelectedValue);
        rptStudent.SetDatabaseLogon("software", "DelFirMENA$idea");

        //rptStudent.Database.Tables[0].SetDataSource(dt);
        CrystalReportViewer1.ReportSource = rptStudent;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.HasExportButton          = true;
        CrystalReportViewer1.HasPrintButton           = true;
        CrystalReportViewer1.HasSearchButton          = true;
        CrystalReportViewer1.HasToggleGroupTreeButton = false;
    }
 private void Page_Init(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         lblprj.Text = "CCAD";
         Load_Master();
         Generate_Summary();
         Insert_Summary();
         Generate_Reports();
     }
     else
     {
         if (Session["Report"] != null)
         {
             CrystalReportViewer1.ReportSource = (ReportDocument)Session["Report"];
             CrystalReportViewer1.DataBind();
         }
     }
 }
示例#27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                txtDateFrom.Text = DateTime.Now.AddDays(-3).ToString("dd-MMM-yyyy");
                txtDateTo.Text   = DateTime.Now.ToString("dd-MMM-yyyy");
                CrystalReportViewer1.Zoom(Convert.ToInt16(ConfigurationManager.AppSettings["ReportZoom"]));
            }

            //conne.ServerName = ConfigurationManager.AppSettings["ServerName"];
            //   conne.DatabaseName = ConfigurationManager.AppSettings["DatabaseName"];
            //   conne.UserID = ConfigurationManager.AppSettings["UserID"];
            //   conne.Password = "******";//ConfigurationManager.AppSettings["Password"];



            ConnectionInfo conne = new ConnectionInfo();


            conne.ServerName   = ConfigurationManager.AppSettings["ServerName"].ToString();
            conne.DatabaseName = ConfigurationManager.AppSettings["DatabaseName"].ToString();
            conne.UserID       = ConfigurationManager.AppSettings["UserID"].ToString();
            conne.Password     = ConfigurationManager.AppSettings["Password"].ToString();


            TableLogOnInfo tablelogs = new TableLogOnInfo();

            Database db   = rd.Database;
            Tables   tbls = db.Tables;

            foreach (CrystalDecisions.CrystalReports.Engine.Table tab in tbls)
            {
                tablelogs = tab.LogOnInfo;
                tablelogs.ConnectionInfo = conne;
                tab.ApplyLogOnInfo(tablelogs);
                tab.Location = ConfigurationManager.AppSettings["DatabaseName"] + ".dbo." + tab.Name; //most important line whole report is depend on this line
            }

            CrystalReportViewer1.ReportSource = rd;

            CrystalReportViewer1.SelectionFormula = "{Rep_SummaryOfDeposit.TranDate} >= cdate('" + txtDateFrom.Text + "') and {Rep_SummaryOfDeposit.TranDate} <=cdate('" + txtDateTo.Text + "')";
            CrystalReportViewer1.RefreshReport();
        }
示例#28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //string foldername = Server.MapPath("~/CS_REPORT/rpt/cmperaccount.rpt");

            try
            {
                string strpath = MapPath("~/CS_REPORT/rpt/cmperaccount.rpt");
                //string strpath = Server.MapPath("~/CS_REPORT/rpt/ftmandytdsellinperareareport.rpt");

                ReportDocument report = new ReportDocument();

                CrystalDecisions.Shared.TableLogOnInfos crtableLogoninfos = new CrystalDecisions.Shared.TableLogOnInfos();
                CrystalDecisions.Shared.TableLogOnInfo  crtableLogoninfo  = new CrystalDecisions.Shared.TableLogOnInfo();
                CrystalDecisions.Shared.ConnectionInfo  crConnectionInfo  = new CrystalDecisions.Shared.ConnectionInfo();
                Tables CrTables;

                CrystalReportSource1.Report.FileName = strpath;
                report.Load(strpath);

                crConnectionInfo.ServerName   = "192.168.10.15";
                crConnectionInfo.DatabaseName = "MATIMCO";
                crConnectionInfo.UserID       = "sa";
                crConnectionInfo.Password     = "******";


                CrTables = report.Database.Tables;
                foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
                {
                    crtableLogoninfo = CrTable.LogOnInfo;
                    crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                    CrTable.ApplyLogOnInfo(crtableLogoninfo);
                }

                CrystalReportViewer1.ReportSource = report;
                CrystalReportViewer1.RefreshReport();
                Label2.Text = CrystalReportViewer1.ParameterFieldInfo[0].Name + "-" + CrystalReportViewer1.ParameterFieldInfo[1].Name;
            }
            catch (Exception ex)
            {
                Label2.Text = "Error-" + ex.Message;
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            //记录页面使用次数
            //DB.RecordPageUseCount("Plant_PageUseCount");

            OracleConnection conn = DB.createConn();
            try
            {
                OracleDataAdapter da = new OracleDataAdapter();
                if (newdate)
                {
                    CrystalReportViewer1.ResetReportPartNavigation();
                    newdate = false;
                }

                conn.Open();
                DataSet ds = new DataSet();

                string strSQL = "Select * from PAGE_USE_COUNT ORDER BY  PAGE_NAME";
                da.SelectCommand = new OracleCommand(strSQL, conn);
                da.Fill(ds, "PAGE_USE_COUNT");

                rdt.Load(this.Server.MapPath("").ToString() + "\\PageUseCount.rpt");

                rdt.SetDataSource(ds);
                CrystalReportViewer1.ReportSource = rdt;
                CrystalReportViewer1.DataBind();

                ds.Dispose();
            }
            catch (Exception ee)
            {
                Response.Write(ee.ToString());//"出错");
            }
            finally
            {
                conn.Close();
            }
        }
    }
示例#30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int    userId = Convert.ToInt32(Session["UserId"]); //Convert.ToInt32(Request.QueryString["userId"].ToString());
            int    type   = Convert.ToInt32(Request.QueryString["type"].ToString());
            string status = Request.QueryString["status"].ToString();


            //string json = Json(projectLists, JsonRequestBehavior.AllowGet);
            DataTable dt = new DataTable();

            if (type == 1)
            {
                int batchName = Convert.ToInt32(Request.QueryString["batch_name"].ToString());
                dt = ReportManager.GetProjectListsindt("all", batchName, 1);
            }
            else if (type == 2)
            {
                dt = ReportManager.GetProjectListsindt("all", userId, 2);
            }


            Session["rpt_path"] = "~/Reports/ProjectLstSupervisor.rpt";
            Session["rpt_dt"]   = dt;
            //GridView1.DataSource = dt;
            //GridView1.DataBind();
            string pppp = Server.MapPath(Session["rpt_path"].ToString());

            doc1.Load(Server.MapPath(Session["rpt_path"].ToString()));
            doc1.SetDataSource((DataTable)Session["rpt_dt"]);
            if (doc1 != null)
            {
                Response.Write("Calling this section");
                CrystalReportViewer1.ReportSource = doc1;
                CrystalReportViewer1.DataBind();
                CrystalReportViewer1.RefreshReport();
                CrystalReportViewer1.Visible = true;
            }
            else
            {
                Response.Write("Error");
            }
        }