public DatasetRenderer(DatasetRendererItem dri)
 {
     _DatasetRenderer = dri;
 }
            private static string Renderer(string itemIdOrQueryList, string rendererPathOrGuid)
            {
                var output = string.Empty;
                var ids = itemIdOrQueryList.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);

                var items = new List<Item>();

                foreach (var id in ids)
                {
                    if (Sitecore.Data.ID.IsID(id))
                    {
                        var i = Sitecore.Context.Database.GetItem(id);
                        if (i != null)
                            items.Add(i);
                    }
                    else
                    {
                        var results = Sitecore.Context.Database.SelectItems(id);
                        if (results.Length > 0)
                            items.AddRange(results);
                    }
                }

                if (items.Count > 0)
                {
                    StringBuilder sb = new StringBuilder();
                    HtmlTextWriter htw = new HtmlTextWriter(new System.IO.StringWriter(sb));

                    var dri = new DatasetRendererItem(Sitecore.Context.Database.GetItem(rendererPathOrGuid));
                    var dr = new DatasetRenderer(dri);

                    if (dri.Dataset is ItemsSubset)
                    {
                        (dri.Dataset as ItemsSubset).Items = items.ToArray();
                        dr.DoRenderInternal(htw, HtmlTextWriterTag.Span);
                    }
                    else if (dri.Dataset is ContextItemQueryItem && items.Count == 1)
                    {
                        var preservedContextItem = Sitecore.Context.Item;
                        Sitecore.Context.Item = items[0];
                        dr.DoRenderInternal(htw, HtmlTextWriterTag.Span);
                        Sitecore.Context.Item = preservedContextItem;
                    }
                    output = sb.ToString();
                }

                return output;
            }