public void InstantiateIn(System.Web.UI.Control container)
        {
            // Create the content for the different row types.
            switch (templateType)
            {
            case DataControlRowType.Header:
                // Create the controls to put in the header  section and set their properties.
                Literal lc = new Literal();
                lc.Text = "<b>" + columnName + "</b>";

                // Add the controls to the Controls collection of the container.
                container.Controls.Add(lc);
                break;

            case DataControlRowType.DataRow:
                xDetail = new CffGridView();
                xDetail.InsertDataColumn("Created");
                xDetail.InsertMemoColumn("Comment", "Comment");

                // To support data binding, register the event-handling methods to perform the data binding. Each control needs its own event handler.
                xDetail.DataBinding += new EventHandler(this.xDetail_DataBinding);     //lastName.DataBinding += new EventHandler(this.field_DataBinding);

                // Add the controls to the Controls collection  of the container.
                container.Controls.Add(xDetail);     //container.Controls.Add(field);
                break;

            case DataControlRowType.Footer:
                break;

            //Insert cases to create the content for the other row types, if desired.
            default:
                // Insert code to handle unexpected values.
                break;
            }
        }
예제 #2
0
        public AgedBalancesNotesDetailRowTemplate(object dataSource, string strKFieldName)
        {
            this.dataSource     = dataSource;
            this.currentRow     = 0;
            this.dtKeyFieldName = strKFieldName;
            detailGridView      = new CffGridView();
            detailGridView.SettingsDetail.IsDetailGrid = true;
            detailGridView.KeyFieldName = this.dtKeyFieldName;

            detailGridView.EnableCallBacks = false;
            detailGridView.InsertDataColumn("CreatedByEmployeeName", "Created By", 80);
            detailGridView.InsertDataColumn("Created", "Created", 80);

            GridViewDataMemoColumn column = new GridViewDataMemoColumn();

            column.Caption      = "Comment";
            column.FieldName    = "Comment";
            column.Width        = Unit.Pixel(300);
            column.VisibleIndex = detailGridView.Columns.Count;
            column.CellStyle.HorizontalAlign = HorizontalAlign.Justify;
            column.CellStyle.Wrap            = DevExpress.Web.ASPxClasses.DefaultBoolean.True;
            column.EditCellStyle.Wrap        = DevExpress.Web.ASPxClasses.DefaultBoolean.True;
            column.ReadOnly = true;
            detailGridView.Columns.Add(column);

            detailGridView.Enabled = false;
        }
        public LinkDecorator(CffGridView grid, CallbackParameter parameter, WebControl link, ISecurityManager securityManager)
        {
            ArgumentChecker.ThrowIfNullOrEmpty(grid.ClientInstanceName, "grid");

            this.grid            = grid;
            this.parameter       = parameter;
            this.link            = link;
            this.securityManager = securityManager;
        }
예제 #4
0
        void detailGridView_DataBinding(object sender, EventArgs e)
        { //Template
            CffGridView masterGrid = sender as CffGridView;
            object      kVal       = masterGrid.GetMasterRowKeyValue();

            AgedBalancesReportRecord dRow = masterGrid.GetRow(masterGrid.CurrentFocusedRow) as AgedBalancesReportRecord;

            if (dRow != null)
            {
                detailGridView.DataSource = dRow.CustNoteList;
            }

            //IList<AgedBalancesReportRecord> xABR = dataSource as IList<AgedBalancesReportRecord>;
            //detailGridView.DataSource = (xABR[0] as AgedBalancesReportRecord).CustNoteList;
        }
