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


C# ReportDocument.ParameterFields方法代码示例

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


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

示例1: cmdLoad_Click

        private void cmdLoad_Click(System.Object eventSender, System.EventArgs eventArgs)
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rsData = default(ADODB.Recordset);
            //Dim Report As New cryItemGroupCompare
            //ReportNone.Load("cryNoRecords.rpt")
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryItemGroupCompare.rpt");
            ReportNone.Load("cryNoRecords");
            modReport.cnnDBreport.Execute("DELETE LinkItem.* FROM LinkItem;");
            rs = modReport.getRSreport(ref "SELECT * FROM Link Where LinkID=1 AND Link_SectionID=1");
            modReport.cnnDBreport.Execute("INSERT INTO LinkItem ( LinkItem_LinkID, LinkItem_DayEndID, LinkItem_Value ) SELECT 1, DayEndStockItemLnk.DayEndStockItemLnk_DayEndID, DayEndStockItemLnk.DayEndStockItemLnk_QuantitySales FROM DayEndStockItemLnk INNER JOIN aStockItem ON DayEndStockItemLnk.DayEndStockItemLnk_StockItemID = aStockItem.StockItemID WHERE " + rs.Fields("Link_SQL").Value + ";");
            rs = modReport.getRSreport(ref "SELECT * FROM Link Where LinkID=2 AND Link_SectionID=1");
            modReport.cnnDBreport.Execute("INSERT INTO LinkItem ( LinkItem_LinkID, LinkItem_DayEndID, LinkItem_Value ) SELECT 2, DayEndStockItemLnk.DayEndStockItemLnk_DayEndID, Sum(DayEndStockItemLnk.DayEndStockItemLnk_QuantitySales) AS SumOfDayEndStockItemLnk_QuantitySales FROM DayEndStockItemLnk INNER JOIN aStockItem ON DayEndStockItemLnk.DayEndStockItemLnk_StockItemID = aStockItem.StockItemID " + rs.Fields("Link_SQL").Value + " GROUP BY DayEndStockItemLnk.DayEndStockItemLnk_DayEndID;");

            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 Link.* From Link Where (((Link.Link_SectionID) = 1)) ORDER BY Link.Link_SectionID;");
            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;
            }
            rsData = modReport.getRSreport(ref "SELECT LinkItem.*, Format([DayEnd_Date],'ddd dd mmm\", \"yyyy') AS dateName, DayEnd.DayEnd_Date FROM DayEnd INNER JOIN LinkItem ON DayEnd.DayEndID = LinkItem.LinkItem_DayEndID;");
            if (rsData.BOF | rsData.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);
            Report.Database.Tables(2).SetDataSource(rsData);
            //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,代码行数:59,代码来源:frmItemGroup.cs

示例2: report_Deposit

        private static void report_Deposit()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            string sql = null;
            //Dim Report As New cryDeposit
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryDeposit.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 aDeposit.Deposit_Name, aDeposit.Deposit_Quantity, Sum((IIf([SaleItem_DepositType]=3,[Deposit_Quantity],0)+IIf([SaleItem_DepositType]=1,1,0))*[SaleItem_Quantity]) AS bottle, Sum((IIf([SaleItem_DepositType]=3,1,0)+IIf([SaleItem_DepositType]=2,1,0))*[SaleItem_Quantity]) AS crate, Sum([SaleItem_Price]*[SaleItem_Quantity]) AS amount, aDeposit.Deposit_UnitCost, aDeposit.Deposit_CaseCost FROM SaleItem INNER JOIN aDeposit ON SaleItem.SaleItem_StockItemID = aDeposit.DepositID Where (((SaleItem.SaleItem_DepositType) <> 0) And ((SaleItem.SaleItem_Reversal) = False) And ((SaleItem.SaleItem_Revoke) = False)) GROUP BY aDeposit.Deposit_Name, aDeposit.Deposit_Quantity, aDeposit.Deposit_UnitCost, aDeposit.Deposit_CaseCost;");
            //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);

            //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

示例3: loadValue

        private void loadValue()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rsData = default(ADODB.Recordset);
            //Dim Report As New cryItemItemCompareValue
            //ReportNone.Load("cryNoRecords.rpt")
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryItemItemCompareValue.rpt");
            ReportNone.Load("cryNoRecords.rpt");
            modReport.cnnDBreport.Execute("DELETE LinkItem.* FROM LinkItem;");
            rs = modReport.getRSreport(ref "SELECT * FROM Link Where Link_SectionID=3");
            while (!(rs.EOF)) {
                if (!string.IsNullOrEmpty(rs.Fields("Link_SQL").Value)) {
                    modReport.cnnDBreport.Execute("INSERT INTO LinkItem ( LinkItem_LinkID, LinkItem_DayEndID, LinkItem_Value ) SELECT " + rs.Fields("LinkID").Value + ", Sale.Sale_DayEndID, Sum([SaleItem_Quantity]*[SaleItem_Price]) FROM (SaleItem INNER JOIN aStockItem ON SaleItem.SaleItem_StockItemID = aStockItem.StockItemID) INNER JOIN Sale ON SaleItem.SaleItem_SaleID = Sale.SaleID Where " + rs.Fields("Link_SQL").Value + " GROUP BY Sale.Sale_DayEndID;");
                }
                rs.moveNext();
            }

            modReport.cnnDBreport.Execute("INSERT INTO LinkItem ( LinkItem_LinkID, LinkItem_DayEndID, LinkItem_Value ) SELECT theJoin.LinkID, theJoin.DayEndID, 0 FROM LinkItem RIGHT JOIN [SELECT Link.LinkID, DayEnd.DayEndID From Link, DayEnd WHERE (((Link.Link_SQL)<>'') AND ((Link.Link_SectionID)=3))]. AS theJoin ON (LinkItem.LinkItem_DayEndID = theJoin.DayEndID) AND (LinkItem.LinkItem_LinkID = theJoin.LinkID) WHERE (((LinkItem.LinkItem_LinkID) Is Null));");
            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 [Link].[LinkID], [Link].[Link_Name], Sum([LinkItem].[LinkItem_Value]) AS SumOfLinkItem_Value FROM Link INNER JOIN LinkItem ON [Link].[LinkID]=[LinkItem].[LinkItem_LinkID] WHERE ((([Link].[Link_SQL])<>'') And (([Link].[Link_SectionID])=3)) GROUP BY [Link].[LinkID], [Link].[Link_Name] ORDER BY [Link].[LinkID];");

            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;
            }
            rsData = modReport.getRSreport(ref "SELECT LinkItem.*, Format([DayEnd_Date],'yyyy mm dd ddd') AS dateName, DayEnd.DayEnd_Date FROM DayEnd INNER JOIN LinkItem ON DayEnd.DayEndID = LinkItem.LinkItem_DayEndID ORDER BY DayEnd.DayEnd_Date;");
            if (rsData.BOF | rsData.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);
            Report.Database.Tables(2).SetDataSource(rsData);
            System.Windows.Forms.Application.DoEvents();
            //Report.VerifyOnEveryPrint = True
            System.Windows.Forms.Application.DoEvents();
            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,代码行数:66,代码来源:frmItemItem.cs

