protected IEnumerable <DataRowView> GetCollection(BindingInfoEntity entity, String groupMember, String xMember)
        {
            var sqlDs = ReportUnitHelper.CreateDataSource(entity.SqlQuery);

            var dataView = (DataView)sqlDs.Select(new DataSourceSelectArguments());

            if (dataView == null)
            {
                return(null);
            }

            if (!String.IsNullOrWhiteSpace(groupMember))
            {
                FillCaptionsList(dataView, groupMember);
            }

            FillXYValuesList(dataView, xMember);

            var selCaptions = GetSelectedCaptions().ToHashSet();
            var selXYValues = GetSelectedXYSeries().ToHashSet();

            var collection = dataView.Cast <DataRowView>();

            if (selCaptions.Count > 0)
            {
                collection = (from n in collection
                              let v = Convert.ToString(n[groupMember])
                                      where selCaptions.Contains(v)
                                      select n);
            }

            if (selXYValues.Count > 0)
            {
                collection = (from n in collection
                              let v = Convert.ToString(n[xMember])
                                      where selXYValues.Contains(v)
                                      select n);
            }

            return(collection);
        }
        protected void BindGridData(BindingInfoEntity entiry)
        {
            var sqlDs = ReportUnitHelper.CreateDataSource(entiry.SqlQuery);

            var dataView = (DataView)sqlDs.Select(new DataSourceSelectArguments());

            if (dataView == null)
            {
                return;
            }

            lblReportTitle.Text = entiry.Name;

            var dataTable = ReportUnitHelper.GetGridDataTable(entiry, dataView.Cast <DataRowView>());

            var dataSet = new DataSet();

            dataSet.Tables.Add(dataTable);

            BindGridData(dataSet);
        }