예제 #1
0
        private void DoIt()
        {
            string rt = Check();

            if (rt != "OK")
            {
                MyMainForm.ShowWarning(rt);
                return;
            }
            SaveParams();

            ROps1aTableAdapter ad1a = MyData.GetKlonsRepAdapter("ROps1a") as ROps1aTableAdapter;
            ROps2aTableAdapter ad2a = MyData.GetKlonsRepAdapter("ROps2a") as ROps2aTableAdapter;
            ROps3aTableAdapter ad3a = MyData.GetKlonsRepAdapter("ROps3a") as ROps3aTableAdapter;

            ReportViewerData rd = new ReportViewerData();

            rd.Sources["DataSet1"]   = MyData.DataSetKlonsRep.ROps1a;
            rd.Sources["DataSet_2a"] = MyData.DataSetKlonsRep.ROps2a;
            rd.Sources["DataSet_3a"] = MyData.DataSetKlonsRep.ROps3a;

            ad1a.FillBy_koresp_11_clid2(MyData.DataSetKlonsRep.ROps1a, startDate, endDate, ac, clid);
            ad2a.FillBy_apgr_01_clid2(MyData.DataSetKlonsRep.ROps2a, startDate, endDate, ac, clid);
            ad3a.FillBy_koresp_01_clid2(MyData.DataSetKlonsRep.ROps3a, startDate, endDate, ac, clid);

            MyData.ReportHelper.PrepareRops1a();
            MyData.ReportHelper.PrepareRops2a();
            MyData.ReportHelper.PrepareRops2aRAC();

            rd.AddReportParameters(
                new string[]
            {
                "RSD", startDateStr,
                "RED", endDateStr,
                "RAC", cbAC.Text,
                "RACNM", lbACName.Text,
                "CompanyName", MyData.Params.CompNameX,
                "RPER", MyData.Params.RPER,
                "RPERNM", lbClName.Text,
                "AVNR", tbNr.Text,
                "PAC", null,
                "PCLID", null
            });

            rd.FileName = "Report_AvNor_1";
            MyMainForm.ShowReport(rd);
        }
예제 #2
0
        private void DoIt()
        {
            string rt = Check();

            if (rt != "OK")
            {
                MyMainForm.ShowWarning(rt);
                return;
            }
            ROps2aTableAdapter ad2a = MyData.GetKlonsRepAdapter("ROps2a") as ROps2aTableAdapter;
            ROps3aTableAdapter ad3a = MyData.GetKlonsRepAdapter("ROps3a") as ROps3aTableAdapter;

            if (ad2a == null)
            {
                return;
            }
            if (ad3a == null)
            {
                return;
            }

            ad2a.FillBy_apgr_dz_12(MyData.DataSetKlonsRep.ROps2a, startDate, endDate);
            ad3a.FillBy_apgr_dz_11(MyData.DataSetKlonsRep.ROps3a, startDate, endDate);

            SaveParams();

            MyData.ReportHelper.PrepareRops2a();

            ReportViewerData rd = new ReportViewerData();

            rd.FileName            = "Report_Apgr_DZ_1";
            rd.Sources["DataSet1"] = MyData.DataSetKlonsRep.ROps2a;
            rd.Sources["DataSet2"] = MyData.DataSetKlonsRep.ROps3a;
            rd.AddReportParameters(
                new string[]
            {
                "RSD", MyData.Params.RSD,
                "RED", MyData.Params.RED,
                "CompanyName", MyData.Params.CompNameX
            });

            MyMainForm.ShowReport(rd);
        }
