‫۱۰ سال و ۳ ماه قبل، چهارشنبه ۱۸ تیر ۱۳۹۳، ساعت ۱۶:۲۳
با سلام. بعد از بیلد کردن پروژه و اضافه شدن پکیج‌های نوگت، موقع اجرا وقتی در صفحه نقش‌ها ، نقش جدید را اضافه میکنم، خطای زیر در کنسول فایرباگ لاگ می‌شود:
 Unable to determine a valid ordering for dependent operations. Dependencies may exist due to foreign key constraints, model requirements, or store-generated values
‫۱۰ سال و ۵ ماه قبل، چهارشنبه ۳ اردیبهشت ۱۳۹۳، ساعت ۱۶:۲۳
با سلام. چرا گروهبندی بر روی خروجی اعمال نمی‌شود؟
کلاس هدر گزارش:
 public class CH_Rpt_Report1 : IPageHeader
    {

        public TermViewModel TermInfo { get; set; }
        public string StartDate { get; set; }
        public string EndDate { get; set; } 

        public CH_Rpt_AllTeacherAbsents(TermViewModel termInfo, string startDate, string endDate)
        {
            TermInfo = termInfo;
            StartDate = startDate;
            EndDate = endDate; 
        }
        public CH_Rpt_AllTeacherAbsents()
        {

        }
        public IPdfFont PdfRptFont { set; get; }

        public PdfGrid RenderingReportHeader(Document pdfDoc, PdfWriter pdfWriter, IList<SummaryCellData> summaryData)
        {
            var rootGrid = new PdfGrid(1);
            rootGrid.DefaultCell.BorderWidth = 0;
            rootGrid.WidthPercentage = 100;

           ...

            return grid;
        }
      
        public PdfGrid RenderingGroupHeader(Document pdfDoc, PdfWriter pdfWriter, IList<CellData> newGroupInfo, IList<SummaryCellData> summaryData)
        {
            var teacherCode = newGroupInfo.GetSafeStringValueOf<TeachersAbsentRow>(p => p.TeacherCode);
            var teacherFullName = newGroupInfo.GetSafeStringValueOf<TeachersAbsentRow>(p => p.TeacherFullName);
            var table = new PdfGrid(1)
            {
                WidthPercentage = 100,
                HorizontalAlignment = PdfWriter.RUN_DIRECTION_RTL,
                RunDirection = PdfWriter.RUN_DIRECTION_RTL
            };
            table.AddSimpleRow((cellData, cellProperties) =>
            {
                cellData.Value = (teacherFullName + " - " + teacherCode).FixWeakCharacters();
                //cellData.Value = (teacherFullName);
                cellProperties.PdfFont = FontHelper.GetIPdfFont(FontHelper.GetFontPath(FarsiFonts.BYekan), new BaseColor(Color.Gray), 12);
                cellProperties.HorizontalAlignment = HorizontalAlignment.Right;
            });

            return table.AddBorderToTable(borderColor: BaseColor.LIGHT_GRAY, spacingBefore: 5f);
        }

    }