示例4: cmdPrint_Click

        private void cmdPrint_Click(System.Object eventSender, System.EventArgs eventArgs)
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rsQty = default(ADODB.Recordset);
            ADODB.Recordset RSitem = default(ADODB.Recordset);
            bool ltype = false;
            //Dim Report As New cryCashTransaction
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryCashTransaction.rpt");
            //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.WaitCursor;
            rs = modRecordSet.getRS(ref "SELECT * FROM Company");
            //UPGRADE_WARNING: Couldn't resolve default property of object Report.txtCompanyName. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            Report.SetParameterValue("txtCompanyName", rs.Fields("Company_Name"));
            rs.Close();

            rs = modRecordSet.getRS(ref "SELECT * FROM Channel ORDER BY ChannelID");
            while (!(rs.EOF)) {
                switch (rs.Fields("ChannelID").Value) {
                    case 1:
                        Report.SetParameterValue("txtCS1", rs.Fields("Channel_Code"));
                        break;
                    case 2:
                        Report.SetParameterValue("txtCS2", rs.Fields("Channel_Code"));
                        break;
                    case 3:
                        Report.SetParameterValue("txtCS3", rs.Fields("Channel_Code"));
                        break;
                    case 4:
                        Report.SetParameterValue("txtCS4", rs.Fields("Channel_Code"));
                        break;
                    case 5:
                        Report.SetParameterValue("txtCS5", rs.Fields("Channel_Code"));
                        break;
                    case 6:
                        Report.SetParameterValue("txtCS6", rs.Fields("Channel_Code"));
                        break;
                    case 7:
                        Report.SetParameterValue("txtCS7", rs.Fields("Channel_Code"));
                        break;
                    case 8:
                        Report.SetParameterValue("txtCS8", rs.Fields("Channel_Code"));
                        break;
                }
                rs.moveNext();
            }
            rs.Close();

            rs = modRecordSet.getRS(ref "SELECT CashTransaction.*, StockItem.StockItem_Name FROM StockItem INNER JOIN CashTransaction ON StockItem.StockItemID = CashTransaction.CashTransaction_StockItemID;");
            //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();
                //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;
            }

            Report.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();
            //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();
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:77,代码来源:frmCashTransactionList.cs

示例5: cmdInv_Click


