コード例 #1
0
        //
        // This will be called if the Fast Reports Wrapper loaded OK.
        // Returns True if the data apparently loaded OK and the report should be printed.
        private bool LoadReportData(TRptCalculator ACalc)
        {
            ArrayList reportParam = ACalc.GetParameters().Elems;

            Dictionary <String, TVariant>paramsDictionary = new Dictionary <string, TVariant>();

            foreach (Shared.MReporting.TParameter p in reportParam)
            {
                if (p.name.StartsWith("param") && (p.name != "param_calculation") && (!paramsDictionary.ContainsKey(p.name)))
                {
                    paramsDictionary.Add(p.name, p.value);
                }
            }

            Int32 ParamNestingDepth = 6;
            String DepthOption = paramsDictionary["param_depth"].ToString();

            if (DepthOption == "standard")
            {
                ParamNestingDepth = 3;
            }

            paramsDictionary.Add("param_nesting_depth", new TVariant(ParamNestingDepth));
            String RootCostCentre = "[" + FLedgerNumber + "]";
            paramsDictionary.Add("param_cost_centre_code", new TVariant(RootCostCentre));

            //
            // The table contains extra rows for "headers" and "footers", facilitating the hierarchical printout.

            DataTable ReportTable = TRemote.MReporting.WebConnectors.GetReportDataTable("BalanceSheet", paramsDictionary);

            if (this.IsDisposed)
            {
                return false;
            }

            if (ReportTable == null)
            {
                FPetraUtilsObject.WriteToStatusBar("Report Cancelled.");
                return false;
            }

            FPetraUtilsObject.FFastReportsPlugin.RegisterData(ReportTable, "BalanceSheet");

            //
            // I need to get the name of the current ledger..

            DataTable LedgerNameTable = TDataCache.TMFinance.GetCacheableFinanceTable(TCacheableFinanceTablesEnum.LedgerNameList);
            DataView LedgerView = new DataView(LedgerNameTable);
            LedgerView.RowFilter = "LedgerNumber=" + FLedgerNumber;
            String LedgerName = "";

            if (LedgerView.Count > 0)
            {
                LedgerName = LedgerView[0].Row["LedgerName"].ToString();
            }

            ACalc.AddStringParameter("param_ledger_name", LedgerName);
            return true;
        }
コード例 #2
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_recipientkey", txtRecipient.Text);
            ACalc.AddParameter("param_extract_name", txtExtract.Text);

            if (dtpToDate.Date.HasValue)
            {
                Int32 ToDateYear = dtpToDate.Date.Value.Year;
                //TODO: Calendar vs Financial Date Handling - Confirm that these should not be ledger dates, i.e. allowing for >12 periods and non-calendar period boundaries
                DateTime FromDateThisYear = new DateTime(ToDateYear, 1, 1);
                DateTime ToDatePreviousYear = new DateTime(ToDateYear - 1, 12, 31);
                DateTime FromDatePreviousYear = new DateTime(ToDateYear - 1, 1, 1);

                ACalc.AddParameter("param_from_date_this_year", FromDateThisYear);
                ACalc.AddParameter("param_to_date_previous_year", ToDatePreviousYear);
                ACalc.AddParameter("param_from_date_previous_year", FromDatePreviousYear);
            }

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Gift Amount")
                {
                    ACalc.AddParameter("param_gift_amount_column", Counter);
                }
            }
        }
コード例 #3
0
 /// <summary>
 /// Reads the selected values from the controls, and stores them into the parameter system of FCalculator
 /// </summary>
 /// <param name="ACalc"></param>
 /// <param name="AReportAction"></param>
 public void ReadControls(TRptCalculator ACalc, TReportActionEnum AReportAction)
 {
     ACalc.AddParameter("param_active", this.chkActivePartners.Checked);
     ACalc.AddParameter("param_mailing_addresses_only", this.chkMailingAddressesOnly.Checked);
     ACalc.AddParameter("param_families_only", this.chkFamiliesOnly.Checked);
     ACalc.AddParameter("param_exclude_no_solicitations", this.chkExcludeNoSolicitations.Checked);
 }
