Example #1
0
        static void Main(string[] args)
        {
            Log("Opening web...");

            using (SPSite site = new SPSite("http://intranet.contoso.com/"))
            {
                Log("Building report...");
                Report report = new Report();
                report.BuildRowsAndFields(site.RootWeb);

                Log("Writing output...");
                using (StreamWriter streamWriter = new StreamWriter("ContentTypeReport.csv"))
                {
                    report.WriteOutput(streamWriter);
                }
#if false
                ReportField reportField = report.ReportFieldsById[new Guid("67df98f4-9dec-48ff-a553-29bece9c5bf4")];
                foreach (var pair in reportField.GetSchemaXmls())
                {
                    Log("-- " + pair.Key + " --------------------------------------------------------------------");
                    Log(pair.Value);
                }
                Log("----------------------------------------------------------------------");
#endif
            }
            Log("Done.");

            if (Debugger.IsAttached)
            {
                Debugger.Break();
            }
        }
Example #2
0
        public string GetFieldLabel(SPField field, SPContentType contentType)
        {
            ReportField reportField;

            if (!this.ReportFieldsById.TryGetValue(field.Id, out reportField))
            {
                reportField = new ReportField(field);
                this.ReportFieldsById.Add(field.Id, reportField);
            }
            return(reportField.GetFieldLabelForReport(field, contentType));
        }