Esempio n. 1
0
        /// <summary>
        /// Adds a title and page numbers to the report header
        /// Coded by Dan Stoever
        /// </summary>
        /// <param name="title">string</param>
        public void AddHeader(string title)
        {
            ReportBuilder builder = new ReportBuilder(reportDocument);

            builder.PageHeader.ClearSections();
            builder.AddPageHeader(title, "", "page %p");            // Add a simple page header and footer that is the same on all pages.
        }
Esempio n. 2
0
        public void MakeDocument(ReportDocument reportDocument)
        {
            if (core == null)
            {
                return;
            }

            TextStyle.ResetStyles();

            // setup default margins for the document (units of 1/100 inch)
            reportDocument.DefaultPageSettings.Margins.Top    = 50;
            reportDocument.DefaultPageSettings.Margins.Bottom = 50;
            reportDocument.DefaultPageSettings.Margins.Left   = 75;
            reportDocument.DefaultPageSettings.Margins.Right  = 75;

            // setup the global TextStyles
            TextStyle.Heading1.FontFamily         = new FontFamily("Tahoma");
            TextStyle.Heading1.Brush              = Brushes.Black;
            TextStyle.Heading1.SizeDelta          = 5.0f;
            TextStyle.TableHeader.Brush           = Brushes.Black;
            TextStyle.TableHeader.BackgroundBrush = Brushes.LightGray;
            TextStyle.TableRow.BackgroundBrush    = Brushes.White;
            TextStyle.Normal.Size      = 11.0f;
            TextStyle.TableRow.Size    = 9.0f;
            TextStyle.TableHeader.Size = 9.0f;
            TextStyle.TableHeader.Bold = false;
            // add some white-space to the page.  By adding a 1/10 inch margin to the bottom of every line, quite a bit of white space will be added
            TextStyle.Normal.MarginBottom = 0.1f;

            // create a builder to help with putting the table together.
            ReportBuilder builder = new ReportBuilder(reportDocument);

            // add a simple page header and footer that is the same on all pages.
            builder.AddPageHeader("Strategy Report [" + core.StockName + "]", String.Empty, "page %p");
            builder.AddPageFooter(String.Empty, DateTime.Now.ToLongDateString(), String.Empty);

            // begin layout
            builder.StartLinearLayout(Direction.Vertical);

            AddQuoteSection(reportDocument, builder);
            AddStrategySection(reportDocument, builder);
            AddNotesSection(reportDocument, builder);
            AddSummarySection(reportDocument, builder);
            AddGraphSection(reportDocument, builder);

            // end layout
            builder.FinishLinearLayout();
        }