コード例 #4
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_currency", "base");
            ACalc.AddParameter("param_ytd", "mixed");
            ACalc.AddParameter("param_depth", "standard");

            ACalc.AddParameter("param_calculation", "Amount", 0);
            ACalc.AddParameter("param_ytd", false, 0);
            ACalc.AddParameter("ColumnWidth", "2", 0);
            ACalc.AddParameter("ColumnPositionIndented", (float)0.5, 0);

            ACalc.AddParameter("param_calculation", "% of Grand Income", 1);
            ACalc.AddParameter("FirstColumn", 0, 1);
            ACalc.AddParameter("param_ytd", false, 1);
            ACalc.AddParameter("ColumnWidth", "2", 1);
            ACalc.AddParameter("ColumnPositionIndented", (float)0.5, 1);

            ACalc.AddParameter("param_calculation", "AmountYTD", 2);
            ACalc.AddParameter("param_ytd", true, 2);
            ACalc.AddParameter("ColumnWidth", 2, 2);
            ACalc.AddParameter("ColumnPositionIndented", (float)0.5, 2);

            ACalc.AddParameter("param_calculation", "% of Grand Income", 3);
            ACalc.AddParameter("FirstColumn", 2, 3);
            ACalc.AddParameter("param_ytd", true, 3);
            ACalc.AddParameter("ColumnWidth", 2, 3);
            ACalc.AddParameter("ColumnPositionIndented", (float)0.5, 3);

            ACalc.AddParameter("MaxDisplayColumns", 4);
        }
コード例 #5
0
 private void tpgGroups_ReadControls(TRptCalculator ACalc, TReportActionEnum AReportAction)
 {
     if (rbtAllGroups.Checked && rbtParticipantsIgnoreAll.Checked)
     {
         rbtParticipantsAll.Checked = true;
     }
 }
コード例 #6
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_extract_name", txtExtract.Text);

            if ((AReportAction == TReportActionEnum.raGenerate)
                && rbtExtract.Checked
                && (txtExtract.Text.Length == 0))
            {
                TVerificationResult VerificationResult = new TVerificationResult(
                    Catalog.GetString("No recipient selected."),
                    Catalog.GetString("Please select a recipient."),
                    TResultSeverity.Resv_Critical);

                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Gift Amount")
                {
                    ACalc.AddParameter("param_gift_amount_column", Counter);
                }
            }
        }
コード例 #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ACalculator"></param>
        /// <param name="AReportAction"></param>
        private void ReadControlsManual(TRptCalculator ACalculator, TReportActionEnum AReportAction)
        {
            int ColumnCounter = 0;
            double ColumnPosition = 0;
            String SpecialValues = "County,Donors,ExParticipants,Churches,Applicants";

            // Get the columns
            List <KeyValuePair <String, Double>>ColumnDefinitions = ucoReportColumns.GetColumnHeadings();

            // store the column values in ACalculator
            foreach (KeyValuePair <String, Double>ColumnDefinition in ColumnDefinitions)
            {
                String ColumnType = "Publication";

                if (SpecialValues.Contains(ColumnDefinition.Key))
                {
                    // the column is one of the special columns County, Donors, ExParticipants, Churches or Applicants
                    ColumnType = ColumnDefinition.Key;
                }

                if (AReportAction == TReportActionEnum.raGenerate)
                {
                    // Add these only to the calculator if we generate the report. Not used
                    // when the report is saved.
                    ACalculator.AddParameter("param_calculation", ColumnType, ColumnCounter);
                    ACalculator.AddParameter("param_label", ColumnType, ColumnCounter);
                    ACalculator.AddParameter("ColumnAlign", "left", ColumnCounter);
                    ACalculator.AddParameter("ColumnCaption", ColumnDefinition.Key, ColumnCounter);
                    ACalculator.AddParameter("ColumnPosition", ColumnPosition.ToString(), ColumnCounter);
                }

                ++ColumnCounter;
                ColumnPosition += ColumnDefinition.Value;
            }
        }
