예제 #1
0
        /// <summary>
        /// Called during loading of the form
        /// Adds the available labels to the Selection box.
        /// </summary>
        private void SetLocalDataLabels()
        {
            double             widthInCm;
            PDataLabelTable    DataLabels;
            PDataLabelUseTable DataLabelUse;

            DataRow[] filteredRows;

            DataLabels   = (PDataLabelTable)TDataCache.TMPartner.GetCacheablePartnerTable(TCacheablePartnerTablesEnum.DataLabelList);
            DataLabelUse = (PDataLabelUseTable)TDataCache.TMPartner.GetCacheablePartnerTable(TCacheablePartnerTablesEnum.DataLabelUseList);

            foreach (PDataLabelUseRow UseRow in DataLabelUse.Rows)
            {
                if ((UseRow.Use == "Bank") ||
                    (UseRow.Use == "Church") ||
                    (UseRow.Use == "Family") ||
                    (UseRow.Use == "Organisation") ||
                    (UseRow.Use == "Person") ||
                    (UseRow.Use == "Unit") ||
                    (UseRow.Use == "Venue"))
                {
                    filteredRows = DataLabels.Select(PDataLabelTable.GetKeyDBName() + " = " + UseRow.DataLabelKey.ToString());

                    if (filteredRows.Length > 0)
                    {
                        PDataLabelRow row = (PDataLabelRow)filteredRows[0];

                        if (row.DataType == "char")
                        {
                            widthInCm = TPartnerColumnFunction.CharLengthToCM(row.CharLength);
                        }
                        else if (row.DataType == "partnerkey")
                        {
                            widthInCm = TPartnerColumnFunction.CharLengthToCM(10);
                        }
                        else if (row.DataType == "lookup")
                        {
                            widthInCm = TPartnerColumnFunction.CharLengthToCM(14);
                        }
                        else if (row.DataType == "boolean")
                        {
                            widthInCm = TPartnerColumnFunction.CharLengthToCM(5);
                        }
                        else
                        {
                            widthInCm = TPartnerColumnFunction.CharLengthToCM(10);
                        }

                        /* minimum width of column, so that the caption can be displayed (with a footnote number if necessary) */
                        if (widthInCm < 1.5)
                        {
                            widthInCm = 1.5;
                        }

                        FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("DataLabelColumn", "param_label", row.Text, widthInCm)); //FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction(row.Text, "param_label",
                                                                                                                                                   // "DataLabelColumn", widthInCm));
                    }
                }
            }
        }
        private void InitializeManualCode()
        {
            FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("County", 3.0));
            FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("Donors", 2.5));
            FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("ExParticipants", 2.5));
            FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("Churches", 2.5));
            FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("Applicants", 2.5));

            ucoReportColumns.SetAvailableFunctions(FPetraUtilsObject.GetAvailableFunctions());
            ucoReportColumns.FillColumnGrid();

            InitializePublicationCodeList();
        }
        /// <summary>
        /// Called during loading of the form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void TFrmPublicationStatisticalReport_Load(object sender, EventArgs e)
        {
            FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("County", 3.0));
            FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("Donors", 2.5));
            FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("ExParticipants", 2.5));
            FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("Churches", 2.5));
            FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction("Applicants", 2.5));

            String    PublicationCodeDBName = Ict.Petra.Shared.MPartner.Mailroom.Data.PPublicationTable.GetPublicationCodeDBName();
            DataTable SubscriptionTable     = TDataCache.TMPartner.GetCacheableSubscriptionsTable(
                Ict.Petra.Shared.TCacheableSubscriptionsTablesEnum.PublicationList);

            foreach (DataRow row in SubscriptionTable.Rows)
            {
                String CurrentPublication = (String)row[PublicationCodeDBName];
                FPetraUtilsObject.AddAvailableFunction(new TPartnerColumnFunction(CurrentPublication, 2.8));
            }

            ucoReportColumns.SetAvailableFunctions(FPetraUtilsObject.GetAvailableFunctions());
            ucoReportColumns.FillColumnGrid();
        }