コード例 #1
0
        private FASTWeb.Models.ModularReport GenerateEmployeesReportData(List <vwEmployeeList> employees)
        {
            List <vwEmployeeList> list = employees;

            FASTWeb.Models.ModularReport reportdata = new Models.ModularReport();

            reportdata.ReportTitle = "Employee List Report";

            List <FASTWeb.Models.ReportColumn> header = new List <Models.ReportColumn>();

            FASTWeb.Models.ReportColumn col1 = new Models.ReportColumn()
            {
                Content = "Employee ID", Style = "center", Width = "30"
            };
            FASTWeb.Models.ReportColumn col2 = new Models.ReportColumn()
            {
                Content = "Full Name", Style = "center", Width = "30"
            };
            FASTWeb.Models.ReportColumn col3 = new Models.ReportColumn()
            {
                Content = "Gender", Style = "center", Width = "100"
            };
            FASTWeb.Models.ReportColumn col4 = new Models.ReportColumn()
            {
                Content = "Email", Style = "center", Width = "100"
            };
            FASTWeb.Models.ReportColumn col6 = new Models.ReportColumn()
            {
                Content = "Phone Number", Style = "center", Width = "100"
            };
            FASTWeb.Models.ReportColumn col7 = new Models.ReportColumn()
            {
                Content = "Position", Style = "center", Width = "100"
            };
            FASTWeb.Models.ReportColumn col8 = new Models.ReportColumn()
            {
                Content = "Status", Style = "center", Width = "100"
            };

            header.Add(col1);
            header.Add(col2);
            header.Add(col3);
            header.Add(col4);
            header.Add(col6);
            header.Add(col7);
            header.Add(col8);



            FASTWeb.Models.ReportColumn f1 = new Models.ReportColumn()
            {
                Style = "center", Format = ""
            };
            FASTWeb.Models.ReportColumn f2 = new Models.ReportColumn()
            {
                Style = "left", Format = ""
            };

            if (list != null)
            {
                foreach (vwEmployeeList employee in list)
                {
                    FASTWeb.Models.ReportData newData = new Models.ReportData();
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = employee.EmployeeID.ToString(), Width = col1.Width, Format = "", Style = f1.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = employee.FullName, Width = col2.Width, Format = "", Style = f1.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = employee.Gender, Width = col3.Width, Format = "", Style = f2.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = employee.EmailAddress, Width = col4.Width, Format = "", Style = f2.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = employee.PhoneNumber, Width = col6.Width, Format = "", Style = f2.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = employee.Description, Width = col7.Width, Format = "", Style = f2.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = employee.Status.ToString(), Width = col8.Width, Format = "", Style = f2.Style
                    });

                    reportdata.Data.Add(newData);
                }
            }


            reportdata.Columns = header;

            return(reportdata);
        }
コード例 #2
0
        private FASTWeb.Models.ModularReport GenerateAssetReportData(List <vwFixAssetList> assets)
        {
            List <vwFixAssetList> list = assets;


            FASTWeb.Models.ModularReport reportdata = new Models.ModularReport();

            reportdata.ReportTitle = "Fix Asset Report";

            List <FASTWeb.Models.ReportColumn> header = new List <Models.ReportColumn>();

            FASTWeb.Models.ReportColumn col1 = new Models.ReportColumn()
            {
                Content = "Asset Tag", Style = "center", Width = "30"
            };
            FASTWeb.Models.ReportColumn col2 = new Models.ReportColumn()
            {
                Content = "Serial Number", Style = "center", Width = "30"
            };
            FASTWeb.Models.ReportColumn col3 = new Models.ReportColumn()
            {
                Content = "Brand", Style = "center", Width = "100"
            };
            FASTWeb.Models.ReportColumn col4 = new Models.ReportColumn()
            {
                Content = "Model", Style = "center", Width = "100"
            };
            FASTWeb.Models.ReportColumn col6 = new Models.ReportColumn()
            {
                Content = "Type", Style = "center", Width = "100"
            };
            FASTWeb.Models.ReportColumn col7 = new Models.ReportColumn()
            {
                Content = "Acquisition Date", Style = "center", Width = "100"
            };
            FASTWeb.Models.ReportColumn col8 = new Models.ReportColumn()
            {
                Content = "Status", Style = "center", Width = "100"
            };

            header.Add(col1);
            header.Add(col2);
            header.Add(col3);
            header.Add(col4);
            header.Add(col6);
            header.Add(col7);
            header.Add(col8);



            FASTWeb.Models.ReportColumn f1 = new Models.ReportColumn()
            {
                Style = "center", Format = ""
            };
            FASTWeb.Models.ReportColumn f2 = new Models.ReportColumn()
            {
                Style = "left", Format = ""
            };

            if (list != null)
            {
                foreach (vwFixAssetList asset in list)
                {
                    FASTWeb.Models.ReportData newData = new Models.ReportData();
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = asset.AssetTag, Width = col1.Width, Format = "", Style = f1.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = asset.SerialNumber, Width = col2.Width, Format = "", Style = f1.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = asset.Brand, Width = col3.Width, Format = "", Style = f2.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = asset.Model, Width = col4.Width, Format = "", Style = f2.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = asset.TypeDescription, Width = col6.Width, Format = "", Style = f2.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = asset.AcquisitionDate.ToString(), Width = col7.Width, Format = "", Style = f2.Style
                    });
                    newData.DataList.Add(new Models.ReportColumn()
                    {
                        Content = asset.StatusDescription, Width = col8.Width, Format = "", Style = f2.Style
                    });

                    reportdata.Data.Add(newData);
                }
            }


            reportdata.Columns = header;

            return(reportdata);
        }