コード例 #8
0
        //
        // This will be called if the Fast Reports Wrapper loaded OK.
        // Returns True if the data apparently loaded OK and the report should be printed.
        private bool LoadReportData(TRptCalculator ACalc)
        {
            ArrayList reportParam = ACalc.GetParameters().Elems;

            Dictionary <String, TVariant>paramsDictionary = new Dictionary <string, TVariant>();

            foreach (Shared.MReporting.TParameter p in reportParam)
            {
                if (p.name.StartsWith("param") && (p.name != "param_calculation") && (!paramsDictionary.ContainsKey(p.name)))
                {
                    paramsDictionary.Add(p.name, p.value);
                }
            }

            String RootCostCentre = "[" + FLedgerNumber + "]";
            paramsDictionary.Add("param_cost_centre_code", new TVariant(RootCostCentre));

            DataTable ReportTable = TRemote.MReporting.WebConnectors.GetReportDataTable("SurplusDeficit", paramsDictionary);

            if (ReportTable == null)
            {
                FPetraUtilsObject.WriteToStatusBar("Report Cancelled.");
                return false;
            }

            FPetraUtilsObject.FFastReportsPlugin.RegisterData(ReportTable, "SurplusDeficit");

            String LedgerName = TRemote.MFinance.Reporting.WebConnectors.GetLedgerName(FLedgerNumber);

            ACalc.AddStringParameter("param_ledger_name", LedgerName);

            return true;
        }
コード例 #9
0
        //
        // This will be called if the Fast Reports Wrapper loaded OK.
        // Returns True if the data apparently loaded OK and the report should be printed.
        private bool LoadReportData(TRptCalculator ACalc)
        {
            ArrayList reportParam = ACalc.GetParameters().Elems;

            Dictionary <String, TVariant>paramsDictionary = new Dictionary <string, TVariant>();

            foreach (Shared.MReporting.TParameter p in reportParam)
            {
                if (p.name.StartsWith("param") && (p.name != "param_calculation") && (!paramsDictionary.ContainsKey(p.name)))
                {
                    paramsDictionary.Add(p.name, p.value);
                }
            }

            DataTable ReportTable = TRemote.MReporting.WebConnectors.GetReportDataTable("GiftBatchDetail", paramsDictionary);

            if (this.IsDisposed) // There's no cancel function as such - if the user has pressed Esc the form is closed!
            {
                return false;
            }

            if (ReportTable == null)
            {
                FPetraUtilsObject.WriteToStatusBar("Report Cancelled.");
                return false;
            }

            FPetraUtilsObject.FFastReportsPlugin.RegisterData(ReportTable, "GiftBatchDetail");

            //
            // I need to get the name of the current ledger..

            DataTable LedgerNameTable = TDataCache.TMFinance.GetCacheableFinanceTable(TCacheableFinanceTablesEnum.LedgerNameList);
            DataView LedgerView = new DataView(LedgerNameTable);
            LedgerView.RowFilter = "LedgerNumber=" + FLedgerNumber;
            String LedgerName = "";

            if (LedgerView.Count > 0)
            {
                LedgerName = LedgerView[0].Row["LedgerName"].ToString();
            }

            ACalc.AddStringParameter("param_ledger_name", LedgerName);
            ACalc.AddStringParameter("param_linked_partner_cc", ""); // I may want to use this for auto_email, but usually it's unused.

            bool TaxDeductiblePercentageEnabled = Convert.ToBoolean(
                TSystemDefaults.GetSystemDefault(SharedConstants.SYSDEFAULT_TAXDEDUCTIBLEPERCENTAGE, "FALSE"));

            ACalc.AddParameter("param_tax_deductible_pct", TaxDeductiblePercentageEnabled);

            if (ACalc.GetParameters().Exists("param_currency")
                && (ACalc.GetParameters().Get("param_currency").ToString() == Catalog.GetString("Transaction")))
            {
                ACalc.RemoveParameter("param_currency_name");
                ACalc.AddParameter("param_currency_name",
                    TRemote.MFinance.Reporting.WebConnectors.GetTransactionCurrency(FLedgerNumber, Convert.ToInt32(txtBatchNumber.Text)));
            }

            return true;
        }
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if ((AReportAction == TReportActionEnum.raGenerate)
                && (rbtPartner.Checked && (txtRecipient.Text == "0000000000")))
            {
                TVerificationResult VerificationResult = new TVerificationResult(
                    Catalog.GetString("No recipient selected."),
                    Catalog.GetString("Please select a recipient."),
                    TResultSeverity.Resv_Critical);

                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }

            if ((AReportAction == TReportActionEnum.raGenerate)
                && rbtExtract.Checked
                && (txtExtract.Text == ""))
            {
                TVerificationResult VerificationMessage = new TVerificationResult(
                    Catalog.GetString("Enter an extract name."),
                    Catalog.GetString("No extract name entered!"), TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationMessage);
            }

            ACalc.AddParameter("param_recipient_key", txtRecipient.Text);
            ACalc.AddParameter("param_extract_name", txtExtract.Text);
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
        }
