Пример #1
0
        private void AddTrophyWinnerRow(Siberix.PDF.Layout.Table.Table table, TrophyDataSet.TrophyWinnersRow winner)
        {
            Siberix.PDF.Layout.Table.Row  row;
            Siberix.PDF.Layout.Table.Cell cell;
            Siberix.PDF.Layout.Text.Text  text;

            Siberix.PDF.Layout.Text.Style regular = new Siberix.PDF.Layout.Text.Style(WinnerFont, Brushes.Black);

            row = table.AddRow();
            // Year
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            cell.Width         = Px(15);
            cell.WidthIsFixed  = true;
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent(winner.fldYear.ToString());
            // Trophy
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            cell.Width         = Px(60);
            cell.WidthIsFixed  = true;
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent(winner.fldTrophyName);
            // Class
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            cell.Width         = Px(25);
            cell.WidthIsFixed  = true;
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent(winner.fldClassName);

            // Helm / Crew / Owner
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            text       = cell.AddText();
            text.Style = regular;

            string helm = winner.fldHelm;

            if (winner.fldCrew.Length != 0)
            {
                if (helm.Length != 0)
                {
                    helm += " / ";
                }
                helm += winner.fldCrew;
            }
            if (winner.fldOwner.Length != 0)
            {
                if (helm.Length != 0)
                {
                    helm += "\n";
                }
                helm += "Owner: " + winner.fldOwner;
            }
            text.AddContent(helm);
        }
Пример #2
0
        private void DrawFooter(Page page, int number)
        {
            Siberix.PDF.Layout.Table.Table table = new Siberix.PDF.Layout.Table.Table()
            {
                Left  = Margin,
                Top   = page.Height - Margin,
                Width = page.Width - (2 * Margin)
            };

            Siberix.PDF.Layout.Text.Style style = new Siberix.PDF.Layout.Text.Style(FooterFont, Brushes.Black);

            Siberix.PDF.Layout.Table.Row  row = table.AddRow();
            Siberix.PDF.Layout.Table.Cell cell;
            Siberix.PDF.Layout.Text.Text  text;

            // Version cell
            cell = row.AddCell();
            cell.WidthPercentage = 33;
            cell.TopBorder.Color = Color.LightGray;
            cell.TopBorder.Width = 1;
            text           = cell.AddText();
            text.Alignment = TextAlignment.Left;
            text.Style     = style;
            text.AddContent("v." + System.Windows.Forms.Application.ProductVersion);

            // Page Number
            cell = row.AddCell();
            cell.WidthPercentage = 34;
            cell.TopBorder.Color = Color.LightGray;
            cell.TopBorder.Width = 1;
            text           = cell.AddText();
            text.Alignment = TextAlignment.Center;
            text.Style     = style;
            text.AddContent(string.Format("Page {0}", number));

            // Date
            cell = row.AddCell();
            cell.WidthPercentage = 33;
            cell.TopBorder.Color = Color.LightGray;
            cell.TopBorder.Width = 1;
            text           = cell.AddText();
            text.Alignment = TextAlignment.Right;
            text.Style     = style;
            text.AddContent(DateTime.Now.ToString("g"));

            table.Measure(page.Graphics);
            table.Draw(page.Graphics);
        }
Пример #3
0
        private void AddWinnerRow(Siberix.PDF.Layout.Table.Table table, TrophyDataSet.tblWinnersRow winner)
        {
            Siberix.PDF.Layout.Table.Row  row;
            Siberix.PDF.Layout.Table.Cell cell;
            Siberix.PDF.Layout.Text.Text  text;

            Siberix.PDF.Layout.Text.Style regular = new Siberix.PDF.Layout.Text.Style(WinnerFont, Brushes.Black);

            row = table.AddRow();
            // Year
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            cell.Width         = Px(15);
            cell.WidthIsFixed  = true;
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent(winner.fldYear.ToString());
            // Sail #
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            cell.Width         = Px(30);
            cell.WidthIsFixed  = true;
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent(winner.fldSailNumber);
            // Helm
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent(winner.fldHelm);
            // Owner
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent(winner.fldOwner);
        }