کلاس گزارش:
public class Rpt_AllTeacherAbsents : IReportBase
    {
        #region IReportBase

        public string ReportFileName { get; set; }

        #endregion IReportBase

        #region Properties

        public bool ShowTeacherInSeperatePage { get; set; }
        public List<TeachersAbsentRow> DataSource { get; set; }
        public string StartDate { get; set; }
        public string EndDate { get; set; }
        public bool ShowFooter { get; set; }
        public TermViewModel Term { get; set; }

        #endregion Properties

        #region Constructors

        public Rpt_AllTeacherAbsents()
        {
        }

        public Rpt_AllTeacherAbsents(List<TeachersAbsentRow> dataSource, TermViewModel term, string startDate = "", string endDate = "", bool showFooter = true, bool showTeacherInSeperatePage = false)
        {
            ShowFooter = showFooter;
            DataSource = dataSource;
            Term = term;
            StartDate = startDate;
            EndDate = endDate;
            ShowTeacherInSeperatePage = showTeacherInSeperatePage;
        }

        #endregion Constructors

        public IPdfReportData Create()
        {
            return new PdfReport()
            .DocumentPreferences(doc =>
            {
                doc.RunDirection(PdfRunDirection.RightToLeft);
                doc.Orientation(PageOrientation.Landscape);
                doc.PageSize(PdfPageSize.A4);
                doc.DocumentMetadata(new DocumentMetadata
                {
                     ...
                });
            })
            .DefaultFonts(fonts =>
            {
                fonts.Size(8);
                fonts.Path(FontHelper.GetFontPath(FarsiFonts.BYekan),
                    //fonts.Path(Environment.GetEnvironmentVariable("SystemRoot") + "\\fonts\\BYekan.ttf",
                 Environment.GetEnvironmentVariable("SystemRoot") + "\\fonts\\tahoma.ttf");
            })
            .PagesFooter(footer =>
            {
                #region Footer

                if (ShowFooter)
                {
                    footer.XHtmlFooter(rptFooter =>
                    {
                        IPdfFont ipf = footer.PdfFont;
                        ipf.Size = 9;
                        rptFooter.PageFooterProperties(new XFooterBasicProperties
                        {
                            RunDirection = PdfRunDirection.RightToLeft,
                            ShowBorder = true,
                            PdfFont = ipf,
                            TotalPagesCountTemplateHeight = 10,
                            TotalPagesCountTemplateWidth = 50,
                            SpacingBeforeTable = 25f,
                            InlineCss = "border:0px solid;border-top:1px solid black;"
                        });
                        //RazorMachine rm = new RazorMachine();
                        rptFooter.AddPageFooter(pageFooter =>
                        {
                            return HeaderAndFooterUtility.InitCommonFooter(Term, pageFooter);
                        });
                    });
                }

                #endregion
            })
            .PagesHeader(header =>
            {
                header.CustomHeader(new CH_Rpt_AllTeacherAbsents(Term, StartDate, EndDate)
                {
                    PdfRptFont = header.PdfFont
                });
            })
            .MainTableTemplate(template =>
            {
                template.CustomTemplate(new GrayTemplate(false));
            })
            .MainTablePreferences(table =>
            {
                #region

                table.ShowHeaderRow(true);
                table.SpacingAfter(10f);
                table.ColumnsWidthsType(TableColumnWidthType.Absolute);
                table.NumberOfDataRowsPerPage(0);
                table.GroupsPreferences(new GroupsPreferences
                {
                    GroupType = GroupType.HideGroupingColumns,
                    SpacingBeforeAllGroupsSummary = 1f,
                    SpacingAfterAllGroupsSummary = 5,
                    NewGroupAvailableSpacingThreshold = 30,
                    RepeatHeaderRowPerGroup = true,
                    ShowOneGroupPerPage = ShowTeacherInSeperatePage,
                });

                #endregion
            })
            .MainTableDataSource(dataSource =>
            {
                dataSource.StronglyTypedList<TeachersAbsentRow>(DataSource);
            })
            .MainTableSummarySettings(summarySettings =>
            {
                //summarySettings.OverallSummarySettings("جمع ساعات تدریس : ");
                // summarySettings.PreviousPageSummarySettings("Previous Page Summary");
                // summarySettings.PageSummarySettings("Page Summary");
            })
            .MainTableColumns(columns =>
            {
                #region Columns

                columns.AddColumn(column =>
                {
                    column.PropertyName("rowNo");
                    column.IsRowNumber(true);
                    column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                    column.IsVisible(true);
                    column.Order(0);
                    column.Width(40);
                    column.HeaderCell("#", horizontalAlignment: HorizontalAlignment.Center);
                });
                columns.AddColumn(column =>
                {
                    column.PropertyName<TeachersAbsentRow>(x => x.TeacherCode);
                    column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                    column.IsVisible(true);
                    column.Order(2);
                    column.Width(100);
                    column.HeaderCell("کد استاد", horizontalAlignment: HorizontalAlignment.Right);
                    column.Group(true, (val1, val2) =>
                    {
                        return val1.ToString() == val2.ToString();
                    });
                });
                
                columns.AddColumn(column =>
                {
                    column.PropertyName<TeachersAbsentRow>(x => x.LessonCode);
                    column.CellsHorizontalAlignment(HorizontalAlignment.Left);
                    column.IsVisible(true);
                    column.Order(2);
                    column.Width(100);
                    column.HeaderCell("کد درس", horizontalAlignment: HorizontalAlignment.Center);
                });
                columns.AddColumn(column =>
                {
                    column.PropertyName<TeachersAbsentRow>(x => x.LessonName);
                    column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                    column.IsVisible(true);
                    column.Order(2);
                    column.Width(200);
                    column.HeaderCell("نام درس", horizontalAlignment: HorizontalAlignment.Center);
                });
                columns.AddColumn(column =>
                {
                    column.PropertyName<TeachersAbsentRow>(x => x.Date);
                    column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                    column.IsVisible(true);
                    column.Order(2);
                    column.Width(90);
                    column.HeaderCell("تاریخ", horizontalAlignment: HorizontalAlignment.Center);
                });
                columns.AddColumn(column =>
                {
                    column.PropertyName<TeachersAbsentRow>(x => x.StartTimeToEndTime);
                    column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                    column.IsVisible(true);
                    column.Order(2);
                    column.Width(120);
                    column.HeaderCell("ساعت", horizontalAlignment: HorizontalAlignment.Center);
                });
                columns.AddColumn(column =>
                {
                    column.PropertyName<TeachersAbsentRow>(x => x.TrendCode);
                    column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                    column.IsVisible(true);
                    column.Order(2);
                    column.Width(90);
                    column.HeaderCell("کد رشته", horizontalAlignment: HorizontalAlignment.Center);
                });
                columns.AddColumn(column =>
                {
                    column.PropertyName<TeachersAbsentRow>(x => x.TrendName);
                    column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                    column.IsVisible(true);
                    column.Order(2);
                    column.Width(180);
                    column.HeaderCell("عنوان رشته", horizontalAlignment: HorizontalAlignment.Center);
                });
                columns.AddColumn(column =>
                {
                    column.PropertyName<TeachersAbsentRow>(x => x.PlaceFullName);
                    column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                    column.IsVisible(true);
                    column.Order(2);
                    column.Width(130);
                    column.HeaderCell("مکان برگزاری", horizontalAlignment: HorizontalAlignment.Center);
                });

                #endregion
            })
            .MainTableEvents(events =>
            {
                #region Events

                #region Alternate Row Colors

                events.CellCreated(args =>
                {
                     
                });

                #endregion


                events.DataSourceIsEmpty(message: "داده ای برای مشاهده وجود ندارد.");
                events.CellCreated(args =>
                {
                    if (args.RowType == RowType.DataTableRow)
                    {

                    }
                });

                #endregion
            })
            .Export(export =>
            {

            })
            .Generate(data => data.AsPdfFile(ReportFileName));
        }

    }