コード例 #11
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_recipientkey", txtRecipient.Text);
            ACalc.AddParameter("param_extract_name", txtExtract.Text);

            if (dtpToDate.Date.HasValue)
            {
                Int32 ToDateYear = dtpToDate.Date.Value.Year;
                DateTime FromDateThisYear = new DateTime(ToDateYear, 1, 1);
                DateTime ToDatePreviousYear = new DateTime(ToDateYear - 1, 12, 31);
                DateTime FromDatePreviousYear = new DateTime(ToDateYear - 1, 1, 1);

                ACalc.AddParameter("param_from_date_this_year", FromDateThisYear);
                ACalc.AddParameter("param_to_date_previous_year", ToDatePreviousYear);
                ACalc.AddParameter("param_from_date_previous_year", FromDatePreviousYear);
            }

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Gift Amount")
                {
                    ACalc.AddParameter("param_gift_amount_column", Counter);
                }
            }
        }
コード例 #12
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            int ColumnCounter = 0;

            ACalc.AddParameter("param_calculation", "Code", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "2", ColumnCounter);
            ColumnCounter++;
            ACalc.AddParameter("param_calculation", "Total", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "2", ColumnCounter);
            ColumnCounter++;
            ACalc.AddParameter("param_calculation", "Female", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "2", ColumnCounter);
            ColumnCounter++;
            ACalc.AddParameter("param_calculation", "Male", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "2", ColumnCounter);
            ColumnCounter++;
            ACalc.AddParameter("param_calculation", "Couple", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "2", ColumnCounter);
            ColumnCounter++;
            ACalc.AddParameter("param_calculation", "Family", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "2", ColumnCounter);
            ColumnCounter++;

            ACalc.AddParameter("MaxDisplayColumns", ColumnCounter);
        }
コード例 #13
0
        private void grdStatuses_ReadControls(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            String DocumentTypeList = "";

            foreach (DataRow Row in FCommitmentStatusTable.Rows)
            {
                if ((Row["Selection"].GetType() == Type.GetType("System.Boolean"))
                    && ((bool)Row["Selection"]))
                {
                    DocumentTypeList = DocumentTypeList + (String)Row[PmCommitmentStatusTable.GetCodeDBName()] + ',';
                }
            }

            if (DocumentTypeList.Length > 0)
            {
                // Remove the last comma
                DocumentTypeList = DocumentTypeList.Remove(DocumentTypeList.Length - 1, 1);
                ACalc.AddParameter("param_commitmentstatuses", DocumentTypeList);
            }
            else if ((AReportAction == TReportActionEnum.raGenerate)
                     && (chkSelectedStatus.Checked)
                     && (!chkNoSelectedStatus.Checked))
            {
                // at least one commitment status must be checked
                TVerificationResult VerificationResult = new TVerificationResult("Select at least one commitment status.",
                    "No commitment status selected!",
                    TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }
        }
コード例 #14
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            int ColumnCounter = 0;

            // Add the columns to the report
            ACalc.AddParameter("param_calculation", "Nationalities", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "5", ColumnCounter);
            ColumnCounter++;
            ACalc.AddParameter("param_calculation", "Total", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)1.5, ColumnCounter);
            ColumnCounter++;
            ACalc.AddParameter("param_calculation", "Female", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)1.5, ColumnCounter);
            ColumnCounter++;
            ACalc.AddParameter("param_calculation", "Male", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)1.4, ColumnCounter);
            ColumnCounter++;
            ACalc.AddParameter("param_calculation", "Other", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)1.5, ColumnCounter);
            ColumnCounter++;
            ACalc.AddParameter("param_calculation", "Languages", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", "8", ColumnCounter);
            ColumnCounter++;

            ACalc.AddParameter("MaxDisplayColumns", ColumnCounter);
        }