예제 #3
0
        private void DoIt()
        {
            string rt = Check();

            if (rt != "OK")
            {
                MyMainForm.ShowWarning(rt);
                return;
            }
            SaveParams();

            int repid = lbCm.SelectedIndex;

            if (cbClid.Text == "*")
            {
                cbClid.Text = "";
            }
            if (cbClid.Text != "")
            {
                repid += 6;
            }

            ROps1aTableAdapter ad1a = MyData.GetKlonsRepAdapter("ROps1a") as ROps1aTableAdapter;
            ROps2aTableAdapter ad2a = MyData.GetKlonsRepAdapter("ROps2a") as ROps2aTableAdapter;
            ROps3aTableAdapter ad3a = MyData.GetKlonsRepAdapter("ROps3a") as ROps3aTableAdapter;

            ReportViewerData rd = new ReportViewerData();

            if (repid != 5)
            {
                rd.Sources["DataSet1"] = MyData.DataSetKlonsRep.ROps1a;
            }
            rd.Sources["DataSet_2a"] = MyData.DataSetKlonsRep.ROps2a;
            rd.Sources["DataSet_3a"] = MyData.DataSetKlonsRep.ROps3a;

            ReportViewerData rdsub = null;


            switch (repid)
            {
            case 0:
            case 1:
            case 2:
                ad1a.FillBy_koresp_11(MyData.DataSetKlonsRep.ROps1a, startDate, endDate, ac);
                ad2a.FillBy_apgr_01(MyData.DataSetKlonsRep.ROps2a, startDate, endDate, ac);
                ad3a.FillBy_koresp_01(MyData.DataSetKlonsRep.ROps3a, startDate, endDate, ac);
                break;

            case 3:
                ad1a.FillBy_koresp_11(MyData.DataSetKlonsRep.ROps1a, startDate, endDate, ac);
                ad2a.FillBy_apgr_02(MyData.DataSetKlonsRep.ROps2a, startDate, endDate, ac);
                ad3a.FillBy_koresp_02(MyData.DataSetKlonsRep.ROps3a, startDate, endDate, ac);
                break;

            case 5:
                ad2a.FillBy_apgr_01(MyData.DataSetKlonsRep.ROps2a, startDate, endDate, ac);
                ad3a.FillBy_koresp_01(MyData.DataSetKlonsRep.ROps3a, startDate, endDate, ac);
                break;

            case 6:
            case 7:
            case 8:
                ad1a.FillBy_koresp_11_clid(MyData.DataSetKlonsRep.ROps1a, startDate, endDate, ac, clid);
                ad2a.FillBy_apgr_01_clid(MyData.DataSetKlonsRep.ROps2a, startDate, endDate, ac, clid);
                ad3a.FillBy_koresp_01_clid(MyData.DataSetKlonsRep.ROps3a, startDate, endDate, ac, clid);
                break;

            case 9:
                ad1a.FillBy_koresp_11_clid(MyData.DataSetKlonsRep.ROps1a, startDate, endDate, ac, clid);
                ad2a.FillBy_apgr_02_clid(MyData.DataSetKlonsRep.ROps2a, startDate, endDate, ac, clid);
                ad3a.FillBy_koresp_02_clid(MyData.DataSetKlonsRep.ROps3a, startDate, endDate, ac, clid);
                break;

            case 4:
            case 10:
                ad1a.FillBy_koresp_11(MyData.DataSetKlonsRep.ROps1a, startDate, endDate, ac);
                ad2a.FillBy_apgr_02_clid(MyData.DataSetKlonsRep.ROps2a, startDate, endDate, ac, null);
                ad3a.FillBy_koresp_02_clid(MyData.DataSetKlonsRep.ROps3a, startDate, endDate, ac, null);
                break;
            }


            MyData.ReportHelper.PrepareRops1a();
            MyData.ReportHelper.PrepareRops2a();
            MyData.ReportHelper.PrepareRops2aRAC();

            rd.AddReportParameters(
                new string[]
            {
                "RSD", startDateStr,
                "RED", endDateStr,
                "RAC", cbAC.Text,
                "RACNM", lbACName.Text,
                "CompanyName", MyData.Params.CompNameX,
                "RPER", MyData.Params.RPER,
                "RPERNM", lbClName.Text,
                "PAC", null,
                "PCLID", null,
                "RCURRENCY", ""
            });


            switch (lbCm.SelectedIndex)
            {
            case 0:
                rd.FileName = "Report_Koresp_1";
                break;

            case 1:
                rd.FileName = "Report_Koresp_2";
                break;

            case 2:
                rd.FileName = "Report_Koresp_1_full";
                break;

            case 5:
                rd.FileName = "Report_Koresp_3";
                break;

            case 3:
                rdsub          = rd;
                rdsub.FileName = "Report_Koresp_1";
                rdsub.AddSubreportLink("DataSet1", "PAC", "Ac1");
                rdsub.AddSubreportLink("DataSet_2a", "PAC", "AC");
                rdsub.AddSubreportLink("DataSet_3a", "PAC", "Ac1");

                rd = new ReportViewerData();
                rd.Sources["DataSet_2a"] = MyData.DataSetKlonsRep.ROps2a;
                rd.FileName = "Report_Koresp_1_byac";
                rd.SubReports[rdsub.FileName] = rdsub;
                rd.AddReportParameters(
                    new string[]
                {
                    "RSD", startDateStr,
                    "RED", endDateStr,
                    "RAC", cbAC.Text,
                    "RACNM", lbACName.Text,
                    "CompanyName", MyData.Params.CompNameX,
                    "RPER", MyData.Params.RPER,
                    "RPERNM", lbClName.Text,
                    "RCURRENCY", ""
                });
                break;

            case 4:
                rdsub          = rd;
                rdsub.FileName = "Report_Koresp_1";
                rdsub.AddSubreportLink("DataSet1", "PAC", "Ac1", "PCLID", "Clid");
                rdsub.AddSubreportLink("DataSet_2a", "PAC", "AC", "PCLID", "Clid");
                rdsub.AddSubreportLink("DataSet_3a", "PAC", "Ac1", "PCLID", "Clid");

                rd = new ReportViewerData();
                rd.Sources["DataSet_2a"] = MyData.DataSetKlonsRep.ROps2a;
                rd.FileName = "Report_Koresp_1_byacnadcl";
                rd.SubReports[rdsub.FileName] = rdsub;
                rd.AddReportParameters(
                    new string[]
                {
                    "RSD", startDateStr,
                    "RED", endDateStr,
                    "RAC", cbAC.Text,
                    "RACNM", lbACName.Text,
                    "CompanyName", MyData.Params.CompNameX,
                    "RPER", "",
                    "RPERNM", "",
                    "RCURRENCY", ""
                });
                break;
            }

            MyMainForm.ShowReport(rd);
        }