مدل هم بصورت زیر است:
public class TeachersAbsentRow
    {
        public TeachersAbsentRow()
        {
            
        }
        public int Id { get; set; }
        public int ProgramId { get; set; }
        public string RowNumber { get; set; }
        public bool IsSelected { get; set; }


        public int TeacherId { get; set; }
        public string TeacherCode { get; set; }
        public string TeacherFullName { get; set; }
        public string TeacherFirstName { get; set; }
        public string TeacherLastName { get; set; }

        public string GroupNumber { get; set; }
        public string GroupDescription { get; set; }

        public string LessonId { get; set; }
        public string LessonCode { get; set; }
        public string LessonName { get; set; }
        public int LessonPresentationTerm { get; set; }

        public string TrendId { get; set; }
        public string TrendCode { get; set; }
        public string TrendName { get; set; }

        public string Date { get; set; }
        public string StartTime { get; set; }
        public string EndTime { get; set; }

        public string StartTimeToEndTime { get; set; }
        public string DayNumber { get; set; }
        public string DayTitle { get; set; }

        public int BuildingId { get; set; }
        public int PlaceId { get; set; }
        public string PlaceName { get; set; }
        public string BuildingName { get; set; }
        public string PlaceFullName { get; set; }
    }

‫۱۰ سال و ۷ ماه قبل، جمعه ۲ اسفند ۱۳۹۲، ساعت ۰۱:۰۶
با سلام. آیا منطقی است که در متد Authenticate_Request به ازای هر تقاضا یکبار برای دریافت اطلاعات کاربر به بانک کوئری زده شود؟ من در برخی از ویوها چندین تقاضا را به سرور بطور همزمان ارسال میکنم. آیا روش مذکور بهینه است؟ با تشکر.
‫۱۰ سال و ۸ ماه قبل، جمعه ۱۱ بهمن ۱۳۹۲، ساعت ۲۲:۴۶
با سلام. من از کتابخانه Ghostscript موجود در این پروژه استفاده کردم، اما چون پروژه من بصورت Any CPU تنظیم شده است و ویندوز من هم 64 بیتی هست، خطای زیر را دریافت میکنم. با تشکر.
Could not load file or assembly 'Iris.Pdf.ServiceLayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