コード例 #15
0
        /// <summary>
        /// read the values from the controls and give them to the calculator
        /// </summary>
        /// <param name="ACalculator"></param>
        /// <param name="AReportAction"></param>
        public void ReadControls(TRptCalculator ACalculator, TReportActionEnum AReportAction)
        {
            if (rbtPartner.Checked)
            {
                ACalculator.AddParameter("param_selection", "one partner");
            }
            else if (rbtExtract.Checked)
            {
                ACalculator.AddParameter("param_selection", "an extract");
            }

            ACalculator.AddParameter("param_extract", txtExtract.Text);
            ACalculator.AddParameter("param_partnerkey", txtPartnerKey.Text);

            if ((AReportAction == TReportActionEnum.raGenerate)
                && rbtPartner.Checked
                && (txtPartnerKey.Text == "0000000000"))
            {
                TVerificationResult VerificationMessage = new TVerificationResult(
                    Catalog.GetString("Enter a valid Partner Key."),
                    Catalog.GetString("No Partner Key entered!"),
                    TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationMessage);
            }

            if ((AReportAction == TReportActionEnum.raGenerate)
                && rbtExtract.Checked
                && (txtExtract.Text == ""))
            {
                TVerificationResult VerificationMessage = new TVerificationResult(
                    Catalog.GetString("Enter an extract name."),
                    Catalog.GetString("No extract name entered!"), TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationMessage);
            }
        }
コード例 #16
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            ACalc.AddParameter("param_all_partners", rbtAllPartners.Checked);
            ACalc.AddParameter("param_extract", rbtExtract.Checked);

            if (rbtExtract.Checked)
            {
                ACalc.AddParameter("param_extract_name", txtExtract.Text);
            }

            if ((txtThisYear.Text != "0")
                && (txtLastYear.Text != "0"))
            {
                int LastYear = Convert.ToInt32(txtLastYear.Text);
                int ThisYear = Convert.ToInt32(txtThisYear.Text);

                if (LastYear >= ThisYear)
                {
                    TVerificationResult VerificationResult = new TVerificationResult(
                        Catalog.GetString("Wrong year entered."),
                        Catalog.GetString("'Gift given in year' must be less than 'No gifts in year'"),
                        TResultSeverity.Resv_Critical);
                    FPetraUtilsObject.AddVerificationResult(VerificationResult);
                }

                //TODO: Calendar vs Financial Date Handling - Confirm if year end is assumed wrongly, i.e. financial year end does not necessarily = calendar year end
                ACalc.AddParameter("param_this_year_start_date", new DateTime(ThisYear, 1, 1));
                ACalc.AddParameter("param_this_year_end_date", new DateTime(ThisYear, 12, 31));
                ACalc.AddParameter("param_last_year_start_date", new DateTime(LastYear - 1, 1, 1));
                ACalc.AddParameter("param_last_year_end_date", new DateTime(LastYear - 1, 12, 31));
            }
        }
