示例#1
0
 public bool Contains(AliasCollectionItem value)
 {
     // If value is not of type AliasCollectionItem, this will return false.
     return(List.Contains(value));
 }
示例#2
0
 public void Remove(AliasCollectionItem value)
 {
     List.Remove(value);
 }
示例#3
0
 public void Insert(int index, AliasCollectionItem value)
 {
     List.Insert(index, value);
 }
示例#4
0
 public int IndexOf(AliasCollectionItem value)
 {
     return(List.IndexOf(value));
 }
示例#5
0
 public int Add(AliasCollectionItem value)
 {
     return(List.Add(value));
 }
示例#6
0
        override public void BeginPrint(PrintOut driver)
        {
            base.BeginPrint(driver);
            if (FExecuting)
            {
                FExecuting = false;
            }
            EndPrint();
            // Forward only apply to synchronous single pass report processing
            if (TwoPass || AsyncExecution)
            {
                MetaFile.ForwardOnly = false;
            }
            mmfirst = System.DateTime.Now;
            FDriver = driver;
            if (!FCompose)
            {
                MetaFile.Clear();
            }

            MetaFile.Empty = false;
            try
            {
                MetaFile.PrinterFonts = PrinterFonts;
                UpdatePageSize        = false;
                FillGlobalHeaders();
                PendingSections.Clear();
                ErrorProcessing = false;
                if (driver == null)
                {
                    throw new UnNamedException("No Driver assigned");
                }
                MetaFile.PrinterSelect = this.PrinterSelect;
                FDriver.SelectPrinter(PrinterSelect);
                if (FCompose)
                {
                    MetaFile.ForwardOnly = false;
                    InternalPageWidth    = MetaFile.CustomX;
                    InternalPageHeight   = MetaFile.CustomY;
                    PageNum = MetaFile.Pages.CurrentCount - 2;
                }
                else
                {
                    Point apagesize;
                    MetaFile.Empty          = false;
                    MetaFile.PrinterFonts   = PrinterFonts;
                    MetaFile.PreviewAbout   = PreviewAbout;
                    MetaFile.PreviewMargins = PreviewMargins;
                    MetaFile.LinesPerInch   = LinesPerInch;
                    MetaFile.PaperSource    = PaperSource;
                    // Sets page orientation
                    CurrentOrientation = PageOrientation;
                    if (PageOrientation != OrientationType.Default)
                    {
                        FDriver.SetOrientation(PageOrientation);
                    }
                    PageDetail.PaperSource    = PaperSource;
                    PageDetail.Duplex         = Duplex;
                    PageDetail.ForcePaperName = ForcePaperName;
                    if (PageSize != PageSizeType.Default)
                    {
                        if (PageSize == PageSizeType.User)
                        {
                            MetaFile.PageSizeIndex  = -1;
                            PageDetail.Index        = PageSizeIndex;
                            PageDetail.Custom       = true;
                            PageDetail.CustomHeight = CustomPageHeight;
                            PageDetail.CustomWidth  = CustomPageWidth;
                        }
                        else
                        {
                            MetaFile.PageSizeIndex  = PageSizeIndex;
                            PageDetail.Index        = PageSizeIndex;
                            PageDetail.Custom       = false;
                            PageDetail.CustomWidth  = CustomPageWidth;
                            PageDetail.CustomHeight = CustomPageHeight;
                        }
                        apagesize = FDriver.SetPageSize(PageDetail);
                    }
                    else
                    {
                        int newpagesize = MetaFile.PageSizeIndex;
                        apagesize = FDriver.GetPageSize(out newpagesize);
                        MetaFile.PageSizeIndex = newpagesize;
                    }
                    InternalPageWidth    = apagesize.X;
                    InternalPageHeight   = apagesize.Y;
                    MetaFile.Orientation = PageOrientation;
                    MetaFile.BackColor   = PageBackColor;
                    MetaFile.CustomX     = InternalPageWidth;
                    MetaFile.CustomY     = InternalPageHeight;
                    PageNum = -1;
                }
                MetaFile.PrinterSelect    = PrinterSelect;
                MetaFile.AutoScale        = AutoScale;
                MetaFile.PreviewWindow    = PreviewWindow;
                MetaFile.OpenDrawerAfter  = ActionAfter;
                MetaFile.OpenDrawerBefore = ActionBefore;
                int i;
                for (i = 0; i < SubReports.Count; i++)
                {
                    SubReports[i].LastRecord = false;
                }
                LastPage = false;
                InitEvaluator();
                PageNumGroup = -1;
                FRecordCount = 0;

                InitializeParams();

                FDataAlias.List.Clear();
                for (i = 0; i < DataInfo.Count; i++)
                {
                    AliasCollectionItem aitem = new AliasCollectionItem();
                    aitem.Alias = DataInfo[i].Alias;
                    aitem.Data  = DataInfo[i].Data;
                    FDataAlias.List.Add(aitem);
                }
                try
                {
                    ActivateDatasets();
                }
                catch
                {
                    DeActivateDatasets();
                    throw;
                }
                CheckIfDataAvailable();
                Evaluator.AliasList = FDataAlias;

                PrepareParamsAfterOpen();
                for (i = 0; i < SubReports.Count; i++)
                {
                    SubReports[i].SubReportChanged(SubReportEvent.Start, "");
                }
                CurrentSubReportIndex = -1;
                SubReport subrep;
                bool      dataavail = false;
                do
                {
                    CurrentSubReportIndex++;
                    if (CurrentSubReportIndex >= SubReports.Count)
                    {
                        break;
                    }
                    subrep = SubReports[CurrentSubReportIndex];
                    if (subrep.ParentSubReport == null)
                    {
                        if (subrep.Alias.Length == 0)
                        {
                            dataavail = true;
                        }
                        else
                        {
                            if (subrep.PrintOnlyIfDataAvailable)
                            {
                                int index = DataInfo.IndexOf(subrep.Alias);
                                if (!DataInfo[index].Data.Eof)
                                {
                                    dataavail = true;
                                }
                            }
                            else
                            {
                                dataavail = true;
                            }
                        }
                    }
                    if (dataavail)
                    {
                        subrep.SubReportChanged(SubReportEvent.SubReportStart, "");
                        subrep.SubReportChanged(SubReportEvent.DataChange, "");
                        CurrentSectionIndex      = -1;
                        subrep.CurrentGroupIndex = -subrep.GroupCount;
                        if (subrep.CurrentGroupIndex < 0)
                        {
                            CurrentSectionIndex = subrep.FirstDetail + subrep.CurrentGroupIndex - 1;
                        }
                        section   = null;
                        subreport = null;
                        if (!NextSection(true))
                        {
                            dataavail = false;
                        }
                    }
                } while (!dataavail);
                if (!dataavail)
                {
                    EndPrint();
                    AbortingThread = true;
                    MetaFile.Empty = true;
                    throw new NoDataToPrintException(Translator.TranslateStr(799));
                }
                printing = true;
            }
            catch
            {
                MetaFile.Empty = true;
                throw;
            }
        }