コード例 #1
0
        public BalanceReportdata(BalanceClient blc, HeaderData hdrData)
        {
            this.blc     = blc;
            this.hdrData = hdrData;
            var header = (blc.Acc == null || blc.AccountTypeEnum == GLAccountTypes.Header);

            this.Col1  = new CustomColumn(blc.Col1, hdrData.ShowDCCol1, header);
            this.Col2  = new CustomColumn(blc.Col2, hdrData.ShowDCCol2, header);
            this.Col3  = new CustomColumn(blc.Col3, hdrData.ShowDCCol3, header);
            this.Col4  = new CustomColumn(blc.Col4, hdrData.ShowDCCol4, header);
            this.Col5  = new CustomColumn(blc.Col5, hdrData.ShowDCCol5, header);
            this.Col6  = new CustomColumn(blc.Col6, hdrData.ShowDCCol6, header);
            this.Col7  = new CustomColumn(blc.Col7, hdrData.ShowDCCol7, header);
            this.Col8  = new CustomColumn(blc.Col8, hdrData.ShowDCCol8, header);
            this.Col9  = new CustomColumn(blc.Col9, hdrData.ShowDCCol9, header);
            this.Col10 = new CustomColumn(blc.Col10, hdrData.ShowDCCol10, header);
            this.Col11 = new CustomColumn(blc.Col11, hdrData.ShowDCCol11, header);
            this.Col12 = new CustomColumn(blc.Col12, hdrData.ShowDCCol12, header);
            this.Col13 = new CustomColumn(blc.Col13, hdrData.ShowDCCol13, header);
        }
コード例 #2
0
        public BalanceReportTemplatePrint(object sourceData, object sourceHeaderData, object objBalance, object frontPageReport)
        {
            InitializeComponent();
            var        bal        = (Balance)objBalance;
            HeaderData headerdata = (HeaderData)sourceHeaderData;

            if (string.IsNullOrEmpty(headerdata.BalanceName))
            {
                headerdata.BalanceName = Uniconta.ClientTools.Localization.lookup("ReportCriteria");
            }
            headerdata.AccountColWidth     = bal.ColumnSizeAccount == (byte)0 ? 80 : bal.ColumnSizeAccount;
            headerdata.AccountNameColWidth = bal.ColumnSizeName == (byte)0 ? 200 : bal.ColumnSizeName;
            headerdata.LineSpace           = new Thickness(0, 0, 0, bal.LineSpace);
            headerdata.LeftMargin          = new Thickness(bal.LeftMargin, 0, 0, 0);
            headerdata.DimColWidth         = bal.ColumnSizeDim == (byte)0 ? 90 : bal.ColumnSizeDim;
            headerdata.DClblWidth          = bal.ColumnSizeAmount == (byte)0 ? 100 : bal.ColumnSizeAmount;
            headerdata.FontSize            = bal.FontSize == 0 ? 12 : bal.FontSize;
            headerdata.AmountSize          = bal.ColumnSizeAmount;
#if !SILVERLIGHT
            List <List <TemplateDataItems> > simpleLinkItems = new List <List <TemplateDataItems> >();
            var currentItems = ((TemplateDataContext)sourceData).TemplateReportlist;
            List <TemplateDataItems> currentLinkItems = new List <TemplateDataItems>();
            for (int i = 0; i < currentItems.Count; i++)
            {
                currentLinkItems.Add(currentItems[i]);
                if (currentItems[i].IsNewPage == Visibility.Visible)
                {
                    simpleLinkItems.Add(currentLinkItems);
                    currentLinkItems = new List <TemplateDataItems>();
                }
                if (i == currentItems.Count - 1)
                {
                    simpleLinkItems.Add(currentLinkItems);
                }
            }
            DevExpress.XtraPrinting.PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem();
            ps.Graph.PageBackColor = System.Drawing.Color.Transparent;
            //Setting the default Printer
            if (!string.IsNullOrEmpty(session.User._Printer))
            {
                ps.PageSettings.PrinterName = session.User._Printer;
            }
            List <TemplatedLink> links = new List <TemplatedLink>();
            var frontPageText          = bal._FrontPage;
            if (!string.IsNullOrEmpty(frontPageText) && bal._PrintFrontPage)
            {
                if (frontPageReport is DevExpress.XtraReports.UI.XtraReport)
                {
                    var balanceFrontPageList = StandardPrintReportPage.AssignWatermark(frontPageReport as DevExpress.XtraReports.UI.XtraReport);
                    ps.Pages.AddRange(balanceFrontPageList);
                }
                else
                {
                    var frontPageLink = BalanceReportPrint.CreateFrontPageLink(frontPageText, bal._Landscape, bal.FontSize, (DataTemplate)this.Resources["frontPageHeaderTemplate"]);
                    frontPageLink.CreateDocument(false);
                    links.Add(frontPageLink);
                }
            }
            foreach (List <TemplateDataItems> e in simpleLinkItems)
            {
                var templateLink = CreateLink(headerdata, e, ((Balance)objBalance)._Landscape);
                templateLink.CreateDocument(false);
                links.Add(templateLink);
            }

            foreach (var link in links)
            {
                ps.Pages.AddRange(link.PrintingSystem.Pages);
            }
            custPrint.DocumentSource = ps;
#endif
#if SILVERLIGHT
            TemplatePrintBaseModule printbase = new TemplatePrintBaseModule();
            printbase.PageHeaderTemplate                   = (DataTemplate)this.Resources["pageHeaderTemplate"];
            printbase.DetailTemplate                       = (DataTemplate)this.Resources["detailTemplate"];
            printbase.HeaderTemplateDataContext            = headerdata;
            printbase.DetailsTemplateDataContext           = (TemplateDataContext)sourceData;
            printbase.HeaderTemplateDataContext._Landscape = ((Balance)objBalance)._Landscape;
            this.DataContext = printbase;
#endif
        }