public ReportGenerator(ReportWizardContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     this.context = context;
     ReportModel  = ReportModelFactory.Create();
 }
Beispiel #2
0
        public IViewContent CreateContentForFile(OpenedFile file)
        {
            if (file.IsDirty)
            {
                var reportModel = ReportModelFactory.Create();

                var reportFactory = new CreateFormSheetFromModel();
                var xml           = reportFactory.ToXml(reportModel);

                var doc = new XmlDocument();
                doc.LoadXml(xml.ToString());
                var ar = XmlToArray(doc);
                file.SetData(ar);
            }

            var viewCmd = new CreateDesignerCommand(file);

            viewCmd.Run();
            LoggingService.Info("return DesignerView");
            return(viewCmd.DesignerView);
        }
        public ReportModel CreateModelFromXml(XmlElement elem, IDesignerHost host)
        {
            var reportSettings = CreateReportSettings(elem);
            var reportModel    = ReportModelFactory.Create();

            reportModel.ReportSettings = reportSettings;

            host.Container.Add(reportSettings);

            //Move to SectionCollection
            XmlNodeList sectionList = elem.LastChild.ChildNodes;

            foreach (XmlNode sectionNode in sectionList)
            {
                try {
                    var o       = this.Load(sectionNode as XmlElement, null);
                    var section = o as ICSharpCode.Reporting.Addin.DesignableItems.BaseSection;
                    host.Container.Add(section);
                } catch (Exception e) {
                    MessageService.ShowException(e);
                }
            }
            return(reportModel);
        }
Beispiel #4
0
 public ReportGenerator()
 {
     ReportModel = ReportModelFactory.Create();
 }