コード例 #17
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if ((AReportAction == TReportActionEnum.raGenerate)
                && (dtpFromDate.Date > dtpToDate.Date))
            {
                TVerificationResult VerificationResult = new TVerificationResult(
                    Catalog.GetString("From date is later than to date."),
                    Catalog.GetString("Please change from date or to date."),
                    TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }

            ACalc.AddParameter("param_currency", "Base");
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            // Set the values for accumulating the costs to 0
            ACalc.AddParameter("CostCentreCredit", 0);
            ACalc.AddParameter("CostCentreDebit", 0);
            ACalc.AddParameter("AccountCodeCredit", 0);
            ACalc.AddParameter("AccountCodeDebit", 0);
            ACalc.AddParameter("TotalCredit", 0);
            ACalc.AddParameter("TotalDebit", 0);

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            // we need to know some indices of the columns
            for (int Counter = 0; Counter < MaxColumns; ++Counter)
            {
                String ColumnName = "param_column_" + ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();
                ACalc.AddParameter(ColumnName, Counter);
            }
        }
コード例 #18
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if ((AReportAction == TReportActionEnum.raGenerate)
                && (dtpFromDate.Date > dtpToDate.Date))
            {
                TVerificationResult VerificationResult = new TVerificationResult(
                    Catalog.GetString("From date is later than to date."),
                    Catalog.GetString("Please change from date or to date."),
                    TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationResult);
            }

            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("TransactionCount", 0);
            ACalc.AddParameter("TransactionCountAccount", 0);
            ACalc.AddParameter("SumDebitAccount", 0);
            ACalc.AddParameter("SumCreditAccount", 0);

            int MaxColumns = ACalc.GetParameters().Get("MaxDisplayColumns").ToInt();

            for (int Counter = 0; Counter <= MaxColumns; ++Counter)
            {
                String ColumnName = ACalc.GetParameters().Get("param_calculation", Counter, 0).ToString();

                if (ColumnName == "Debits")
                {
                    ACalc.AddParameter("param_debit_column", Counter);
                }

                if (ColumnName == "Credits")
                {
                    ACalc.AddParameter("param_credit_column", Counter);
                }
            }
        }
コード例 #19
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            int MinAge = Convert.ToInt32(txtFromYears.Text);     // 0
            int MaxAge = Convert.ToInt32(txtToYears.Text);     // 17
            DateTime EarliestBirthday;
            DateTime LatestBirthday;

            DateTime StartDate = DateTime.Today;
            DateTime EndDate = DateTime.Today;
            DateTime EarliestArrivalDate = DateTime.Today;
            DateTime LatestDepartureDate = DateTime.Today;
            bool IsSuccessful;

            if (ucoConferenceSelection.AllConferenceSelected)
            {
                IsSuccessful = TRemote.MConference.WebConnectors.GetEarliestAndLatestDate(-1,
                    out EarliestArrivalDate, out LatestDepartureDate, out StartDate, out EndDate);
            }
            else
            {
                long ConferenceKey = Convert.ToInt64(ucoConferenceSelection.ConferenceKey);

                IsSuccessful = TRemote.MConference.WebConnectors.GetEarliestAndLatestDate(ConferenceKey,
                    out EarliestArrivalDate, out LatestDepartureDate, out StartDate, out EndDate);
            }

            if (IsSuccessful)
            {
                EarliestBirthday = StartDate.AddYears(-MaxAge - 1);
                LatestBirthday = EndDate.AddYears(-MinAge);

                ACalc.AddParameter("param_earliest_birthday", EarliestBirthday.Date);
                ACalc.AddParameter("param_latest_birthday", LatestBirthday.Date);
            }
        }
コード例 #20
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("ControlSource", "", ReportingConsts.HEADERCOLUMN);

            // TODO: If you want to export only the lines with relevant data and not the higher level lines
            // in csv export then enable this line
            // ACalc.AddParameter("csv_export_only_lowest_level", true);
        }