Пример #4
0
        private Siberix.PDF.Layout.Table.Table CreateWinnersTable(Page page, TrophyDataSet.tblTrophiesRow trophy, float top)
        {
            Siberix.PDF.Layout.Table.Table table;
            Siberix.PDF.Layout.Table.Row   row;
            Siberix.PDF.Layout.Table.Cell  cell;
            Siberix.PDF.Layout.Text.Text   text;

            Siberix.PDF.Layout.Text.Style regular = new Siberix.PDF.Layout.Text.Style(WinnerFont, Brushes.Black);

            table = new Siberix.PDF.Layout.Table.Table()
            {
                Left  = Margin,
                Top   = top,
                Width = page.Width - (2 * Margin)
            };

            // Title
            row                  = table.AddRow();
            cell                 = row.AddCell();
            cell.TopPadding      = (top == Margin ? Px(5) : Px(2));
            cell.BottomPadding   = Px(1);
            cell.TopBorder.Width = 1;
            cell.TopBorder.Color = Color.LightGray;
            text                 = cell.AddText();
            text.Style           = new Siberix.PDF.Layout.Text.Style(CaptionFont, Brushes.Black);
            text.Alignment       = TextAlignment.Center;
            text.AddContent(trophy.fldName + " Winners");

            // Column titles
            row = table.AddRow();
            // Year
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            cell.Width         = Px(15);
            cell.WidthIsFixed  = true;
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent("Year");
            // Sail #
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            cell.Width         = Px(30);
            cell.WidthIsFixed  = true;
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent("Sail # / Name");
            // Helm
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent("Helm");
            // Owner
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent("Owner");

            return(table);
        }
Пример #5
0
        private Siberix.PDF.Layout.Table.Table CreateTrophyWinnersTable(Page page, string sailNumber, int count)
        {
            Siberix.PDF.Layout.Table.Table table;
            Siberix.PDF.Layout.Table.Row   row;
            Siberix.PDF.Layout.Table.Cell  cell;
            Siberix.PDF.Layout.Text.Text   text;

            Siberix.PDF.Layout.Text.Style regular = new Siberix.PDF.Layout.Text.Style(WinnerFont, Brushes.Black);

            table = new Siberix.PDF.Layout.Table.Table()
            {
                Left  = Margin,
                Top   = Margin,
                Width = page.Width - (2 * Margin)
            };

            // Title
            row                  = table.AddRow();
            cell                 = row.AddCell();
            cell.TopPadding      = Px(5);
            cell.BottomPadding   = Px(1);
            cell.TopBorder.Width = 1;
            cell.TopBorder.Color = Color.LightGray;
            text                 = cell.AddText();
            text.Style           = new Siberix.PDF.Layout.Text.Style(CaptionFont, Brushes.Black);
            text.Alignment       = TextAlignment.Center;
            text.AddContent(string.Format("Trophies won by '{0}' ({1})", sailNumber, count));

            // Column titles
            row = table.AddRow();
            // Year
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            cell.Width         = Px(15);
            cell.WidthIsFixed  = true;
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent("Year");
            // Trophy
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            cell.Width         = Px(60);
            cell.WidthIsFixed  = true;
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent("Trophy");
            // Class
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            cell.Width         = Px(25);
            cell.WidthIsFixed  = true;
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent("Class");
            // Helm / Crew / Owner
            cell = row.AddCell();
            cell.BottomPadding = Px(1);
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent("Helm, Crew & Owner");

            return(table);
        }