//.........这里部分代码省略.........
                //            Report.txtCompanyDetails4.SetText "TAX NO :" & lTransaction.taxNumber
                //        End If
                //    End If
                //Else
                //    If lTransaction.heading3 <> "" Then
                //        Report.txtCompanyDetails2.SetText lTransaction.heading3
                //    Else
                //        If lTransaction.taxNumber <> "" Then
                //            Report.txtCompanyDetails2.SetText "TAX NO :" & lTransaction.taxNumber
                //        End If
                //    End If
                //End If
                rs.Close();
                Report.SetParameterValue("txtCustomer", _txtFields_2.Text);
                if (!string.IsNullOrEmpty(_txtFields_6.Text)) {
                    lArray = Strings.Split(_txtFields_6.Text, Constants.vbCrLf);
                    Report.SetParameterValue("txtCustAddress1", lArray[0]);
                    if (Information.UBound(lArray) >= 1)
                        Report.SetParameterValue("txtCustAddress2", lArray[1]);
                    if (Information.UBound(lArray) >= 2)
                        Report.SetParameterValue("txtCustAddress3", lArray[2]);
                    if (Information.UBound(lArray) >= 3)
                        Report.SetParameterValue("txtCustAddress4", lArray[3]);

                }
                if (!string.IsNullOrEmpty(_txtFields_0.Text))
                    Report.SetParameterValue("txtCustAddress5", "TAX NO: " + _txtFields_0.Text);

                //If LCase(databaseName) = "pricing.mdb" Then
                //    sql = "SELECT Sale.SaleID, POS.POS_Name, Person.Person_FirstName, Person.Person_LastName, Sale.Sale_Date, Sale.Sale_DatePOS, Sale.Sale_Reference, Sale.Sale_Total, Sale.Sale_Tender FROM (Sale INNER JOIN POS ON Sale.Sale_PosID = POS.POSID) INNER JOIN Person ON Sale.Sale_PersonID = Person.PersonID WHERE (((Sale.SaleID)=" & lID & "));"
                //Else
                //    sql = "SELECT Sale.SaleID, POS.POS_Name, M_Person.Person_FirstName, M_Person.Person_LastName, Sale.Sale_Date, Sale.Sale_DatePOS, Sale.Sale_Reference, Sale.Sale_Total, Sale.Sale_Tender FROM (Sale INNER JOIN POS ON Sale.Sale_PosID = POS.POSID) INNER JOIN M_Person ON Sale.Sale_PersonID = M_Person.PersonID WHERE (((Sale.SaleID)=" & lID & "));"
                //End If
                //sql = "SELECT Sale.SaleID, POS.POS_Name, Person.Person_FirstName, Person.Person_LastName, Sale.Sale_Date, Sale.Sale_DatePOS, Sale.Sale_Reference, Sale.Sale_Total, Sale.Sale_Tender FROM (Sale INNER JOIN POS ON Sale.Sale_PosID = POS.POSID) INNER JOIN Person ON Sale.Sale_PersonID = Person.PersonID WHERE (((Sale.SaleID)=" & lID & "));"
                sql = "SELECT Sale.* From Sale WHERE (((SaleID)=" + lID + "));";
                rs.Open(sql, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);

                if (rs.RecordCount) {
                    posID = rs.Fields("Sale_PosID").Value;
                    personID = rs.Fields("Sale_PersonID").Value;
                    Report.SetParameterValue("txtInvoiceNumber", rs.Fields("Sale_Reference"));
                    Report.SetParameterValue("txtInvoiceDate", Strings.Format(rs.Fields("Sale_DatePOS").Value, "dd mmm yyyy hh:mm"));
                    //Report.txtPOS.SetText rs("POS_Name")
                    //Report.txtCashier.SetText rs("Person_FirstName") & rs("Person_LastName")
                    Report.SetParameterValue("txtAmount", Strings.FormatNumber(rs.Fields("Sale_Total").Value, 2));
                    Report.SetParameterValue("txtChange", Strings.FormatNumber(rs.Fields("Sale_Tender").Value - rs.Fields("Sale_Total").Value, 2));
                    // lTransaction.paymentTotal - lTransaction.paymentTender, 2)
                    Report.SetParameterValue("txtTender", Strings.FormatNumber(rs.Fields("Sale_Tender").Value, 2));
                    //  lTransaction.paymentTender, 2)
                    //Report.txtPaidBy.SetText lTransaction.customer.signed
                    Report.ReportDefinition.Sections("txtPaidBy").SectionFormat.EnableSuppress = true;
                    rs.Close();

                    sql = "SELECT [Person_FirstName] & ' ' & [Person_LastName] AS personName From Person WHERE (((PersonID)=" + personID + "));";
                    rs = modRecordSet.getRS(ref sql);
                    if (rs.RecordCount) {
                        Report.SetParameterValue("txtCashier", rs.Fields("personName").Value + "");
                    }
                    rs.Close();

                    sql = "SELECT POS_Name From POS WHERE (((POS.POSID)=" + posID + "));";
                    rs = modRecordSet.getRS(ref sql);
                    if (rs.RecordCount) {
                        Report.SetParameterValue("txtPOS", rs.Fields("POS_Name").Value + "");
                    }
                    rs.Close();

                    sql = "SELECT CustomerTransaction.CustomerTransaction_TransactionTypeID, CustomerTransaction.CustomerTransaction_Amount, CustomerTransaction.CustomerTransaction_ReferenceID From CustomerTransaction WHERE (((CustomerTransaction.CustomerTransaction_TransactionTypeID)=8) AND ((CustomerTransaction.CustomerTransaction_ReferenceID)=" + lID + "));";
                    Debug.Print(sql);
                    rs.Open(sql, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);
                    if (rs.RecordCount) {
                        Report.SetParameterValue("txtSettlement", Strings.FormatNumber(rs.Fields("CustomerTransaction_Amount").Value, 2));
                    } else {
                        Report.SetParameterValue("txtSettlement", Strings.FormatNumber("0.00", 2));
                    }

                    My.MyProject.Forms.frmReportShow.Text = "Customer Statement";
                    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();
                } else {
                    ReportNone.Load("cryNoRecords.rpt");
                    ReportNone.SetParameterValue("txtCompanyName", rs.Fields("Company_Name"));
                    ReportNone.SetParameterValue("txtTitle", "Customer Statement");
                    //UPGRADE_WARNING: Couldn't resolve default property of object ReportNone.txtTitle. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                    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;
                }

            }
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:101,代码来源:frmCustomerAllocPayment.cs