예제 #5
0
        public AgedBalancesNotesDetailRowTemplate(string strKFieldName)
        {
            this.dtKeyFieldName = strKFieldName;
            this.currentRow     = 0;

            detailGridView = new CffGridView();
            detailGridView.SettingsBehavior.AllowFocusedRow = true;
            detailGridView.SettingsBehavior.AllowGroup      = true;
            detailGridView.SettingsDetail.IsDetailGrid      = true;
            detailGridView.SettingsDetail.ExportMode        = DevExpress.Web.ASPxGridView.GridViewDetailExportMode.Expanded;
            detailGridView.KeyFieldName = this.dtKeyFieldName;
            detailGridView.Visible      = true;

            detailGridView.Styles.Cell.Wrap            = DevExpress.Web.ASPxClasses.DefaultBoolean.True;
            detailGridView.Styles.Cell.HorizontalAlign = HorizontalAlign.Justify;
            detailGridView.Settings.ShowFooter         = true;

            detailGridView.EnableCallBacks = false;
            GridViewDataColumn colName = new GridViewDataColumn("CreatedByEmployeeName", "Created By");

            colName.VisibleIndex   = detailGridView.Columns.Count;
            colName.CellStyle.Wrap = DevExpress.Web.ASPxClasses.DefaultBoolean.False;
            colName.Width          = Unit.Percentage(10);
            colName.ReadOnly       = true;
            detailGridView.Columns.Add(colName);


            GridViewDataMemoColumn column = new GridViewDataMemoColumn();

            column.Caption      = "Comment";
            column.FieldName    = "Comment";
            column.Width        = Unit.Percentage(60);
            column.VisibleIndex = detailGridView.Columns.Count;
            column.CellStyle.HorizontalAlign = HorizontalAlign.Justify;
            column.CellStyle.Wrap            = DevExpress.Web.ASPxClasses.DefaultBoolean.True;
            column.EditCellStyle.Wrap        = DevExpress.Web.ASPxClasses.DefaultBoolean.True;
            column.ReadOnly = true;
            detailGridView.Columns.Add(column);

            detailGridView.InsertDataColumn("Created", "Created");
            detailGridView.SettingsBehavior.ProcessFocusedRowChangedOnServer = false;
            detailGridView.SettingsBehavior.ProcessSelectionChangedOnServer  = false;
            detailGridView.Enabled = false;
        }
예제 #6
0
        protected void initReportGridView()
        {
            reportGridView = new CffGridView(250);
            reportGridView.KeyFieldName = "Id";

            reportGridView.SettingsBehavior.AllowSort       = true;
            reportGridView.SettingsBehavior.AllowFocusedRow = true;


            reportGridView.SettingsPager.AlwaysShowPager = true;
            reportGridView.SettingsPager.Mode            = GridViewPagerMode.ShowPager;
            reportGridView.ShowPager(250);

            reportGridView.Settings.ShowFooter = true;
            reportGridView.TotalSummary.Clear();

            reportPlaceholder.Controls.Clear();
            reportPlaceholder.Controls.Add(reportGridView);
        }
예제 #7
0
 void detailGridView_BeforePerformDataSelect(object sender, EventArgs e)
 {//HttpContext.Current.Session[this.dtKeyFieldName] = (sender as ASPxGridView).GetMasterRowKeyValue();
     try
     {
         CffGridView masterGrid = sender as CffGridView;
         object      kVal       = masterGrid.GetMasterRowKeyValue();
         if (this.dataSource != null)
         {
             IList <AgedBalancesReportRecord> xABR = dataSource as IList <AgedBalancesReportRecord>;
             detailGridView.DataSource = (xABR[0] as AgedBalancesReportRecord).CustNoteList;
         }
         else
         {
             AgedBalancesReportRecord dRow = masterGrid.GetRow(masterGrid.FocusedRowIndex) as AgedBalancesReportRecord;
             detailGridView.DataSource = dRow.CustNoteList;
         }
         detailGridView.DataBind();
     }
     catch (Exception exc) {
         string Msg = exc.Message;
     }
 }
 private void xDetail_DataBinding(Object sender, EventArgs e)
 {
     CffGridView masterGrid = (CffGridView)sender;
     int         rIdx       = masterGrid.FocusedRowIndex;
 }
예제 #9
0
 void detailGridView_DataBound(object sender, EventArgs e)
 { //Template
     CffGridView dGrid = sender as CffGridView;
 }