Пример #6
0
        private Siberix.PDF.Layout.Table.Table CreateDetailsTable(Page page, TrophyDataSet.tblTrophiesRow trophy)
        {
            Siberix.PDF.Layout.Table.Table table;
            Siberix.PDF.Layout.Table.Row   row;
            Siberix.PDF.Layout.Table.Cell  cell;
            Siberix.PDF.Layout.Text.Text   text;

            Siberix.PDF.Layout.Text.Style regular = new Siberix.PDF.Layout.Text.Style(WinnerFont, Brushes.Black);

            // Details table
            table = new Siberix.PDF.Layout.Table.Table()
            {
                Left  = Margin,
                Top   = Margin,
                Width = page.Width - (2 * Margin)
            };

            // Header row
            row                  = table.AddRow();
            cell                 = row.AddCell();
            cell.TopPadding      = cell.BottomPadding = Px(5);
            cell.TopBorder.Width = 1;
            cell.TopBorder.Color = Color.LightGray;
            text                 = cell.AddText();
            text.Alignment       = TextAlignment.Center;
            text.Style           = new Siberix.PDF.Layout.Text.Style(TitleFont, Brushes.Black);
            text.AddContent(trophy.fldName);

            // Donated
            row  = table.AddRow();
            cell = row.AddCell();
            cell.BottomPadding = Px(2);
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent(string.Format("Donated by {0} in {1}", trophy.fldDonor, trophy.fldYearDonated));

            // Conditions
            row  = table.AddRow();
            cell = row.AddCell();
            cell.WidthIsFixed  = true;
            cell.Width         = Px(25);
            cell.BottomPadding = Px(2);
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent("Conditions:");
            cell = row.AddCell();
            cell.BottomPadding = Px(2);
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent(trophy.fldConditions);

            // Details
            row  = table.AddRow();
            cell = row.AddCell();
            cell.WidthIsFixed  = true;
            cell.Width         = Px(25);
            cell.BottomPadding = Px(2);
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent("Details:");
            cell = row.AddCell();
            cell.BottomPadding = Px(2);
            text       = cell.AddText();
            text.Style = regular;
            text.AddContent(trophy.fldDetails);

            // Red book page
            if (trophy.fldRedBookPage != 0)
            {
                row  = table.AddRow();
                cell = row.AddCell();
                cell.BottomPadding = Px(2);
                text       = cell.AddText();
                text.Style = regular;
                text.AddContent(string.Format("Red book page #{0}", trophy.fldRedBookPage));
            }

            return(table);
        }
Пример #7
0
        private void DrawFooter(Page page, int number)
        {
            Siberix.PDF.Layout.Table.Table table = new Siberix.PDF.Layout.Table.Table() {
            Left = Margin,
            Top = page.Height - Margin,
            Width = page.Width - (2 * Margin)
              };

              Siberix.PDF.Layout.Text.Style style = new Siberix.PDF.Layout.Text.Style(FooterFont, Brushes.Black);

              Siberix.PDF.Layout.Table.Row row = table.AddRow();
              Siberix.PDF.Layout.Table.Cell cell;
              Siberix.PDF.Layout.Text.Text text;

              // Version cell
              cell = row.AddCell();
              cell.WidthPercentage = 33;
              cell.TopBorder.Color = Color.LightGray;
              cell.TopBorder.Width = 1;
              text = cell.AddText();
              text.Alignment = TextAlignment.Left;
              text.Style = style;
              text.AddContent("v." + System.Windows.Forms.Application.ProductVersion);

              // Page Number
              cell = row.AddCell();
              cell.WidthPercentage = 34;
              cell.TopBorder.Color = Color.LightGray;
              cell.TopBorder.Width = 1;
              text = cell.AddText();
              text.Alignment = TextAlignment.Center;
              text.Style = style;
              text.AddContent(string.Format("Page {0}", number));

              // Date
              cell = row.AddCell();
              cell.WidthPercentage = 33;
              cell.TopBorder.Color = Color.LightGray;
              cell.TopBorder.Width = 1;
              text = cell.AddText();
              text.Alignment = TextAlignment.Right;
              text.Style = style;
              text.AddContent(DateTime.Now.ToString("g"));

              table.Measure(page.Graphics);
              table.Draw(page.Graphics);
        }