コード例 #21
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            if ((AReportAction == TReportActionEnum.raGenerate)
                && (clbFields.GetCheckedStringList().Length == 0))
            {
                TVerificationResult VerificationMessage = new TVerificationResult(
                    Catalog.GetString("Please select at least one field."),
                    Catalog.GetString("No fields selected!"), TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationMessage);
            }

            int Years = Convert.ToInt16(txtYears.Text);

            if ((AReportAction == TReportActionEnum.raGenerate)
                && ((Years > 4) || (Years < 1)))
            {
                TVerificationResult VerificationMessage = new TVerificationResult(
                    Catalog.GetString("Set the year range between 1 and 4"),
                    Catalog.GetString("Wrong year range entered"), TResultSeverity.Resv_Critical);
                FPetraUtilsObject.AddVerificationResult(VerificationMessage);
            }

            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            ACalc.AddParameter("Year0", DateTime.Today.Year);
            ACalc.AddParameter("param_Year0", DateTime.Today.Year);
            ACalc.AddParameter("Year3", DateTime.Today.Year - 3);

            ACalc.AddParameter("Month0", 1);
            ACalc.AddParameter("Month1", 2);
            ACalc.AddParameter("MonthCombined", 0);
            ACalc.AddParameter("CountCombined", 0);

            int ColumnCounter = 0;
            ACalc.AddParameter("param_calculation", "Month", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)4, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "AmountWorker", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)3.0, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "CountWorker", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)1, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "AmountField", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)3.0, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "CountField", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)1, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "AmountCombined", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)3.0, ColumnCounter);
            ++ColumnCounter;
            ACalc.AddParameter("param_calculation", "CountCombined", ColumnCounter);
            ACalc.AddParameter("ColumnWidth", (float)1, ColumnCounter);
            ++ColumnCounter;

            ACalc.SetMaxDisplayColumns(ColumnCounter);
        }
コード例 #22
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            ACalc.AddParameter("param_cost_centre_breakdown", false);
            ACalc.AddParameter("param_cost_centre_summary", false);
            ACalc.AddParameter("param_cost_centre_codes", "");
            ACalc.AddParameter("param_costcentreoptions", "AccountLevel");
        }
コード例 #23
0
        //
        // This will be called if the Fast Reports Wrapper loaded OK.
        // Returns True if the data apparently loaded OK and the report should be printed.
        private bool LoadReportData(TRptCalculator ACalc)
        {
            ArrayList reportParam = ACalc.GetParameters().Elems;

            Dictionary <String, TVariant>paramsDictionary = new Dictionary <string, TVariant>();

            foreach (Shared.MReporting.TParameter p in reportParam)
            {
                if (p.name.StartsWith("param") && (p.name != "param_calculation") && (!paramsDictionary.ContainsKey(p.name)))
                {
                    paramsDictionary.Add(p.name, p.value);
                }
            }

            String RootCostCentre = "[" + FLedgerNumber + "]";
            paramsDictionary.Add("param_cost_centre_code", new TVariant(RootCostCentre));

            DataTable ReportTable = TRemote.MReporting.WebConnectors.GetReportDataTable("TrialBalance", paramsDictionary);

            if (ReportTable == null)
            {
                FPetraUtilsObject.WriteToStatusBar("Report Cancelled.");
                return false;
            }

            FPetraUtilsObject.FFastReportsPlugin.RegisterData(ReportTable, "TrialBalance");

            //
            // I need to get the name of the current ledger..

            ALedgerTable LedgerTbl = TRemote.MFinance.AP.WebConnectors.GetLedgerInfo(FLedgerNumber);

            String LedgerName = "";
            Boolean IsClosed = false;

            if (LedgerTbl.Rows.Count > 0)
            {
                ALedgerRow LedgerRow = LedgerTbl[0];
                LedgerName = LedgerRow.LedgerName;
                //
                // I want to tell the user whether the selected period is closed
                // (although they probably know already...)
                Int32 SelPeriod = ACalc.GetParameters().GetParameter("param_end_period_i").value.ToInt32();
                Int32 SelYear = ACalc.GetParameters().GetParameter("param_year_i").value.ToInt32();

                if ((SelYear < LedgerRow.CurrentFinancialYear) || (SelPeriod < LedgerRow.CurrentPeriod))
                {
                    IsClosed = true;
                }
            }

            ACalc.AddStringParameter("param_ledger_name", LedgerName);
            ACalc.AddParameter("param_period_closed", IsClosed);

            return true;
        }
