Пример #1
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="AResult"></param>
        /// <param name="AParameters"></param>
        /// <param name="APrinter"></param>
        /// <param name="AWrapColumn">True: Wrap text in the column if it is to long. Otherwise cut it</param>
        public TReportPrinterLayout(TResultList AResult, TParameterList AParameters, TPrinter APrinter, bool AWrapColumn) : base(AResult, AParameters,
                                                                                                                                APrinter)
        {
            FWrapColumn = AWrapColumn;

            if (AParameters.Get("ReportWidth").ToDouble() > 20)
            {
                APrinter.Init(eOrientation.eLandscape, this, eMarginType.eDefaultMargins);
            }
            else
            {
                APrinter.Init(eOrientation.ePortrait, this, eMarginType.eDefaultMargins);
            }
        }
Пример #2
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="AHtmlDocument"></param>
        /// <param name="APath">Used for embedding images</param>
        /// <param name="APrinter"></param>
        public TPrinterHtml(string AHtmlDocument, string APath, TPrinter APrinter)
        {
            FPrinter = APrinter;
            FPath = APath;

            if (AHtmlDocument != "")
            {
                AHtmlDocument = AHtmlDocument.Replace("<pagebreak/>", "</body><body>");
                AHtmlDocument = AHtmlDocument.Replace("<pagebreak>", "</body><body>");
                AHtmlDocument = RemoveElement(AHtmlDocument, "div", "class", "PageHeader", out FPageHeader);

                FHtmlDoc = ParseHtml(AHtmlDocument);
            }
            else
            {
                FHtmlDoc = new XmlDocument();
            }
        }
Пример #3
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="AHtmlFile"></param>
 /// <param name="APrinter"></param>
 public TPrinterHtml(string AHtmlFile, TPrinter APrinter)
 {
     FPrinter = APrinter;
     FPath = System.IO.Path.GetDirectoryName(AHtmlFile);
     StreamReader sr = new StreamReader(AHtmlFile, System.Text.Encoding.Default);
     string htmlDocument = sr.ReadToEnd();
     sr.Close();
     htmlDocument = RemoveElement(htmlDocument, "div", "class", "PageHeader", out FPageHeader);
     FHtmlDoc = ParseHtml(htmlDocument);
 }
Пример #4
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="AResult"></param>
 /// <param name="AParameters"></param>
 /// <param name="APrinter"></param>
 public TReportPrinterCommon(TResultList AResult, TParameterList AParameters, TPrinter APrinter)
 {
     // go through all results and parameters and replace the unformatted and encoded date
     // the whole point is to format the dates differently, depending on the output (printer vs. CSV)
     FParameters = AParameters.ConvertToFormattedStrings("Localized");
     FResultList = AResult.ConvertToFormattedStrings(FParameters, "Localized");
     FResults = FResultList.GetResults();
     FLowestLevel = FParameters.Get("lowestLevel").ToInt();
     FTimePrinted = DateTime.Now;
     FPrinter = APrinter;
 }