示例6: mnuStock_Click

        private void mnuStock_Click()
        {
            tmrReportCancel.Enabled = false;
            //Dim Report As New cryMenuStock
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryMenuStock.rpt");
            ADODB.Recordset rs = default(ADODB.Recordset);
            decimal lTotal = default(decimal);

            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            //do invoice discount
            rs = modRecordSet.getRS(ref "SELECT Sum(Sale.Sale_Discount) AS amount FROM (Consignment RIGHT JOIN (Consignment AS Consignment_1 RIGHT JOIN Sale ON Consignment_1.Consignment_SaleID = Sale.SaleID) ON Consignment.Consignment_ReversalSaleID = Sale.SaleID) INNER JOIN Company ON Sale.Sale_DayEndID = Company.Company_DayEndID WHERE (((Consignment.ConsignmentID) Is Null) AND ((Consignment_1.ConsignmentID) Is Null) AND ((Sale.Sale_PaymentType)<>5));");
            if (Information.IsDBNull(rs.Fields("amount").Value)) {
                Report.SetParameterValue("txtStockDiscount", "0.00");
            } else {
                if (rs.RecordCount) {
                    Report.SetParameterValue("txtStockDiscount", Strings.FormatNumber(rs.Fields("amount").Value, 2));
                } else {
                    Report.SetParameterValue("txtStockDiscount", "0.00");
                }
            }
            rs.Close();

            rs = modRecordSet.getRS(ref "SELECT Sum([SaleItem_Price]*[SaleItem_Quantity]) AS content, CBool([SaleItem_DepositType]) AS depositType, SaleItem.SaleItem_Reversal, Sum(([SaleItem_DepositCost]*[SaleItem_Quantity])*(1+[SaleItem_Vat]/100)) AS deposit FROM Company INNER JOIN (Consignment AS Consignment_1 RIGHT JOIN (Consignment RIGHT JOIN (Sale INNER JOIN SaleItem ON Sale.SaleID = SaleItem.SaleItem_SaleID) ON Consignment.Consignment_SaleID = Sale.SaleID) ON Consignment_1.Consignment_ReversalSaleID = Sale.SaleID) ON Company.Company_DayEndID = Sale.Sale_DayEndID Where (((SaleItem.SaleItem_Revoke) = False) And ((Consignment.ConsignmentID) Is Null) And ((Consignment_1.ConsignmentID) Is Null)) GROUP BY CBool([SaleItem_DepositType]), SaleItem.SaleItem_Reversal;");
            while (!(rs.EOF)) {
                if (rs.Fields("depositType").Value) {
                    if (rs.Fields("SaleItem_Reversal").Value) {
                        Report.SetParameterValue("txtStockDepositSold", Strings.FormatNumber(rs.Fields("content").Value, 2));
                    } else {
                        Report.SetParameterValue("txtStockDepositReturn", Strings.FormatNumber(rs.Fields("content").Value, 2));
                    }
                } else {
                    if (rs.Fields("SaleItem_Reversal").Value) {
                        Report.SetParameterValue("txtStockCreditContent", Strings.FormatNumber(rs.Fields("content").Value, 2));
                        Report.SetParameterValue("txtStockCreditDeposit", Strings.FormatNumber(0 - rs.Fields("deposit").Value, 2));
                    } else {
                        Report.SetParameterValue("txtStockSoldContent", Strings.FormatNumber(rs.Fields("content").Value, 2));
                        Report.SetParameterValue("txtStockSoldDeposit", Strings.FormatNumber(rs.Fields("deposit").Value, 2));
                    }
                }
                rs.MoveNext();
            }
            rs.Close();
            Report.SetParameterValue("txtStockSoldContent", Strings.FormatNumber(Convert.ToDecimal(Report.ParameterFields("txtStockSoldContent").ToString) - Convert.ToDecimal(Report.ParameterFields("txtStockSoldDeposit").ToString), 2));
            Report.SetParameterValue("txtStockCreditContent", Strings.FormatNumber(Convert.ToDecimal(Report.ParameterFields("txtStockCreditContent").ToString) - Convert.ToDecimal(Report.ParameterFields("txtStockCreditDeposit").ToString), 2));
            Report.SetParameterValue("txtStockSold", Strings.FormatNumber(Convert.ToDecimal(Report.ParameterFields("txtStockSoldContent").ToString) + Convert.ToDecimal(Report.ParameterFields("txtStockSoldDeposit").ToString), 2));
            Report.SetParameterValue("txtStockCreditTotal", Strings.FormatNumber(Convert.ToDecimal(Report.ParameterFields("txtStockCreditContent").ToString) + Convert.ToDecimal(Report.ParameterFields("txtStockCreditDeposit").ToString), 2));
            Report.SetParameterValue("txtStockTotal", Strings.FormatNumber(Convert.ToDecimal(Report.ParameterFields("txtStockSold").ToString) + Convert.ToDecimal(Report.ParameterFields("txtStockCreditTotal").ToString) + Convert.ToDecimal(Report.ParameterFields("txtStockDepositSold").ToString) + Convert.ToDecimal(Report.ParameterFields("txtStockDepositReturn").ToString), 2));
            // + CCur(Report.txtStockDiscount.Text),2)
            //    Report.txtStockTotal.SetText Report.txtStockDepositReturn.Text
            CrystalReportViewer1.ReportSource = Report;
            CrystalReportViewer1.Refresh();
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            tmrReportCancel.Enabled = true;
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:56,代码来源:frmMenu.cs

示例7: mnuAccount_Click

        private void mnuAccount_Click()
        {
            tmrReportCancel.Enabled = false;
            //Dim Report As New cryMenuAccount
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryMenuAccount.rpt");
            ADODB.Recordset rs = default(ADODB.Recordset);
            decimal lTotal = default(decimal);

            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            lTotal = 0;
            rs = modRecordSet.getRS(ref "SELECT Sum(Sale.Sale_Total) AS amount, Sale.Sale_PaymentType FROM Company INNER JOIN (Consignment AS Consignment_1 RIGHT JOIN (Consignment RIGHT JOIN (CustomerTransaction INNER JOIN Sale ON CustomerTransaction.CustomerTransaction_ReferenceID = Sale.SaleID) ON Consignment.Consignment_SaleID = Sale.SaleID) ON Consignment_1.Consignment_ReversalSaleID = Sale.SaleID) ON Company.Company_DayEndID = Sale.Sale_DayEndID Where (((CustomerTransaction.CustomerTransaction_TransactionTypeID) = 2 Or (CustomerTransaction.CustomerTransaction_TransactionTypeID) = 3) And ((Consignment.ConsignmentID) Is Null) And ((Consignment_1.ConsignmentID) Is Null)) GROUP BY Sale.Sale_PaymentType;");
            while (!(rs.EOF)) {
                switch (rs.Fields("Sale_PaymentType").Value) {
                    case 5:
                        Report.SetParameterValue("txtAccountSales", Strings.FormatNumber(rs.Fields("amount").Value, 2));
                        break;
                    case 1:
                        Report.SetParameterValue("txtAccountCash", Strings.FormatNumber(0 - rs.Fields("amount").Value, 2));
                        lTotal = lTotal - rs.Fields("amount").Value;
                        break;
                    case 2:
                        Report.SetParameterValue("txtAccountCRcard", Strings.FormatNumber(0 - rs.Fields("amount").Value, 2));
                        lTotal = lTotal - rs.Fields("amount").Value;
                        break;
                    case 3:
                        Report.SetParameterValue("txtAccountDRcard", Strings.FormatNumber(0 - rs.Fields("amount").Value, 2));
                        lTotal = lTotal - rs.Fields("amount").Value;
                        break;
                    case 4:
                        Report.SetParameterValue("txtAccountCheque", Strings.FormatNumber(0 - rs.Fields("amount").Value, 2));
                        lTotal = lTotal - rs.Fields("amount").Value;
                        break;
                }
                rs.MoveNext();
            }
            Report.SetParameterValue("txtAccountPayment", Strings.FormatNumber(lTotal, 2));
            lTotal = lTotal + Convert.ToDecimal(Report.ParameterFields("txtAccountSales").ToString);
            Report.SetParameterValue("txtAccountTotal", Strings.FormatNumber(lTotal, 2));

            CrystalReportViewer1.ReportSource = Report;
            CrystalReportViewer1.Refresh();
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            tmrReportCancel.Enabled = true;
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:46,代码来源:frmMenu.cs

示例8: cmdLoad_Click

        private void cmdLoad_Click(System.Object eventSender, System.EventArgs eventArgs)
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rsData = default(ADODB.Recordset);
            //Dim Report As New cryItemGroupCompare
            //ReportNone.Load("cryNoRecords.rpt")
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryItemGroupCompare.rpt");
            ReportNone.Load("cryNoRecords.rpt");
            modReport.cnnDBreport.Execute("DELETE LinkItem.* FROM LinkItem;");
            rs = modReport.getRSreport(ref "SELECT * FROM Link Where Link_SectionID=3");
            while (!(rs.EOF)) {
                if (!string.IsNullOrEmpty(rs.Fields("Link_SQL").Value)) {
                    if (_optDataType_0.Checked) {
                        modReport.cnnDBreport.Execute("INSERT INTO LinkItem ( LinkItem_LinkID, LinkItem_DayEndID, LinkItem_Value ) SELECT " + rs.Fields("LinkID").Value + ", DayEndStockItemLnk.DayEndStockItemLnk_DayEndID, DayEndStockItemLnk.DayEndStockItemLnk_QuantitySales FROM DayEndStockItemLnk INNER JOIN aStockItem ON DayEndStockItemLnk.DayEndStockItemLnk_StockItemID = aStockItem.StockItemID WHERE " + rs.Fields("Link_SQL").Value + ";");
                    } else {
                        modReport.cnnDBreport.Execute("INSERT INTO LinkItem ( LinkItem_LinkID, LinkItem_DayEndID, LinkItem_Value ) SELECT " + rs.Fields("LinkID").Value + ", Sale.Sale_DayEndID, Sum([SaleItem_Quantity]*[SaleItem_Price]) FROM (SaleItem INNER JOIN aStockItem ON SaleItem.SaleItem_StockItemID = aStockItem.StockItemID) INNER JOIN Sale ON SaleItem.SaleItem_SaleID = Sale.SaleID Where " + rs.Fields("Link_SQL").Value + " GROUP BY Sale.Sale_DayEndID;");
                    }

                }
                rs.MoveNext();
            }
            modReport.cnnDBreport.Execute("INSERT INTO LinkItem ( LinkItem_LinkID, LinkItem_DayEndID, LinkItem_Value ) SELECT theJoin.LinkID, theJoin.DayEndID, 0 FROM LinkItem RIGHT JOIN [SELECT Link.LinkID, DayEnd.DayEndID From Link, DayEnd WHERE (((Link.Link_SQL)<>'') AND ((Link.Link_SectionID)=3))]. AS theJoin ON (LinkItem.LinkItem_DayEndID = theJoin.DayEndID) AND (LinkItem.LinkItem_LinkID = theJoin.LinkID) WHERE (((LinkItem.LinkItem_LinkID) Is Null));");

            return;
            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 Link.* From Link Where (((Link.Link_SectionID) = 1)) ORDER BY Link.Link_SectionID;");
            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;
            }
            rsData = modReport.getRSreport(ref "SELECT LinkItem.*, Format([DayEnd_Date],'ddd dd mmm\", \"yyyy') AS dateName, DayEnd.DayEnd_Date FROM DayEnd INNER JOIN LinkItem ON DayEnd.DayEndID = LinkItem.LinkItem_DayEndID;");
            if (rsData.BOF | rsData.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);
            Report.Database.Tables(2).SetDataSource(rsData);
            //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,代码行数:69,代码来源:frmItem.cs

示例9: report_PayoutReason

        private static void report_PayoutReason()
        {
            ADODB.Recordset rsDayEnd = default(ADODB.Recordset);
            string lPGID = null;
            ADODB.Recordset rs = default(ADODB.Recordset);
            string sql = null;
            //Dim Report As New cryPayout
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryPayout.rpt");
            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            ReportNone.Load("cryNoRecords.rpt");
            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();
            if (Interaction.MsgBox("Do you wish to see All Payouts?", MsgBoxStyle.Question + MsgBoxStyle.YesNo) == MsgBoxResult.Yes) {
                sql = "SELECT Payout.* From Payout ORDER BY Payout.PayoutID;";
            } else {
                lPGID = My.MyProject.Forms.frmPayoutGroupList.getItem();
                sql = "SELECT Payout.* From aPayoutGroup1, Payout WHERE (((aPayoutGroup1.PayoutGroup_Name)=(Left([Payout].[Payout_Narrative],Len([aPayoutGroup1].[PayoutGroup_Name])))) AND ((aPayoutGroup1.PayoutGroupID)=" + lPGID + "));";
            }
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            rs = modReport.getRSreport(ref sql);
            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;
            }
            rsDayEnd = modReport.getRSreport(ref "SELECT * FROM DayEnd");
            Report.Database.Tables(1).SetDataSource(rsDayEnd);

            Report.Database.Tables(2).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,代码行数:49,代码来源:modApplication.cs

示例10: report_Payout

        private static void report_Payout()
        {
            ADODB.Recordset rsDayEnd = default(ADODB.Recordset);
            ADODB.Recordset rs = default(ADODB.Recordset);
            string sql = null;
            //Dim Report As New cryPayout
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryPayout.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();
            sql = "SELECT * FROM Payout";
            rs = modReport.getRSreport(ref sql);
            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;
            }
            rsDayEnd = modReport.getRSreport(ref "SELECT * FROM DayEnd");
            Report.Database.Tables(1).SetDataSource(rsDayEnd);

            Report.Database.Tables(2).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,代码行数:43,代码来源:modApplication.cs

示例11: report_Outage

        private static void report_Outage()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rsDayEnd = default(ADODB.Recordset);
            string sql = null;
            //Dim Report As New cryOutage
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("crtOutage.rpt");
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            Report.SetParameterValue("txtCompanyName", rs.Fields("Company_Name"));
            Report.SetParameterValue("txtDayend", rs.Fields("Report_Heading"));
            rs.Close();

            sql = "SELECT Declaration.Declaration_DayEndID, 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 ";
            sql = sql + "FROM Declaration INNER JOIN aPOS ON Declaration.Declaration_POSID = aPOS.POSID GROUP BY Declaration.Declaration_DayEndID, aPOS.POSID, aPOS.POS_Name;";

            rs = modReport.getRSreport(ref sql);
            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;
            }
            rsDayEnd = modReport.getRSreport(ref "SELECT * FROM DayEnd");
            Report.Database.Tables(1).SetDataSource(rsDayEnd);

            Report.Database.Tables(2).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,代码行数:45,代码来源:modApplication.cs