Пример #8
0
        private Siberix.PDF.Layout.Table.Table CreateWinnersTable(Page page, TrophyDataSet.tblTrophiesRow trophy, float top)
        {
            Siberix.PDF.Layout.Table.Table table;
              Siberix.PDF.Layout.Table.Row row;
              Siberix.PDF.Layout.Table.Cell cell;
              Siberix.PDF.Layout.Text.Text text;

              Siberix.PDF.Layout.Text.Style regular = new Siberix.PDF.Layout.Text.Style(WinnerFont, Brushes.Black);

              table = new Siberix.PDF.Layout.Table.Table() {
            Left = Margin,
            Top = top,
            Width = page.Width - (2 * Margin)
              };

              // Title
              row = table.AddRow();
              cell = row.AddCell();
              cell.TopPadding = (top == Margin ? Px(5) : Px(2));
              cell.BottomPadding = Px(1);
              cell.TopBorder.Width = 1;
              cell.TopBorder.Color = Color.LightGray;
              text = cell.AddText();
              text.Style = new Siberix.PDF.Layout.Text.Style(CaptionFont, Brushes.Black);
              text.Alignment = TextAlignment.Center;
              text.AddContent(trophy.fldName + " Winners");

              // Column titles
              row = table.AddRow();
              // Year
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              cell.Width = Px(15);
              cell.WidthIsFixed = true;
              text = cell.AddText();
              text.Style = regular;
              text.AddContent("Year");
              // Sail #
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              cell.Width = Px(30);
              cell.WidthIsFixed = true;
              text = cell.AddText();
              text.Style = regular;
              text.AddContent("Sail # / Name");
              // Helm
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              text = cell.AddText();
              text.Style = regular;
              text.AddContent("Helm");
              // Owner
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              text = cell.AddText();
              text.Style = regular;
              text.AddContent("Owner");

              return table;
        }
Пример #9
0
        private Siberix.PDF.Layout.Table.Table CreateTrophyWinnersTable(Page page, string sailNumber, int count)
        {
            Siberix.PDF.Layout.Table.Table table;
              Siberix.PDF.Layout.Table.Row row;
              Siberix.PDF.Layout.Table.Cell cell;
              Siberix.PDF.Layout.Text.Text text;

              Siberix.PDF.Layout.Text.Style regular = new Siberix.PDF.Layout.Text.Style(WinnerFont, Brushes.Black);

              table = new Siberix.PDF.Layout.Table.Table() {
            Left = Margin,
            Top = Margin,
            Width = page.Width - (2 * Margin)
              };

              // Title
              row = table.AddRow();
              cell = row.AddCell();
              cell.TopPadding = Px(5);
              cell.BottomPadding = Px(1);
              cell.TopBorder.Width = 1;
              cell.TopBorder.Color = Color.LightGray;
              text = cell.AddText();
              text.Style = new Siberix.PDF.Layout.Text.Style(CaptionFont, Brushes.Black);
              text.Alignment = TextAlignment.Center;
              text.AddContent(string.Format("Trophies won by '{0}' ({1})", sailNumber, count));

              // Column titles
              row = table.AddRow();
              // Year
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              cell.Width = Px(15);
              cell.WidthIsFixed = true;
              text = cell.AddText();
              text.Style = regular;
              text.AddContent("Year");
              // Trophy
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              cell.Width = Px(60);
              cell.WidthIsFixed = true;
              text = cell.AddText();
              text.Style = regular;
              text.AddContent("Trophy");
              // Class
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              cell.Width = Px(25);
              cell.WidthIsFixed = true;
              text = cell.AddText();
              text.Style = regular;
              text.AddContent("Class");
              // Helm / Crew / Owner
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              text = cell.AddText();
              text.Style = regular;
              text.AddContent("Helm, Crew & Owner");

              return table;
        }
