public bool CreateReport(string name, byte[] definition, string path = null)
        {
            string batchId = null;

            client.CreateBatch(out batchId);
            Warning[] warnings = null;
            var       result   = client.CreateReport(
                new BatchHeader()
            {
                BatchID = batchId
            },
                name,
                path ?? "/",
                true,
                definition,
                new Property[0],
                out warnings);

            string reportPath = string.Format("/{0}/{1}", path.Trim('/'), name);

            DataSourceReference reference = new DataSourceReference();

            reference.Reference = "/libservices/DS";
            DataSource[] dataSources = new DataSource[1];
            DataSource   ds          = new DataSource();

            ds.Item        = (DataSourceDefinitionOrReference)reference;
            ds.Name        = "DS";
            dataSources[0] = ds;
            client.SetItemDataSources(new BatchHeader()
            {
                BatchID = batchId
            }, reportPath, dataSources);

            client.ExecuteBatch(new BatchHeader()
            {
                BatchID = batchId
            });
            if (warnings != null && warnings.Length > 0)
            {
                StringBuilder sb = new StringBuilder();
                foreach (var w in warnings)
                {
                    sb.AppendLine(w.Severity);
                    sb.AppendLine("---");
                    sb.AppendLine(w.ObjectName);
                    sb.AppendLine(w.ObjectType);
                    sb.AppendLine(w.Message);
                    sb.AppendLine();
                }

                throw new Exception(sb.ToString());
            }
            return(true);
        }