예제 #10
0
 void detailGridView_BeforePerformDataSelect(object sender, EventArgs e)
 {
     CffGridView masterGrid = sender as CffGridView;
 }
예제 #11
0
        public override void Export()
        {
            AgedBalancesReport report = ViewState["AgedBalancesReport"] as AgedBalancesReport;

            System.Collections.Generic.IList <AgedBalancesReportRecord> exportRecordWithNotes = new System.Collections.Generic.List <AgedBalancesReportRecord>();

            foreach (AgedBalancesReportRecord rptRecord in report.Records)
            {
                System.Collections.Generic.IList <CustomerNote> cnList = rptRecord.CustNoteList;
                rptRecord.Note = "";
                foreach (CustomerNote cNote in cnList)
                {
                    if (!string.IsNullOrEmpty(cNote.Comment))
                    {
                        rptRecord.Note += "[" + cNote.CreatedByEmployeeName + "][" + cNote.Created.ToShortDateString() + "]";
                        rptRecord.Note += cNote.Comment + System.Environment.NewLine;
                    }
                }

                if (!string.IsNullOrEmpty(rptRecord.Note))
                {
                    rptRecord.CustNoteList.Clear();
                }

                exportRecordWithNotes.Add(rptRecord);
            }

            //init columns
            CffGridView exportGrid = new CffGridView(250);

            if (IsReportWithNotesLiteral.Text.ToLower() == "true")
            {
                exportGrid.SettingsBehavior.AllowSort = true;
                exportGrid.InsertRightAlignedDataColumn("CustomerNumber", "#");
                exportGrid.InsertHyperlinkColumn("CustomerName", "Customer", "Id", LinkHelper.NavigateUrlFormatToDashboardForCustomer);
                exportGrid.InsertCurrencyColumn("CurrentBalance", "Current");
                exportGrid.InsertCurrencyColumn("MonthOldBalance", "Month 1");
                exportGrid.InsertCurrencyColumn("TwoMonthsOldBalance", "Month 2");
                exportGrid.InsertCurrencyColumn("ThreeMonthsOrOlderBalance", "Month 3+");
                exportGrid.InsertCurrencyColumn("Balance");
                exportGrid.InsertDataColumn("NextCallDate", "Next Call");
                exportGrid.InsertMemoColumn("Note", "Note");
                exportGrid.Visible = false;

                exportGrid.InsertDataColumn("Email");
                exportGrid.InsertDataColumn("Contact");
                exportGrid.InsertDataColumn("Phone");
                exportGrid.InsertDataColumn("Cell", "Mobile Phone");

                exportGrid.TotalSummary.Clear();
                exportGrid.InsertTotalSummaryLabelColumn(0);
                exportGrid.InsertTotalSummarySumColumn("CurrentBalance");
                exportGrid.InsertTotalSummarySumColumn("MonthOldBalance");
                exportGrid.InsertTotalSummarySumColumn("TwoMonthsOldBalance");
                exportGrid.InsertTotalSummarySumColumn("ThreeMonthsOrOlderBalance");
                exportGrid.InsertTotalSummarySumColumn("Balance");

                exportGrid.DataSource = exportRecordWithNotes;
                exportGrid.DataBind();
            }



            if (report != null)
            {
                ExcelDocument document = new ExcelDocument();
                document.HSFFGetSheet.SetColumnWidth(8, 400);
                document.WriteTitle(report.Title);

                Hashtable hashtable = new Hashtable();
                hashtable.Add("Client", "ClientName");
                hashtable.Add("Customer", "CustomerName");

                if (IsReportWithNotesLiteral.Text.ToLower() == "true")
                {
                    exportGrid.WriteToExcelDocumentWithReplaceField(document, hashtable);
                }
                else
                {
                    reportGridView.WriteToExcelDocumentWithReplaceField(document, hashtable);
                }

                document.MoveToNextRow();
                document.MoveToNextRow();
                document.AddCell("Date Viewed");
                document.AddCell(report.DateViewed.ToDateTimeString());

                WriteToResponse(document.WriteToStream(), report.ExportFileName);
            }
        }