Exemple #1
0
        private void PrintDoc(int grouping, int typex)
        {
            string reporttitle = "Stock Evaluation".ToUpper();
            frm_reportViwer rpt = new frm_reportViwer();
            rpt.MdiParent = MDI_SMartAnything.ActiveForm;
            rpt.FormHeadertext = reporttitle;

            ParameterField paramField = new ParameterField();
            ParameterFields paramFields = new ParameterFields();
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

            paramFields = commonFunctions.AddCrystalParamsWithLoca(reporttitle, commonFunctions.Loginuser.ToUpper(), commonFunctions.GlobalLocation, findExisting.FindExisitingLoca(commonFunctions.GlobalLocation));

            paramField.Name = "status";
            paramDiscreteValue.Value = "processed".ToUpper();
            paramField.CurrentValues.Add(paramDiscreteValue);
            paramFields.Add(paramField);


            if (grouping == 1)
            {
                rpt_stockEvoNew rptBank = new rpt_stockEvoNew();
                if (typex == 1)
                {
                    rptBank.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockEvoNew("001", "", "", "", 1, 1)));
                }
                else if (typex == 2)
                {
                    // rptBank.SetDataSource(commonFunctions.GetDatatable(ReportEngine.GetStockEvoSTR(commonFunctions.GlobalLocation, typex, txt_Suplier.Text.Trim(), "")));
                }
                rpt.RepViewer.ParameterFieldInfo = paramFields;
                rpt.RepViewer.ReportSource = rptBank;
                rpt.RepViewer.Refresh();
                rpt.Show();
            }
            else if (grouping == 2)
            {
                rpt_stockevonew_Groupcus rptgroupCat = new rpt_stockevonew_Groupcus();
                if (typex == 1)
                {
                    rptgroupCat.SetDataSource(commonFunctions.GetDatatable(ReportStrings.GetStockEvoNew("001", "", "", "", 1, 1)));
                }

                rpt.RepViewer.ParameterFieldInfo = paramFields;
                rpt.RepViewer.ReportSource = rptgroupCat;
                rpt.RepViewer.Refresh();
                rpt.Show();
            }


        }