‫۱۰ سال و ۸ ماه قبل، چهارشنبه ۲ بهمن ۱۳۹۲، ساعت ۰۲:۱۰
با سلام.
من اطلاعات خود را بر اساس کد استاد گروه بندی کردم. یک هدر سفارشی ایجاد کردم بصورت زیر:
 public PdfGrid RenderingGroupHeader(Document pdfDoc, PdfWriter pdfWriter, IList<CellData> newGroupInfo, IList<SummaryCellData> summaryData)
        {
            var teacherFullName = newGroupInfo.GetSafeStringValueOf("TeacherFullName");
            var teacherCode = newGroupInfo.GetSafeStringValueOf("TeacherCode");
            var teacherId = newGroupInfo.GetSafeStringValueOf("TeacherId");

//-- اینجا می‌خواهم مجموع 
//-- SessionCount 
//-- تمام سطرهای گروه را نمایش دهم .  اما تنها به اطلاعات سطر اول دسترسی دارم.
            //var sessionCount = newGroupInfo.GetSafeStringValueOf("SessionCount");

 var table = new PdfGrid(2)
            {
                WidthPercentage = 100,
                HorizontalAlignment = PdfWriter.RUN_DIRECTION_RTL,
                RunDirection = PdfWriter.RUN_DIRECTION_RTL
            };
            table.AddSimpleRow
            (
                (cellData, cellProperties) =>
                {
                    cellData.Value = teacherFullName;
                    cellProperties.PdfFont = FontHelper.GetIPdfFont(FontHelper.GetFontPath(FarsiFonts.BZar), new BaseColor(Color.Gray), 14);
                    cellProperties.HorizontalAlignment = HorizontalAlignment.Right;
                },
                (cellData, cellProperties) =>
                {
                    cellData.Value = teacherCode;
                    cellProperties.PdfFont = FontHelper.GetIPdfFont(FontHelper.GetFontPath(FarsiFonts.BYekan), new BaseColor(Color.Gray), 13);
                    cellProperties.HorizontalAlignment = HorizontalAlignment.Right;
                }
            );
            return table.AddBorderToTable(borderColor: BaseColor.LIGHT_GRAY, spacingBefore: 5f);
        }
چگونه می‌توان سطرهای یک گروه را بطور کامل بدست آورد تا بتوان مجموع یک فیلد خاص را درون هدر گروه نمایش داد؟
‫۱۱ سال و ۸ ماه قبل، سه‌شنبه ۱۰ بهمن ۱۳۹۱، ساعت ۰۵:۵۰
با سلام.
وب سایتی تحت mvc- EF code first نوشتم که نزدیک به 15 هزار کاربر دارد. نکات امنیتی را تا آن جایی که توانستم از نکات مطرح شده در سایت توسط دوستان رعایت کردم، آیا منبعی فقط مخصوص امنیت در mvc و در محیطهای کاری وجود دارد ؟
با تشکر.