Exemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            SalesCR rpt = new SalesCR();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemplo n.º 2
0
        private void QueryBTN_Click(object sender, EventArgs e)
        {
            repoerts_form          RForm         = new repoerts_form();
            SalesCR                SalesRep      = new SalesCR();
            ParameterFields        SalesParam    = new ParameterFields();
            ParameterField         FromDate      = new ParameterField();
            ParameterDiscreteValue FromDatevalue = new ParameterDiscreteValue();
            ParameterField         ToDate        = new ParameterField();
            ParameterDiscreteValue ToDatevalue   = new ParameterDiscreteValue();
            ParameterField         CatId         = new ParameterField();
            ParameterDiscreteValue CatIdValue    = new ParameterDiscreteValue();
            ParameterField         RbF           = new ParameterField();
            ParameterDiscreteValue RbFvalue      = new ParameterDiscreteValue();
            ParameterField         AgentId       = new ParameterField();
            ParameterDiscreteValue AgentIdvalue  = new ParameterDiscreteValue();
            ParameterField         ItemId        = new ParameterField();
            ParameterDiscreteValue ItemIdvalue   = new ParameterDiscreteValue();
            ParameterField         OperType      = new ParameterField();
            ParameterDiscreteValue OperTypevalue = new ParameterDiscreteValue();

            ParameterField         op_type = new ParameterField();
            ParameterDiscreteValue op_dis  = new ParameterDiscreteValue();

            op_type.Name = "op_type";
            op_type.CurrentValues.Add(op_dis);
            op_dis.Value = OperTypeCB.Text;
            {
                FromDate.Name       = "fromDate";
                FromDatevalue.Value = FromDateTB.Text;
                ToDate.Name         = "ToDate";
                ToDatevalue.Value   = ToDateTB.Text;
                ItemId.Name         = "ItemId";
                RbF.Name            = "RbF";
                AgentId.Name        = "AgentId";
                CatId.Name          = "CatId";
                OperType.Name       = "OperType";
                OperTypevalue.Value = "'SEL'";
                if (OperTypeCB.SelectedIndex == 1)
                {
                    OperTypevalue.Value = "'REF'";
                }
                CatIdValue.Value   = 0;
                AgentIdvalue.Value = 0;
                if (CategoryCB.Text.Trim() != "")
                {
                    CatIdValue.Value = CategoryCB.SelectedValue;
                }
                if (AgentQCB.Text.Trim() != "")
                {
                    AgentIdvalue.Value = AgentQCB.SelectedValue;
                }

                ItemIdvalue.Value = 0;
                // RbFvalue.Value = 6;
                if (ItemIdTB.Text != "" && sel_rp_cod_rdbtn.Checked)
                {
                    ItemIdvalue.Value = ItemIdTB.Text;
                }
                else if (ItemCB.Text != "" && ItemRB.Checked)
                {
                    ItemIdvalue.Value = meth.select_sanf_data_by_name(ItemCB.Text.Trim()).Rows[0][0];
                }

                if (sel_rp_cod_rdbtn.Checked == true && AgentCHB.Checked == false)
                {
                    RbFvalue.Value = 0;
                }
                else if (sel_rp_cod_rdbtn.Checked == true && AgentCHB.Checked == true)
                {
                    RbFvalue.Value = 1;
                }



                if (ItemRB.Checked == true && AgentCHB.Checked == false)
                {
                    RbFvalue.Value = 0;
                }
                else if (ItemRB.Checked == true && AgentCHB.Checked == true)
                {
                    RbFvalue.Value = 1;
                }
                else if (CatRB.Checked == true && AgentCHB.Checked == false)
                {
                    RbFvalue.Value = 2;
                }
                else if (CatRB.Checked == true && AgentCHB.Checked == true)
                {
                    RbFvalue.Value = 3;
                }
                else if (AllRB.Checked == true && AgentCHB.Checked == false)
                {
                    RbFvalue.Value = 4;
                }
                else if (AllRB.Checked == true && AgentCHB.Checked == true)
                {
                    RbFvalue.Value = 5;
                }
                AgentId.CurrentValues.Add(AgentIdvalue);
                FromDate.CurrentValues.Add(FromDatevalue);
                ToDate.CurrentValues.Add(ToDatevalue);
                ItemId.CurrentValues.Add(ItemIdvalue);
                RbF.CurrentValues.Add(RbFvalue);
                CatId.CurrentValues.Add(CatIdValue);
                OperType.CurrentValues.Add(OperTypevalue);
                SalesParam.Add(ToDate);
                SalesParam.Add(OperType);
                SalesParam.Add(RbF);
                SalesParam.Add(AgentId);
                SalesParam.Add(FromDate);
                SalesParam.Add(ItemId);
                SalesParam.Add(CatId);
                SalesParam.Add(op_type);

                RForm.rep_crst.ReportSource       = SalesRep;
                RForm.rep_crst.ParameterFieldInfo = SalesParam;
                RForm.Show();
                RForm.Dock = DockStyle.Fill;
            }
        }