Пример #10
0
        private Siberix.PDF.Layout.Table.Table CreateDetailsTable(Page page, TrophyDataSet.tblTrophiesRow trophy)
        {
            Siberix.PDF.Layout.Table.Table table;
              Siberix.PDF.Layout.Table.Row row;
              Siberix.PDF.Layout.Table.Cell cell;
              Siberix.PDF.Layout.Text.Text text;

              Siberix.PDF.Layout.Text.Style regular = new Siberix.PDF.Layout.Text.Style(WinnerFont, Brushes.Black);

              // Details table
              table = new Siberix.PDF.Layout.Table.Table() {
            Left = Margin,
            Top = Margin,
            Width = page.Width - (2 * Margin)
              };

              // Header row
              row = table.AddRow();
              cell = row.AddCell();
              cell.TopPadding = cell.BottomPadding = Px(5);
              cell.TopBorder.Width = 1;
              cell.TopBorder.Color = Color.LightGray;
              text = cell.AddText();
              text.Alignment = TextAlignment.Center;
              text.Style = new Siberix.PDF.Layout.Text.Style(TitleFont, Brushes.Black);
              text.AddContent(trophy.fldName);

              // Donated
              row = table.AddRow();
              cell = row.AddCell();
              cell.BottomPadding = Px(2);
              text = cell.AddText();
              text.Style = regular;
              text.AddContent(string.Format("Donated by {0} in {1}", trophy.fldDonor, trophy.fldYearDonated));

              // Conditions
              row = table.AddRow();
              cell = row.AddCell();
              cell.WidthIsFixed = true;
              cell.Width = Px(25);
              cell.BottomPadding = Px(2);
              text = cell.AddText();
              text.Style = regular;
              text.AddContent("Conditions:");
              cell = row.AddCell();
              cell.BottomPadding = Px(2);
              text = cell.AddText();
              text.Style = regular;
              text.AddContent(trophy.fldConditions);

              // Details
              row = table.AddRow();
              cell = row.AddCell();
              cell.WidthIsFixed = true;
              cell.Width = Px(25);
              cell.BottomPadding = Px(2);
              text = cell.AddText();
              text.Style = regular;
              text.AddContent("Details:");
              cell = row.AddCell();
              cell.BottomPadding = Px(2);
              text = cell.AddText();
              text.Style = regular;
              text.AddContent(trophy.fldDetails);

              // Red book page
              if (trophy.fldRedBookPage != 0) {
            row = table.AddRow();
            cell = row.AddCell();
            cell.BottomPadding = Px(2);
            text = cell.AddText();
            text.Style = regular;
            text.AddContent(string.Format("Red book page #{0}", trophy.fldRedBookPage));
              }

              return table;
        }
Пример #11
0
        private void AddWinnerRow(Siberix.PDF.Layout.Table.Table table, TrophyDataSet.tblWinnersRow winner)
        {
            Siberix.PDF.Layout.Table.Row row;
              Siberix.PDF.Layout.Table.Cell cell;
              Siberix.PDF.Layout.Text.Text text;

              Siberix.PDF.Layout.Text.Style regular = new Siberix.PDF.Layout.Text.Style(WinnerFont, Brushes.Black);

              row = table.AddRow();
              // Year
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              cell.Width = Px(15);
              cell.WidthIsFixed = true;
              text = cell.AddText();
              text.Style = regular;
              text.AddContent(winner.fldYear.ToString());
              // Sail #
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              cell.Width = Px(30);
              cell.WidthIsFixed = true;
              text = cell.AddText();
              text.Style = regular;
              text.AddContent(winner.fldSailNumber);
              // Helm
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              text = cell.AddText();
              text.Style = regular;
              text.AddContent(winner.fldHelm);
              // Owner
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              text = cell.AddText();
              text.Style = regular;
              text.AddContent(winner.fldOwner);
        }
Пример #12
0
        private void AddTrophyWinnerRow(Siberix.PDF.Layout.Table.Table table, TrophyDataSet.TrophyWinnersRow winner)
        {
            Siberix.PDF.Layout.Table.Row row;
              Siberix.PDF.Layout.Table.Cell cell;
              Siberix.PDF.Layout.Text.Text text;

              Siberix.PDF.Layout.Text.Style regular = new Siberix.PDF.Layout.Text.Style(WinnerFont, Brushes.Black);

              row = table.AddRow();
              // Year
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              cell.Width = Px(15);
              cell.WidthIsFixed = true;
              text = cell.AddText();
              text.Style = regular;
              text.AddContent(winner.fldYear.ToString());
              // Trophy
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              cell.Width = Px(60);
              cell.WidthIsFixed = true;
              text = cell.AddText();
              text.Style = regular;
              text.AddContent(winner.fldTrophyName);
              // Class
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              cell.Width = Px(25);
              cell.WidthIsFixed = true;
              text = cell.AddText();
              text.Style = regular;
              text.AddContent(winner.fldClassName);

              // Helm / Crew / Owner
              cell = row.AddCell();
              cell.BottomPadding = Px(1);
              text = cell.AddText();
              text.Style = regular;

              string helm = winner.fldHelm;
              if (winner.fldCrew.Length != 0) {
            if (helm.Length != 0)
              helm += " / ";
            helm += winner.fldCrew;
              }
              if (winner.fldOwner.Length != 0) {
            if (helm.Length != 0)
              helm += "\n";
            helm += "Owner: " + winner.fldOwner;
              }
              text.AddContent(helm);
        }