public void LoadOrCreateReport() { //string baseClassName = String.Empty; Application.UseWaitCursor = true; Application.DoEvents(); try { IComponent cc = this.host.CreateComponent(typeof(ICSharpCode.Reports.Addin.RootReportModel),"RootReportModel"); ICSharpCode.Reports.Addin.RootReportModel rootControl = cc as ICSharpCode.Reports.Addin.RootReportModel; string message; if (this.generator.ViewContent.PrimaryFile.IsDirty) { message = String.Format("Create Report + {0} ...",Path.GetFileName(this.generator.ViewContent.PrimaryFile.FileName)); } else { message = String.Format("Load Report + {0} ...",Path.GetFileName(this.generator.ViewContent.PrimaryFile.FileName)); } StatusBarService.SetMessage(message); this.CreateNamedSurface(); UnitConverter pageWidth = new UnitConverter(iTextSharp.text.PageSize.A4.Width, XGraphicsUnit.Point); UnitConverter pageHeight = new UnitConverter(iTextSharp.text.PageSize.A4.Height + (this.reportModel.SectionCollection.Count +1) * GlobalsDesigner.GabBetweenSection , XGraphicsUnit.Point); rootControl.Size = new System.Drawing.Size((int)pageWidth.Pixel,(int)pageHeight.Pixel); } catch (Exception e) { System.Console.WriteLine(e.Message); } finally { StatusBarService.SetMessage(String.Empty); Application.UseWaitCursor = false; } }