private void setColumnsVisibility()
        {
            _pageSetup = PdfRptData.DocumentPreferences;
            _originalPdfColumnsDefinitions = PdfRptData.PdfColumnsAttributes;
            bool areColumnsAdHoc = false;

            if (_originalPdfColumnsDefinitions == null || !_originalPdfColumnsDefinitions.Any())
            {
                areColumnsAdHoc = true;
                _originalPdfColumnsDefinitions = new AdHocPdfColumnDefinitions(_bodyDataSource, _conventions).CreatePdfColumnDefinitions();
            }
            var visibleColumns = _conventions?.VisibleColumnNames;

            _bodyDataSource.ApplyPropertyDataAnnotations(this._originalPdfColumnsDefinitions, visibleColumns, areColumnsAdHoc);

            if (_pageSetup.GroupsPreferences == null ||
                _pageSetup.GroupsPreferences.GroupType == GroupType.HideGroupingColumns)
            {
                _pdfColumnsDefinitions = _originalPdfColumnsDefinitions.Where(x => x.IsVisible && !x.IncludeInGrouping)
                                         .OrderBy(x => x.Order)
                                         .ToList();
            }

            if (_pageSetup.GroupsPreferences != null &&
                _pageSetup.GroupsPreferences.GroupType == GroupType.IncludeGroupingColumns)
            {
                _pdfColumnsDefinitions = _originalPdfColumnsDefinitions.Where(x => x.IsVisible || x.IncludeInGrouping)
                                         .OrderBy(x => x.Order)
                                         .ToList();
            }

            if (_pageSetup.MainTablePreferences.TableType == TableType.HorizontalStackPanel)
            {
                var columnsCount           = _pageSetup.MainTablePreferences.HorizontalStackPanelPreferences.ColumnsPerRow;
                var tempColumnsDefinitions = _pdfColumnsDefinitions.Where(x => !x.IsRowNumber).ToList();
                while (_pdfColumnsDefinitions.Count < columnsCount)
                {
                    _pdfColumnsDefinitions.AddRange(tempColumnsDefinitions);
                }
                _pdfColumnsDefinitions = _pdfColumnsDefinitions.Take(columnsCount).ToList();
            }

            _groupByProperties = _originalPdfColumnsDefinitions.Where(x => x.IncludeInGrouping)
                                 .Select(x => x.PropertyName)
                                 .ToList();
            _isGroupingEnabled = _originalPdfColumnsDefinitions.Any(x => x.IncludeInGrouping);
        }