Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > .NET Frameworks (точка нет фреймворки) > WPF, UWP, WinRT, XAML
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 02.12.2013, 19:34   #1
Promolol
 
Регистрация: 21.05.2010
Сообщений: 5
По умолчанию Обрезается область печати

Здравствуйте!

Помогите решить проблему, печатаю Table с msdn:

Код:
 FlowDocument myFlowDocument = new FlowDocument();
            //myFlowDocument.Blocks.Add(myParagraph);
            Table table1 = new Table();
 
            int numberOfColumns = 6;
            for (int x = 0; x < numberOfColumns; x++)
            {
                table1.Columns.Add(new TableColumn());
 
                // Set alternating background colors for the middle colums. 
                if (x % 2 == 0)
                    table1.Columns[x].Background = Brushes.White;
                else
                    table1.Columns[x].Background = Brushes.White;
 
                table1.Columns[x].Width = new GridLength(70);
            }
 
 
            // Create and add an empty TableRowGroup to hold the table's Rows.
            table1.RowGroups.Add(new TableRowGroup());
 
            // Add the first (title) row.
            table1.RowGroups[0].Rows.Add(new TableRow());
 
            // Alias the current working row for easy reference.
            TableRow currentRow = table1.RowGroups[0].Rows[0];
 
            // Global formatting for the title row.
            currentRow.Background = Brushes.White;
            currentRow.FontSize = 15;
            currentRow.FontWeight = System.Windows.FontWeights.Bold;
 
            // Add the header row with content, 
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Премия мастерам"))));
            // and set the row to span all 6 columns.
            currentRow.Cells[0].ColumnSpan = 6;
 
            // Add the second (header) row.
            table1.RowGroups[0].Rows.Add(new TableRow());
            currentRow = table1.RowGroups[0].Rows[1];
 
            // Global formatting for the header row.
            currentRow.FontSize = 18;
            currentRow.FontWeight = FontWeights.Bold;
 
            // Add cells with content to the second row.
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Бригада"))));
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("ФИО"))));
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Сумма 100%"))));
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Сумма 30%"))));
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Выплата"))));
            //currentRow.Cells[0].ColumnSpan = 4;
            // Add the third row.
            table1.RowGroups[0].Rows.Add(new TableRow());
            currentRow = table1.RowGroups[0].Rows[2];
 
            // Global formatting for the row.
            currentRow.FontSize = 12;
            currentRow.FontWeight = FontWeights.Normal;
 
            // Add cells with content to the third row.
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Widgets"))));
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("$50,000"))));
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("$55,000"))));
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("$60,000"))));
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("$65,000"))));
            //currentRow.Cells[0].ColumnSpan = 2;
            // Bold the first cell.
            currentRow.Cells[0].FontWeight = FontWeights.Bold;
 
            table1.RowGroups[0].Rows.Add(new TableRow());
            currentRow = table1.RowGroups[0].Rows[3];
 
            // Global formatting for the footer row.
            currentRow.Background = Brushes.LightGray;
            currentRow.FontSize = 18;
            currentRow.FontWeight = System.Windows.FontWeights.Normal;
 
            // Add the header row with content, 
            currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Projected 2004 Revenue: $810,000"))));
            // and set the row to span all 6 columns.
            currentRow.Cells[0].ColumnSpan = 6;
 
 
            myFlowDocument.Blocks.Add(table1);              
 
            //Print the document
            PrintDialog dialog = new PrintDialog();
            if (dialog.ShowDialog() == true)
            {
                int margin = 0;
                Size pageSize = new Size(dialog.PrintableAreaWidth - margin * 2, dialog.PrintableAreaHeight - margin * 2);
                IDocumentPaginatorSource paginator = myFlowDocument;
                paginator.DocumentPaginator.PageSize = pageSize;
                dialog.PrintDocument(paginator.DocumentPaginator, "Flow print");
            }

скрин проблемы прикрепляю.

Направьте на путь истинный.
Изображения
Тип файла: jpg screen.jpg (12.8 Кб, 113 просмотров)
Promolol вне форума Ответить с цитированием
Старый 03.12.2013, 15:43   #2
Promolol
 
Регистрация: 21.05.2010
Сообщений: 5
По умолчанию

Тупицы, тема закрыта, сам все сделал
Promolol вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Обрезается referrer CodeNOT PHP 4 01.12.2012 15:21
Как в макросе задать область печати выделенного фрагмена? vpm Microsoft Office Excel 4 14.11.2012 12:33
Жадная область печати tolikman Microsoft Office Word 1 22.01.2010 18:35
css меню обрезается другим div retail_ret HTML и CSS 2 13.08.2009 16:50