コード例 #24
0
 private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
 {
     ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
     ACalc.AddParameter("param_with_analysis_attributes", true);
     ACalc.AddColumnLayout(6, 23, 0, 3);
     ACalc.AddColumnLayout(7, 26, 0, 3);
     ACalc.SetMaxDisplayColumns(8);
     ACalc.AddColumnCalculation(6, "AnalysisType");
     ACalc.AddColumnCalculation(7, "AnalysisValue");
 }
コード例 #25
0
ファイル: AFO.ManualCode.cs プロジェクト: js1987/openpetragit
 private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
 {
     ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
     ACalc.AddColumnLayout(0, 8, 0, 3);
     ACalc.AddColumnLayout(1, 11, 0, 3);
     ACalc.AddColumnLayout(2, 14, 0, 7);
     ACalc.SetMaxDisplayColumns(3);
     ACalc.AddColumnCalculation(0, "Debit");
     ACalc.AddColumnCalculation(1, "Credit");
     ACalc.AddParameter("param_daterange", "false");
 }
コード例 #26
0
 private void ReadControlsVerify(TRptCalculator ACalc, TReportActionEnum AReportAction)
 {
     //if (true)
     //{
     //    TVerificationResult VerificationResult = new TVerificationResult(
     //        Catalog.GetString("Please enter some criteria."),
     //        Catalog.GetString("No criteria added!"),
     //        TResultSeverity.Resv_Critical);
     //    FPetraUtilsObject.AddVerificationResult(VerificationResult);
     //}
 }
コード例 #27
0
 private void ReadControlsVerify(TRptCalculator ACalc, TReportActionEnum AReportAction)
 {
     if (!FDirectRelationshipTable.Select(FDirectRelationshipTable.DefaultView.RowFilter).Any(r => (bool)r["Selection"])
         && !FReciprocalRelationshipTable.Select(FReciprocalRelationshipTable.DefaultView.RowFilter).Any(r => (bool)r["Selection"]))
     {
         TVerificationResult VerificationResult = new TVerificationResult(
             Catalog.GetString("Select at least one Relationship Type to run the report."),
             Catalog.GetString("No Relationship Type selected!"),
             TResultSeverity.Resv_Critical);
         FPetraUtilsObject.AddVerificationResult(VerificationResult);
     }
 }
コード例 #28
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);

            ACalc.AddParameter("param_quarter", false);
            ACalc.AddParameter("param_start_period_i", 1);
            ACalc.AddParameter("param_end_period_i", 12);
            ACalc.AddParameter("param_ytd", true);
            ACalc.AddParameter("param_multiperiod", true);
            ACalc.AddParameter("ColumnWidth", 1.4, 0);
            ACalc.AddParameter("ColumnPositionIndented", 0.3, 0);
        }
コード例 #29
0
        private void ReadControlsManual(TRptCalculator ACalc, TReportActionEnum AReportAction)
        {
            ACalc.AddParameter("param_ledger_number_i", FLedgerNumber);
            ACalc.AddParameter("param_with_analysis_attributes", false);

            // if rbtSortByCostCentre is checked then these parameters are added in generated code
            if (!rbtSortByCostCentre.Checked)
            {
                ACalc.AddParameter("param_paginate", false);
                ACalc.AddParameter("param_auto_email", false);
            }
        }
コード例 #30
0
 private void ReadControlsVerify(TRptCalculator ACalc, TReportActionEnum AReportAction)
 {
     if ((txtThisYear.Text == "0")
         || (txtLastYear.Text == "0"))
     {
         TVerificationResult VerificationResult = new TVerificationResult(
             Catalog.GetString("No valid year entered."),
             Catalog.GetString("Please enter a valid year."),
             TResultSeverity.Resv_Critical);
         FPetraUtilsObject.AddVerificationResult(VerificationResult);
     }
 }