Esempio n. 1
0
        public C1.C1Preview.C1PrintDocument MakeDoc(C1.Win.C1FlexGrid.C1FlexGridPrintInfo printInfo, C1.C1Preview.LongOperationEventHandler longOperation)
        {
            MarkPageBreaks();

            C1.C1Preview.C1PrintDocument doc = new C1.C1Preview.C1PrintDocument();

            C1.C1Preview.RenderText hdrFlex = new C1.C1Preview.RenderText("Header for Flex");
            hdrFlex.Style.FontSize       = 12;
            hdrFlex.Style.FontBold       = true;
            hdrFlex.Style.Spacing.Bottom = "2mm";
            doc.Body.Children.Add(hdrFlex);

            C1.Win.C1FlexGrid.C1FlexGridPrinter pFlex = new C1.Win.C1FlexGrid.C1FlexGridPrinter(_flex);
            pFlex.LongOperation += longOperation;
            pFlex.PrintInfo      = printInfo;
            doc.Body.Children.Add(pFlex.MakeGridTable(doc));

            C1.C1Preview.RenderText hdrFlex2 = new C1.C1Preview.RenderText("Header for Flex 2");
            hdrFlex2.Style.FontSize       = 12;
            hdrFlex2.Style.FontBold       = true;
            hdrFlex2.Style.Spacing.Bottom = "2mm";
            hdrFlex2.BreakBefore          = C1.C1Preview.BreakEnum.Page;
            doc.Body.Children.Add(hdrFlex2);

            C1.Win.C1FlexGrid.C1FlexGridPrinter pFlex2 = new C1.Win.C1FlexGrid.C1FlexGridPrinter(_flex2);
            pFlex2.LongOperation += longOperation;
            pFlex2.PrintInfo      = printInfo;
            doc.Body.Children.Add(pFlex2.MakeGridTable(doc));

            return(doc);
        }
Esempio n. 2
0
        public C1.C1Preview.C1PrintDocument MakeDoc(C1.Win.C1FlexGrid.C1FlexGridPrintInfo printInfo)
        {
            C1FlexGrid flex = _tab.SelectedTab.Controls[0] as C1FlexGrid;

            if (flex == null)
            {
                return(null);
            }

            C1.Win.C1FlexGrid.C1FlexGridPrinter printer = new C1.Win.C1FlexGrid.C1FlexGridPrinter(flex);
            C1.C1Preview.C1PrintDocument        doc     = new C1.C1Preview.C1PrintDocument();
            printer.PrintInfo = printInfo;
            C1.C1Preview.RenderObject gridRO = printer.MakeGridTable(doc);
            // if flex grid borders are not printed, provide our own:
            if (!printInfo.PrintBorders)
            {
                gridRO.Style.GridLines.All = new C1.C1Preview.LineDef("0.5pt", Color.LightGray);
            }
            doc.Body.Children.Add(gridRO);
            doc.PageLayout.PageHeader = printer.MakePageHeader(doc);
            doc.PageLayout.PageFooter = printer.MakePageFooter(doc);
            return(doc);
        }