示例12: report_HourlyReport

        private static void report_HourlyReport()
        {
            ADODB.Recordset rsSale = default(ADODB.Recordset);
            decimal SumSales = default(decimal);
            string sql2 = null;
            ADODB.Recordset rs = default(ADODB.Recordset);
            string sql = null;
            //Dim Report As New cryHourlyReport
            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            ReportNone.Load("cryNoRecords.rpt");
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryHourlyReport.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();
            sql = "SELECT * FROM Sale";
            rs = modReport.getRSreport(ref sql);
            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;
            }

            sql2 = "SELECT SaleItem.SaleItem_StockItemID, Sum(IIf([SaleItem_Reversal],0-[SaleItem_ActualCost]*[SaleItem_Quantity],[SaleItem_ActualCost]*[SaleItem_Quantity])) AS actualCostSum, Sum(IIf([SaleItem_Reversal],0-[SaleItem_ListCost]*[SaleItem_Quantity],[SaleItem_ListCost]*[SaleItem_Quantity])) AS listCostSum, Sum(([SaleItem_Price]*[SaleItem_Quantity]/(1+[SaleItem_Vat]/100))) AS exclusiveSum, Sum(([SaleItem_Price]*[SaleItem_Quantity])) AS inclusiveSum, Sum(IIf([SaleItem_Reversal],0-[SaleItem_DepositCost]*[SaleItem_Quantity],[SaleItem_DepositCost]*[SaleItem_Quantity])) AS depositSum, Sum(IIf([SaleItem_Reversal],0-[SaleItem_ShrinkQuantity]*[SaleItem_Quantity],[SaleItem_ShrinkQuantity]*[SaleItem_Quantity])) AS quantitySum FROM Sale INNER JOIN (aConsignment AS aConsignment_1 RIGHT JOIN (SaleItem LEFT JOIN aConsignment ON SaleItem.SaleItem_SaleID=aConsignment.Consignment_SaleID) ON aConsignment_1.Consignment_ReversalSaleID=SaleItem.SaleItem_SaleID) ON Sale.SaleID=SaleItem.SaleItem_SaleID" + " Where (((SaleItem.SaleItem_DepositType) = 0) And ((SaleItem.SaleItem_Revoke) = False) And ((aConsignment.ConsignmentID) Is Null) And ((aConsignment_1.ConsignmentID) Is Null))" + " GROUP BY SaleItem.SaleItem_StockItemID;";

            rsSale = modReport.getRSreport(ref sql2);
            while (rsSale.EOF == false) {
                SumSales = SumSales + rsSale.Fields("inclusiveSum").Value;

                rsSale.moveNext();
            }

            Report.Database.Tables(1).SetDataSource(rs);

            Report.SetParameterValue("txtSum", Strings.FormatNumber(SumSales, 2));

            //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,代码行数:55,代码来源:modApplication.cs

