当前位置: 首页>>代码示例>>C#>>正文


C# ReportDocument.OpenSubreport方法代码示例

本文整理汇总了C#中CrystalDecisions.CrystalReports.Engine.ReportDocument.OpenSubreport方法的典型用法代码示例。如果您正苦于以下问题:C# ReportDocument.OpenSubreport方法的具体用法?C# ReportDocument.OpenSubreport怎么用?C# ReportDocument.OpenSubreport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CrystalDecisions.CrystalReports.Engine.ReportDocument的用法示例。


在下文中一共展示了ReportDocument.OpenSubreport方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowReport

    private void ShowReport(DataSet ds)
    {
        try
        {
            string strFileName = "";
            CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            ReportDocument SubReport = new ReportDocument();
 
            report.Load(Server.MapPath("./REPORT/MKT06/CRMKT06R01.rpt"));
            strFileName = HttpUtility.UrlEncode("圖書採購卡.PDF", System.Text.Encoding.UTF8);

            SubReport = report.OpenSubreport("CRMKT0601_1");
            SubReport.SetDataSource(ds);

            report.SetDataSource(ds);

            System.IO.Stream streamPDF = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            byte[] bytesPDF = new byte[streamPDF.Length];
            streamPDF.Read(bytesPDF, 0, bytesPDF.Length);
            streamPDF.Seek(0, System.IO.SeekOrigin.Begin);

            //export file  
            Response.ClearContent();
            Response.ClearHeaders();
            Response.AddHeader("content-disposition", "attachment;filename=" + strFileName);//pdf檔名  
            Response.ContentType = "application/pdf";
            Response.OutputStream.Write(bytesPDF, 0, bytesPDF.Length);
            Response.Flush();
            Response.Close();
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally { }
    }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:36,代码来源:MKT062.aspx.cs

示例2: ShowReport

    /// <summary>
    /// 顯示報表
    /// </summary>
    private void ShowReport(DataSet ds)
    {
        #region 利用CrystalReport列印報表

        //使用者名稱
        DataTable dt1 = new DataTable();
        dt1 = (DataTable)Session["UserInfo"];
        string Login_Name = dt1.Rows[0]["Name"].ToString();
        string strFileName = "";

        CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
        ReportDocument SubReport = new ReportDocument();

        report.Load(Server.MapPath("./REPORT/CAA271/CAA27R01.rpt"));
        strFileName = HttpUtility.UrlEncode("結帳與開立憑證檢核表.PDF", System.Text.Encoding.UTF8);

        SubReport = report.OpenSubreport("CAA27R01_1");
        SubReport.SetDataSource(ds);

        report.SetDataSource(ds);

        report.SetParameterValue("par_Program_ID", "CAA27R01");
        report.SetParameterValue("par_LoginUser", Session["UID"].ToString() + Login_Name);

        System.IO.Stream streamPDF = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        byte[] bytesPDF = new byte[streamPDF.Length];
        streamPDF.Read(bytesPDF, 0, bytesPDF.Length);
        streamPDF.Seek(0, System.IO.SeekOrigin.Begin);

        //export file  
        Response.ClearContent();
        Response.ClearHeaders();
        Response.AddHeader("content-disposition", "attachment;filename=" + strFileName);//pdf檔名  
        Response.ContentType = "application/pdf";
        Response.OutputStream.Write(bytesPDF, 0, bytesPDF.Length);
        Response.Flush();
        Response.Close();
        report.Close();
        #endregion
    }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:43,代码来源:CAA271.aspx.cs

示例3: report_BasketValue

        private static void report_BasketValue()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rsPayment = default(ADODB.Recordset);
            ADODB.Recordset rsChannel = default(ADODB.Recordset);
            string sql = null;
            // Dim Report As New cryBasketValue
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryBasketValue.rpt");

            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            rs = modReport.getRSreport(ref "SELECT Report.Report_Heading, aCompany.Company_Name FROM aCompany, Report;");
            Report.SetParameterValue("txtCompanyName", rs.Fields("Company_Name"));
            Report.SetParameterValue("txtDayend", rs.Fields("Report_Heading"));
            rs.Close();
            rs = modReport.getRSreport(ref "SELECT * FROM Link Where LinkID=2 AND Link_SectionID=1");
            sql = "SELECT Count(theJoin.SaleID) AS CountOfSaleItemID, Sum(theJoin.quantity) AS quantity, Sum(theJoin.price) AS price, theJoin.Sale_PaymentType FROM (SELECT Sum(IIf([SaleItem_Reversal],0-[SaleItem_Quantity],[SaleItem_Quantity])) AS quantity, Sum(([SaleItem_Price]*[SaleItem_Quantity])) AS price, Sale.Sale_PaymentType, Sale.SaleID FROM SaleItem INNER JOIN Sale ON SaleItem.SaleItem_SaleID = Sale.SaleID Where (((SaleItem.SaleItem_Revoke) = 0) And ((SaleItem.SaleItem_DepositType) = 0)) GROUP BY Sale.Sale_PaymentType, Sale.SaleID) AS theJoin GROUP BY theJoin.Sale_PaymentType;";
            rsPayment = modReport.getRSreport(ref sql);
            sql = "SELECT Count(theJoin.SaleID) AS CountOfSaleItemID, Sum(theJoin.quantity) AS quantity, Sum(theJoin.price) AS price, aChannel.ChannelID, aChannel.Channel_Name FROM aChannel INNER JOIN (SELECT Sum(IIf([SaleItem_Reversal],0-[SaleItem_Quantity],[SaleItem_Quantity])) AS quantity, Sum(([SaleItem_Price]*[SaleItem_Quantity])) AS price, Sale.Sale_ChannelID, Sale.SaleID FROM SaleItem INNER JOIN Sale ON SaleItem.SaleItem_SaleID = Sale.SaleID Where (((SaleItem.SaleItem_Revoke) = 0) And ((SaleItem.SaleItem_DepositType) = 0)) GROUP BY Sale.Sale_ChannelID, Sale.SaleID) AS theJoin ON aChannel.ChannelID = theJoin.Sale_ChannelID GROUP BY aChannel.ChannelID, aChannel.Channel_Name;";
            rsChannel = modReport.getRSreport(ref sql);
            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            ReportNone.Load("cryNoRecords.rpt");
            if (rsPayment.BOF | rsPayment.EOF) {
                ReportNone.SetParameterValue("txtCompanyName", Report.ParameterFields("txtCompanyName").ToString);
                ReportNone.SetParameterValue("txtTitle", Report.ParameterFields("txtTitle").ToString);
                My.MyProject.Forms.frmReportShow.Text = ReportNone.ParameterFields("txtTitle").ToString;
                My.MyProject.Forms.frmReportShow.CRViewer1.ReportSource = ReportNone;
                My.MyProject.Forms.frmReportShow.mReport = ReportNone;
                My.MyProject.Forms.frmReportShow.sMode = "0";
                My.MyProject.Forms.frmReportShow.CRViewer1.Refresh();
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
                My.MyProject.Forms.frmReportShow.ShowDialog();
                return;
            }
            Report.OpenSubreport("Subreport1").Database.Tables(1).SetDataSource(rsPayment);
            Report.OpenSubreport("Subreport2").Database.Tables(1).SetDataSource(rsChannel);
            //Report.VerifyOnEveryPrint = True
            My.MyProject.Forms.frmReportShow.Text = Report.ParameterFields("txtTitle").ToString;
            My.MyProject.Forms.frmReportShow.CRViewer1.ReportSource = Report;
            My.MyProject.Forms.frmReportShow.mReport = Report;
            My.MyProject.Forms.frmReportShow.sMode = "0";
            My.MyProject.Forms.frmReportShow.CRViewer1.Refresh();
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            My.MyProject.Forms.frmReportShow.ShowDialog();
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:45,代码来源:modApplication.cs

示例4: report_Banking

        private static void report_Banking()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            string sql = null;
            //Dim Report As New cryBanking
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryBanking.rpt");
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            rs = modReport.getRSreport(ref "SELECT Report.Report_Heading, aCompany.Company_Name FROM aCompany, Report;");
            Report.SetParameterValue("txtCompanyName", rs.Fields("Company_Name"));
            Report.SetParameterValue("txtDayend", rs.Fields("Report_Heading"));
            rs.Close();
            rs = modReport.getRSreport(ref "SELECT aPOS.POSID, aPOS.POS_Name, Sum(Declaration.Declaration_Cash) AS SumOfDeclaration_Cash, Sum(Declaration.Declaration_CashServer) AS SumOfDeclaration_CashServer, Sum(Declaration.Declaration_CashCount) AS SumOfDeclaration_CashCount, Sum(Declaration.Declaration_Cheque) AS SumOfDeclaration_Cheque, Sum(Declaration.Declaration_ChequeServer) AS SumOfDeclaration_ChequeServer, Sum(Declaration.Declaration_ChequeCount) AS SumOfDeclaration_ChequeCount, Sum(Declaration.Declaration_Card) AS SumOfDeclaration_Card, Sum(Declaration.Declaration_CardServer) AS SumOfDeclaration_CardServer, Sum(Declaration.Declaration_CardCount) AS SumOfDeclaration_CardCount, Sum(Declaration.Declaration_Payout) AS SumOfDeclaration_Payout, Sum(Declaration.Declaration_PayoutServer) AS SumOfDeclaration_PayoutServer, Sum(Declaration.Declaration_PayoutCount) AS SumOfDeclaration_PayoutCount FROM Declaration INNER JOIN aPOS ON Declaration.Declaration_POSID = aPOS.POSID GROUP BY aPOS.POSID, aPOS.POS_Name;");
            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            ReportNone.Load("cryNoRecords.rpt");
            if (rs.BOF | rs.EOF) {
                ReportNone.SetParameterValue("txtCompanyName", Report.ParameterFields("txtCompanyName").ToString);
                ReportNone.SetParameterValue("txtTitle", Report.ParameterFields("txtTitle").ToString);
                My.MyProject.Forms.frmReportShow.Text = ReportNone.ParameterFields("txtTitle").ToString;
                My.MyProject.Forms.frmReportShow.CRViewer1.ReportSource = ReportNone;
                My.MyProject.Forms.frmReportShow.mReport = ReportNone;
                My.MyProject.Forms.frmReportShow.sMode = "0";
                My.MyProject.Forms.frmReportShow.CRViewer1.Refresh();
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
                My.MyProject.Forms.frmReportShow.ShowDialog();
                return;
            }

            Report.OpenSubreport("Subreport1").Database.Tables(1).SetDataSource(rs);
            Report.OpenSubreport("Subreport2").Database.Tables(1).SetDataSource(rs);

            //Report.VerifyOnEveryPrint = True
            My.MyProject.Forms.frmReportShow.Text = Report.ParameterFields("txtTitle").ToString;
            My.MyProject.Forms.frmReportShow.CRViewer1.ReportSource = Report;
            My.MyProject.Forms.frmReportShow.mReport = Report;
            My.MyProject.Forms.frmReportShow.sMode = "0";
            My.MyProject.Forms.frmReportShow.CRViewer1.Refresh();
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            My.MyProject.Forms.frmReportShow.ShowDialog();
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:40,代码来源:modApplication.cs

示例5: loadDayEndReportPrev

        public static void loadDayEndReportPrev(ref int id, ref int monthId)
        {
            int lTotal = 0;
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rsBanking = default(ADODB.Recordset);
            ADODB.Recordset rsPayout = default(ADODB.Recordset);
            ADODB.Recordset rsSupplier = default(ADODB.Recordset);
            ADODB.Recordset rsShrink = default(ADODB.Recordset);
            ADODB.Recordset rsCustomer = default(ADODB.Recordset);
            ADODB.Recordset rsQuote = default(ADODB.Recordset);
            ADODB.Recordset rsConsignment = default(ADODB.Recordset);
            string sql = null;
            //Dim Report As New cryDayEndForm
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryDayEndForm.rpt");
            int gParameters = 0;
            const short gParChannel = 1;
            const short gParStock = 2;
            const short gParShrink = 4;
            const short gParSupplier = 8;
            const short gParCustomer = 16;
            const short gParQuote = 32;
            const short gParConsignment = 64;
            const short gParPastelReport = 128;
            //Pastel Variable

            ADODB.Connection cn = default(ADODB.Connection);
            short x = 0;
            string databaseName = null;

            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            rs = modRecordSet.getRS(ref "SELECT * FROM Company");
            Report.SetParameterValue("txtCompanyName", rs.Fields("Company_Name"));
            gParameters = Convert.ToInt32(0 + rs.Fields("Company_DayEndBit").Value);
            rs.Close();

            rs = modRecordSet.getRS(ref "SELECT * FROM DayEnd WHERE DayEndID = " + id);
            //ReportNone.Load("cryNoRecords.rpt")
            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            ReportNone.Load("cryNoRecords.rpt");
            if (rs.BOF | rs.EOF) {
                ReportNone.SetParameterValue("txtCompanyName", Report.ParameterFields("txtCompanyName").ToString);
                ReportNone.SetParameterValue("txtTitle", Report.ParameterFields("txtTitle").ToString);
                My.MyProject.Forms.frmReportShow.Text = ReportNone.ParameterFields("txtTitle").ToString;
                My.MyProject.Forms.frmReportShow.CRViewer1.ReportSource = ReportNone;
                My.MyProject.Forms.frmReportShow.mReport = ReportNone;
                My.MyProject.Forms.frmReportShow.sMode = "0";
                My.MyProject.Forms.frmReportShow.CRViewer1.Refresh();
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
                My.MyProject.Forms.frmReportShow.ShowDialog();
                return;
            }
            Report.Database.Tables(1).SetDataSource(rs);
            databaseName = "month" + monthId + ".mdb";
            cn = modRecordSet.openConnectionInstance(ref Convert.ToString(databaseName));
            if (cn == null) {
                return;
            }

            if (My.MyProject.Forms.frmMenu.gSuper == true) {
                sql = "SELECT POS.POSID, POS.POS_Name, Sum(Declaration.Declaration_Cash) AS SumOfDeclaration_Cash, Sum(Declaration.Declaration_CashServer) AS SumOfDeclaration_CashServer, Sum(Declaration.Declaration_CashCount) AS SumOfDeclaration_CashCount, Sum(Declaration.Declaration_Cheque) AS SumOfDeclaration_Cheque, Sum(Declaration.Declaration_ChequeServer) AS SumOfDeclaration_ChequeServer, Sum(Declaration.Declaration_ChequeCount) AS SumOfDeclaration_ChequeCount, Sum(Declaration.Declaration_Card) AS SumOfDeclaration_Card, Sum(Declaration.Declaration_CardServer) AS SumOfDeclaration_CardServer, Sum(Declaration.Declaration_CardCount) AS SumOfDeclaration_CardCount, Sum(Declaration.Declaration_Payout) AS SumOfDeclaration_Payout, Sum(Declaration.Declaration_PayoutServer) AS SumOfDeclaration_PayoutServer, Sum(Declaration.Declaration_PayoutCount) AS SumOfDeclaration_PayoutCount FROM Declaration INNER JOIN POS ON Declaration.Declaration_POSID = POS.POSID Where (((Declaration.Declaration_DayEndID) = " + id + ")) ";
                sql = sql + "GROUP BY POS.POSID, POS.POS_Name;";
            } else {
                sql = "SELECT POS.POSID, POS.POS_Name, Sum(IIf(IIf(IsNull(Declaration.Declaration_CashDrop),0,Declaration.Declaration_CashDrop)=0,Declaration.Declaration_Cash,Declaration.Declaration_CashDrop)) AS SumOfDeclaration_Cash, Sum(IIf(IIf(IsNull(Declaration.Declaration_CashServerDrop),0,Declaration.Declaration_CashServerDrop)=0,Declaration.Declaration_CashServer,Declaration.Declaration_CashServerDrop)) AS SumOfDeclaration_CashServer, Sum(IIf(IIf(IsNull(Declaration.Declaration_CashCountDrop),0,Declaration.Declaration_CashCountDrop)=0,Declaration.Declaration_CashCount,Declaration.Declaration_CashCountDrop)) AS SumOfDeclaration_CashCount, ";
                sql = sql + "Sum(Declaration.Declaration_Cheque) AS SumOfDeclaration_Cheque, Sum(Declaration.Declaration_ChequeServer) AS SumOfDeclaration_ChequeServer, Sum(Declaration.Declaration_ChequeCount) AS SumOfDeclaration_ChequeCount, Sum(Declaration.Declaration_Card) AS SumOfDeclaration_Card, Sum(Declaration.Declaration_CardServer) AS SumOfDeclaration_CardServer, Sum(Declaration.Declaration_CardCount) AS SumOfDeclaration_CardCount, Sum(Declaration.Declaration_Payout) AS SumOfDeclaration_Payout, Sum(Declaration.Declaration_PayoutServer) AS SumOfDeclaration_PayoutServer, Sum(Declaration.Declaration_PayoutCount) AS SumOfDeclaration_PayoutCount FROM Declaration INNER JOIN POS ON Declaration.Declaration_POSID = POS.POSID Where (((Declaration.Declaration_DayEndID) = " + id + ")) ";
                sql = sql + "GROUP BY POS.POSID, POS.POS_Name;";
            }
            Debug.Print(sql);
            //Set rsBanking = getRS(sql)
            rsBanking = new ADODB.Recordset();
            rsBanking.Open(sql, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);

            //Set rsPayout = getRS("select * from Payout WHERE Payout_DayEndID = " & id)
            rsPayout = new ADODB.Recordset();
            sql = "select * from M_Payout WHERE Payout_DayEndID = " + id;
            rsPayout.Open(sql, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);

            if (rsBanking.RecordCount == 0) {
                Report.ReportDefinition.Sections("Section2").SectionFormat.EnableSuppress = true;
                Report.ReportDefinition.Sections("Section3").SectionFormat.EnableSuppress = true;
            } else {
                Report.ReportDefinition.Sections("Section2").SectionFormat.EnableSuppress = false;
                Report.ReportDefinition.Sections("Section3").SectionFormat.EnableSuppress = false;
                Report.OpenSubreport("Subreport1").Database.Tables(1).SetDataSource(rsBanking);
                Report.OpenSubreport("Subreport2").Database.Tables(1).SetDataSource(rsBanking);
            }
            if (rsPayout.RecordCount == 0) {
                Report.ReportDefinition.Sections("Section4").SectionFormat.EnableSuppress = true;
            } else {
                Report.ReportDefinition.Sections("Section4").SectionFormat.EnableSuppress = false;
                Report.OpenSubreport("Subreport4").Database.Tables(1).SetDataSource(rsPayout);
            }

            //************************************
            //*** Sales Channels
            //************************************

            if (gParameters & gParChannel) {
                rs = modRecordSet.getRS(ref "SELECT * FROM Channel");

//.........这里部分代码省略.........
开发者ID:nodoid,项目名称:PointOfSale,代码行数:101,代码来源:modApplication.cs

示例6: loadDayEndReport


//.........这里部分代码省略.........
                    //UPGRADE_WARNING: Screen property Screen.MousePointer has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6BA9B8D2-2A32-4B6E-8D36-44949974A5B4"'
                    System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
                    My.MyProject.Forms.frmReportShow.ShowDialog();
                }
                return;
            }
            //UPGRADE_WARNING: Couldn't resolve default property of object Report.Database. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'

            Report.Database.Tables(1).SetDataSource(rs);
            if (My.MyProject.Forms.frmMenu.gSuper == true) {
                sql = "SELECT POS.POSID, POS.POS_Name, Sum(Declaration.Declaration_Cash) AS SumOfDeclaration_Cash, Sum(Declaration.Declaration_CashServer) AS SumOfDeclaration_CashServer, Sum(Declaration.Declaration_CashCount) AS SumOfDeclaration_CashCount, Sum(Declaration.Declaration_Cheque) AS SumOfDeclaration_Cheque, Sum(Declaration.Declaration_ChequeServer) AS SumOfDeclaration_ChequeServer, Sum(Declaration.Declaration_ChequeCount) AS SumOfDeclaration_ChequeCount, Sum(Declaration.Declaration_Card) AS SumOfDeclaration_Card, Sum(Declaration.Declaration_CardServer) AS SumOfDeclaration_CardServer, Sum(Declaration.Declaration_CardCount) AS SumOfDeclaration_CardCount, Sum(Declaration.Declaration_Payout) AS SumOfDeclaration_Payout, Sum(Declaration.Declaration_PayoutServer) AS SumOfDeclaration_PayoutServer, Sum(Declaration.Declaration_PayoutCount) AS SumOfDeclaration_PayoutCount FROM Declaration INNER JOIN POS ON Declaration.Declaration_POSID = POS.POSID Where (((Declaration.Declaration_DayEndID) = " + id + ")) ";
                sql = sql + "GROUP BY POS.POSID, POS.POS_Name;";
            } else {
                sql = "SELECT POS.POSID, POS.POS_Name, Sum(IIf(IIf(IsNull(Declaration.Declaration_CashDrop),0,Declaration.Declaration_CashDrop)=0,Declaration.Declaration_Cash,Declaration.Declaration_CashDrop)) AS SumOfDeclaration_Cash, Sum(IIf(IIf(IsNull(Declaration.Declaration_CashServerDrop),0,Declaration.Declaration_CashServerDrop)=0,Declaration.Declaration_CashServer,Declaration.Declaration_CashServerDrop)) AS SumOfDeclaration_CashServer, Sum(IIf(IIf(IsNull(Declaration.Declaration_CashCountDrop),0,Declaration.Declaration_CashCountDrop)=0,Declaration.Declaration_CashCount,Declaration.Declaration_CashCountDrop)) AS SumOfDeclaration_CashCount, ";
                sql = sql + "Sum(Declaration.Declaration_Cheque) AS SumOfDeclaration_Cheque, Sum(Declaration.Declaration_ChequeServer) AS SumOfDeclaration_ChequeServer, Sum(Declaration.Declaration_ChequeCount) AS SumOfDeclaration_ChequeCount, Sum(Declaration.Declaration_Card) AS SumOfDeclaration_Card, Sum(Declaration.Declaration_CardServer) AS SumOfDeclaration_CardServer, Sum(Declaration.Declaration_CardCount) AS SumOfDeclaration_CardCount, Sum(Declaration.Declaration_Payout) AS SumOfDeclaration_Payout, Sum(Declaration.Declaration_PayoutServer) AS SumOfDeclaration_PayoutServer, Sum(Declaration.Declaration_PayoutCount) AS SumOfDeclaration_PayoutCount FROM Declaration INNER JOIN POS ON Declaration.Declaration_POSID = POS.POSID Where (((Declaration.Declaration_DayEndID) = " + id + ")) ";
                sql = sql + "GROUP BY POS.POSID, POS.POS_Name;";
            }
            Debug.Print(sql);
            rsBanking = modRecordSet.getRS(ref sql);

            rsPayout = modRecordSet.getRS(ref "select * from Payout WHERE Payout_DayEndID = " + id);

            if (rsBanking.RecordCount == 0) {
                //UPGRADE_WARNING: Couldn't resolve default property of object Report.Section2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                Report.ReportDefinition.Sections("Section2").SectionFormat.EnableSuppress = true;
                //UPGRADE_WARNING: Couldn't resolve default property of object Report.Section3. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                Report.ReportDefinition.Sections("Section3").SectionFormat.EnableSuppress = true;
            } else {
                //UPGRADE_WARNING: Couldn't resolve default property of object Report.Section2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                Report.ReportDefinition.Sections("Section2").SectionFormat.EnableSuppress = false;
                //UPGRADE_WARNING: Couldn't resolve default property of object Report.Section3. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                Report.ReportDefinition.Sections("Section3").SectionFormat.EnableSuppress = false;
                //UPGRADE_WARNING: Couldn't resolve default property of object Report.Subreport1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                Report.OpenSubreport("Subreport1").Database.Tables(1).SetDataSource(rsBanking);
                //UPGRADE_WARNING: Couldn't resolve default property of object Report.Subreport2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                Report.OpenSubreport("Subreport2").Database.Tables(1).SetDataSource(rsBanking);
            }
            if (rsPayout.RecordCount == 0) {
                //UPGRADE_WARNING: Couldn't resolve default property of object Report.Section4. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                Report.ReportDefinition.Sections("Section4").SectionFormat.EnableSuppress = true;
            } else {
                //UPGRADE_WARNING: Couldn't resolve default property of object Report.Section4. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                Report.ReportDefinition.Sections("Section4").SectionFormat.EnableSuppress = false;
                //UPGRADE_WARNING: Couldn't resolve default property of object Report.Subreport3. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                Report.OpenSubreport("Subreport3").Database.Tables(1).SetDataSource(rsPayout);
            }

            //************************************
            //*** Sales Channels
            //************************************

            if (gParameters & gParChannel) {
                rs = modRecordSet.getRS(ref "SELECT * FROM Channel");

                while (!(rs.EOF)) {
                    switch (rs.Fields("ChannelID").Value) {
                        case 1:
                            //UPGRADE_WARNING: Couldn't resolve default property of object Report.txtSC1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                            Report.SetParameterValue("txtSC1", rs.Fields("Channel_Code"));
                            break;
                        case 2:
                            //UPGRADE_WARNING: Couldn't resolve default property of object Report.txtSC2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                            Report.SetParameterValue("txtSC2", rs.Fields("Channel_Code"));
                            break;
                        case 3:
                            //UPGRADE_WARNING: Couldn't resolve default property of object Report.txtSC3. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
开发者ID:nodoid,项目名称:PointOfSale,代码行数:67,代码来源:modApplication.cs


注:本文中的CrystalDecisions.CrystalReports.Engine.ReportDocument.OpenSubreport方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。