Exemplo n.º 1
0
        public static void SaveReport(ViewGroup viewGroup, ReportOrViewSpec reportOrViewSpec)
        {
            var srmDocument             = GetDefaultDocument();
            var documentGridViewContext = new DocumentGridViewContext(GetSkylineDataSchema(srmDocument, DataSchemaLocalizer.INVARIANT));

            documentGridViewContext.AddOrReplaceViews(viewGroup.Id, ConvertAll(new[] { reportOrViewSpec }, srmDocument));
        }
Exemplo n.º 2
0
 public static void SaveReportAs(ViewGroup viewPath, ReportOrViewSpec reportOrViewSpec, string newName)
 {
     if (null != reportOrViewSpec.ReportSpec)
     {
         SaveReport(viewPath, new ReportOrViewSpec((ReportSpec)reportOrViewSpec.ReportSpec.ChangeName(newName)));
     }
     else if (null != reportOrViewSpec.ViewSpec)
     {
         SaveReport(viewPath, new ReportOrViewSpec(reportOrViewSpec.ViewSpec.SetName(newName)));
     }
 }
Exemplo n.º 3
0
        public static bool AreEquivalent(ReportOrViewSpec reportOrViewSpec1, ReportOrViewSpec reportOrViewSpec2)
        {
            if (reportOrViewSpec1.ReportSpec != null && reportOrViewSpec2.ReportSpec != null)
            {
                return(reportOrViewSpec1.ReportSpec.Equals(reportOrViewSpec2.ReportSpec));
            }
            var viewSpec1 = ConvertView(reportOrViewSpec1);
            var viewSpec2 = ConvertView(reportOrViewSpec2);

            return(viewSpec1.Equals(viewSpec2));
        }
Exemplo n.º 4
0
 private static ViewSpec ConvertView(ReportOrViewSpec reportOrViewSpec)
 {
     return(ConvertAll(new[] { reportOrViewSpec }, GetDefaultDocument()).First());
 }