示例13: report_GRVDetails

        private static void report_GRVDetails()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rsGRVItem = default(ADODB.Recordset);
            ADODB.Recordset rsGRVItemReturn = default(ADODB.Recordset);
            ADODB.Recordset rsGRVDeposit = default(ADODB.Recordset);
            ADODB.Recordset rsGRVDepositReturn = default(ADODB.Recordset);
            ADODB.Recordset rsGRVMain = default(ADODB.Recordset);
            ADODB.Recordset rsGRVPricing = default(ADODB.Recordset);

            string sql = null;
            //Dim Report As New cryGRVDetails
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryGRVDetails.rpt");
            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            ReportNone.Load("cryNoRecords.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();

            //New sql
            //Set rsGRVItem = getRSreport("SELECT aGRV.GRVID,Sum(IIf([GRVItem_Return],0,[GRVItem_DepositCost]*[GRVItem_Quantity])) AS depositExcl, Sum(IIf([GRVItem_Return],0,((((([GRVItem_PackSize]/[GRVItem_StockItemQuantity]*[GRVItem_ContentCost])-[GRVItem_DiscountAmount])*[GRVItem_Quantity])*(1+[GRVItem_VatRate]/100))))) AS inclusive,Sum(IIf([GRVItem_Return],0,(((([GRVItem_PackSize]/[GRVItem_StockItemQuantity]*[GRVItem_ContentCost])-[GRVItem_DiscountAmount])*[GRVItem_Quantity])))) AS exclusive, Sum(IIf([GRVItem_Return],0,([GRVItem_DepositCost]*[GRVItem_Quantity])*(1+[GRVItem_VatRate]/100))) AS depositIncl FROM (aGRV INNER JOIN DayEnd ON aGRV.GRV_DayEndID = DayEnd.DayEndID) INNER JOIN aGRVItem ON aGRV.GRVID = aGRVItem.GRVItem_GRVID Where (((aGRV.GRV_GRVStatusID) = 3)) AND (GRVItem_StockItemQuantity<>0) GROUP BY aGRV.GRVID;")
            //Old

            // not showing Returned VAT   Set rsGRVItem = getRSreport("SELECT aGRV.GRVID, Sum(IIf([GRVItem_Return],0,(((([GRVItem_PackSize]/[GRVItem_StockItemQuantity]*[GRVItem_ContentCost])-[GRVItem_DiscountAmount])*[GRVItem_Quantity])))) AS exclusive, Sum(IIf([GRVItem_Return],0,((((([GRVItem_PackSize]/[GRVItem_StockItemQuantity]*[GRVItem_ContentCost])-[GRVItem_DiscountAmount])*[GRVItem_Quantity])*(1+[GRVItem_VatRate]/100))))) AS inclusive, Sum(IIf([GRVItem_Return],0,[GRVItem_DepositCost]*[GRVItem_Quantity])) AS depositExcl, Sum(IIf([GRVItem_Return],0,([GRVItem_DepositCost]*[GRVItem_Quantity])*(1+[GRVItem_VatRate]/100))) AS depositIncl FROM (aGRV INNER JOIN DayEnd ON aGRV.GRV_DayEndID = DayEnd.DayEndID) LEFT JOIN aGRVItem ON aGRV.GRVID = aGRVItem.GRVItem_GRVID Where (((aGRV.GRV_GRVStatusID) = 3) AND (GRVItem_StockItemQuantity <> 0)) GROUP BY aGRV.GRVID;")
            sql = "SELECT aGRV.GRVID, Sum(IIf([GRVItem_Return],0-(((([GRVItem_PackSize]/[GRVItem_StockItemQuantity]*[GRVItem_ContentCost])-[GRVItem_DiscountAmount])*[GRVItem_Quantity])),(((([GRVItem_PackSize]/[GRVItem_StockItemQuantity]*[GRVItem_ContentCost])-[GRVItem_DiscountAmount])*[GRVItem_Quantity])))) AS exclusive, Sum(IIf([GRVItem_Return],0-((((([GRVItem_PackSize]/[GRVItem_StockItemQuantity]*[GRVItem_ContentCost])-[GRVItem_DiscountAmount])*[GRVItem_Quantity])*(1+[GRVItem_VatRate]/100))),((((([GRVItem_PackSize]/[GRVItem_StockItemQuantity]*[GRVItem_ContentCost])-[GRVItem_DiscountAmount])*[GRVItem_Quantity])*(1+[GRVItem_VatRate]/100))))) AS inclusive, Sum(IIf([GRVItem_Return],0-([GRVItem_DepositCost]*[GRVItem_Quantity]),[GRVItem_DepositCost]*[GRVItem_Quantity])) AS depositExcl, ";
            sql = sql + "Sum(IIf([GRVItem_Return],0-(([GRVItem_DepositCost]*[GRVItem_Quantity])*(1+[GRVItem_VatRate]/100)),([GRVItem_DepositCost]*[GRVItem_Quantity])*(1+[GRVItem_VatRate]/100))) AS depositIncl FROM (aGRV INNER JOIN DayEnd ON aGRV.GRV_DayEndID = DayEnd.DayEndID) ";
            sql = sql + "LEFT JOIN aGRVItem ON aGRV.GRVID = aGRVItem.GRVItem_GRVID Where (((aGRV.GRV_GRVStatusID) = 3) AND (GRVItem_StockItemQuantity <> 0)) GROUP BY aGRV.GRVID;";
            rsGRVItem = modReport.getRSreport(ref sql);
            if (rsGRVItem.BOF | rsGRVItem.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;
            }

            rsGRVItemReturn = modReport.getRSreport(ref "SELECT aGRV.GRVID, Sum(IIf([GRVItem_Return],(((([GRVItem_PackSize]/[GRVItem_StockItemQuantity]*[GRVItem_ContentCost])-[GRVItem_DiscountAmount])*[GRVItem_Quantity])),0)) AS exclusive, Sum(IIf([GRVItem_Return],((((([GRVItem_PackSize]/[GRVItem_StockItemQuantity]*[GRVItem_ContentCost])-[GRVItem_DiscountAmount])*[GRVItem_Quantity])*(1+[GRVItem_VatRate]/100))),0)) AS inclusive, Sum(IIf([GRVItem_Return],[GRVItem_DepositCost]*[GRVItem_Quantity],0)) AS depositExcl, Sum(IIf([GRVItem_Return],([GRVItem_DepositCost]*[GRVItem_Quantity])*(1+[GRVItem_VatRate]/100),0)) AS depositIncl FROM (aGRV INNER JOIN DayEnd ON aGRV.GRV_DayEndID = DayEnd.DayEndID) LEFT JOIN aGRVItem ON aGRV.GRVID = aGRVItem.GRVItem_GRVID Where (((aGRV.GRV_GRVStatusID) = 3)) GROUP BY aGRV.GRVID;");
            if (rsGRVItemReturn.BOF | rsGRVItemReturn.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;
            }

            rsGRVDeposit = modReport.getRSreport(ref "SELECT aGRV.GRVID, Sum(IIf([GRVDeposit_Return],0,(IIf([GRVDeposit_Type]=1 Or [GRVDeposit_Type]=3,[GRVDeposit_Quantity]*([GRVDeposit_CaseQuantity]*[GRVDeposit_UnitCost]*(1+[GRVDeposit_VatRate]/100)),0))+(IIf([GRVDeposit_Type]=2 Or [GRVDeposit_Type]=3,[GRVDeposit_quantity]*([GRVDeposit_CaseCost]*(1+[GRVDeposit_VatRate]/100)),0)))) AS inclusiveDepositReturn, Sum(IIf([GRVDeposit_Return],0,(IIf([GRVDeposit_Type]=1 Or [GRVDeposit_Type]=3,[GRVDeposit_Quantity]*([GRVDeposit_CaseQuantity]*[GRVDeposit_UnitCost]),0))+(IIf([GRVDeposit_Type]=2 Or [GRVDeposit_Type]=3,[GRVDeposit_quantity]*([GRVDeposit_CaseCost]),0)))) AS exclusiveDepositReturn FROM (aGRV LEFT JOIN aGRVDeposit ON aGRV.GRVID = aGRVDeposit.GRVDeposit_GRVID) INNER JOIN DayEnd ON aGRV.GRV_DayEndID = DayEnd.DayEndID Where (((aGRV.GRV_GRVStatusID) = 3)) GROUP BY aGRV.GRVID;");
            if (rsGRVDeposit.BOF | rsGRVDeposit.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;
            }

            rsGRVDepositReturn = modReport.getRSreport(ref "SELECT aGRV.GRVID, Sum(IIf([GRVDeposit_Return],(IIf([GRVDeposit_Type]=1 Or [GRVDeposit_Type]=3,[GRVDeposit_Quantity]*([GRVDeposit_CaseQuantity]*[GRVDeposit_UnitCost]*(1+[GRVDeposit_VatRate]/100)),0))+(IIf([GRVDeposit_Type]=2 Or [GRVDeposit_Type]=3,[GRVDeposit_quantity]*([GRVDeposit_CaseCost]*(1+[GRVDeposit_VatRate]/100)),0)),0)) AS inclusiveDepositReturn, Sum(IIf([GRVDeposit_Return],(IIf([GRVDeposit_Type]=1 Or [GRVDeposit_Type]=3,[GRVDeposit_Quantity]*([GRVDeposit_CaseQuantity]*[GRVDeposit_UnitCost]),0))+(IIf([GRVDeposit_Type]=2 Or [GRVDeposit_Type]=3,[GRVDeposit_quantity]*([GRVDeposit_CaseCost]),0)),0)) AS exclusiveDepositReturn FROM (aGRV LEFT JOIN aGRVDeposit ON aGRV.GRVID = aGRVDeposit.GRVDeposit_GRVID) INNER JOIN DayEnd ON aGRV.GRV_DayEndID = DayEnd.DayEndID Where (((aGRV.GRV_GRVStatusID) = 3)) GROUP BY aGRV.GRVID;");
            if (rsGRVDepositReturn.BOF | rsGRVDepositReturn.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;
            }

            rsGRVMain = modReport.getRSreport(ref "SELECT aGRV.GRVID, aGRV.GRV_InvoiceInclusive, aGRV.GRV_InvoiceVat, aGRV.GRV_InvoiceDiscount, aGRV.GRV_SundriesPlus, aGRV.GRV_SundriesMinus, aGRV.GRV_ContentExclusive, ([GRV_ContentExclusive]*(1+[GRV_Ullage]/100)-[GRV_ContentExclusive]) AS Ullage, (1+[GRV_InvoiceVat]/([GRV_InvoiceInclusive]-[GRV_InvoiceVat])) AS vat, Supplier.SupplierID, Supplier.Supplier_Name, aPurchaseOrder.PurchaseOrder_Reference, aGRV.GRV_InvoiceNumber, aGRV.GRV_InvoiceDate FROM ((aGRV INNER JOIN DayEnd ON aGRV.GRV_DayEndID = DayEnd.DayEndID) INNER JOIN aPurchaseOrder ON aGRV.GRV_PurchaseOrderID = aPurchaseOrder.PurchaseOrderID) INNER JOIN Supplier ON aPurchaseOrder.PurchaseOrder_SupplierID = Supplier.SupplierID WHERE (((aGRV.GRV_GRVStatusID)=3) AND ((aGRV.GRV_InvoiceInclusive)<>0));");
            if (rsGRVMain.BOF | rsGRVMain.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;
            }

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

示例14: report_Gratuity

        private static void report_Gratuity()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            string sql = null;
            //Dim Report As New cryGratuity
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryGratuity.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 [Person_FirstName]+' '+[Person_LastName] AS person_Name, aPOS.POS_Name, Sale.* FROM (Sale INNER JOIN aPerson ON Sale.Sale_PersonID = aPerson.PersonID) INNER JOIN aPOS ON Sale.Sale_PosID = aPOS.POSID Where (((Sale.Sale_Gratuity) <> 0)) ORDER BY Sale.Sale_Gratuity DESC;");
            //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);
            //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

示例15: report_Discount

        private static void report_Discount()
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            string sql = null;
            //Dim Report As New cryDiscount
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryDiscount.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 [Person_FirstName]+' '+[Person_LastName] AS person_Name, aPOS.POS_Name, Sale.* FROM (Sale INNER JOIN aPerson ON Sale.Sale_PersonID = aPerson.PersonID) INNER JOIN aPOS ON Sale.Sale_PosID = aPOS.POSID Where (((Sale.Sale_Discount) <> 0)) ORDER BY Sale.Sale_Discount DESC;");
            //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();
                //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;
            }

            Report.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


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