Exemplo n.º 1
0
        private static void AddPageHeader(ref StiPage page, ref StiText headerText)
        {
            #region Header
            //Create TitleBand
            StiPageHeaderBand pageHeaderBand = new StiPageHeaderBand();
            pageHeaderBand.Height  = 0.5;
            pageHeaderBand.Name    = "pageHeaderBand";
            pageHeaderBand.Enabled = true;
            page.Components.Add(pageHeaderBand);

            //Create Title text on header
            headerText.Text         = DateTime.Now.ToString(); // Common.Date.GetGregorianDate(currentDateTime, Common.Date.DateStringType.Short);
            headerText.Height       = 0.5;
            headerText.HorAlignment = StiTextHorAlignment.Right;
            headerText.Name         = "TitleHeader";
            //headerText.Font = new System.Drawing.Font("Nazanin", 12F);
            pageHeaderBand.Components.Add(headerText);

            // Create Title text on header
            StiText pageNumberText = new StiText(new RectangleD(0, 0, page.Width, 0.5));
            headerText.Height           = 0.5;
            pageNumberText.Text         = "{PageNumber}" + "-" + "{TotalPageCount}";
            pageNumberText.HorAlignment = StiTextHorAlignment.Left;
            pageNumberText.Name         = "pageNumberText";
            //headerText.Font = new System.Drawing.Font("Nazanin", 12F);
            pageHeaderBand.Components.Add(pageNumberText);

            #endregion
        }
Exemplo n.º 2
0
        private void ReadPageHeaderBand(XmlNode node, StiPage page)
        {
            StiPageHeaderBand band = new StiPageHeaderBand();

            page.Components.Add(band);

            ReadBand(node, band);
        }
Exemplo n.º 3
0
        private void ReadTopMarginBand(XtraReportBase xtraReport, TopMarginBand xtraBand, StiPage page)
        {
            StiPageHeaderBand band = new StiPageHeaderBand();

            page.Components.Add(band);

            ReadBand(xtraBand, band);

            page.Margins.Top = page.Margins.Top - report.Unit.ConvertToHInches(band.Height);
        }
Exemplo n.º 4
0
        public IReportBuilder WithPageHeaderBand(string title, string subTitle, double height = 0.2, bool showDatetime = true, bool showPaging = true)
        {
            CurrentPageHeader = new StiPageHeaderBand(MakeRectangle(0, 0, 0, height));
            Page.Components.Add(CurrentPageHeader);


            var stiTitle = _textBuilder.New(title).WithSize(Page.Width).WithAlign(StiTextHorAlignment.Center)
                           .WithFont(FontStyle.Bold, 14).WithBorder(StiBorderSides.None).WithDockStyle(StiDockStyle.Top).Then();

            CurrentPageHeader.Components.Add(stiTitle);

            var stiSubTitle = _textBuilder.New(subTitle).WithPosition(0, 0.2).WithSize(Page.Width).WithAlign(StiTextHorAlignment.Center)
                              .WithFont(FontStyle.Bold, 13).WithBorder(StiBorderSides.None).WithDockStyle(StiDockStyle.Top).Then();

            CurrentPageHeader.Components.Add(stiSubTitle);


            var xdec = _textBuilder.New("{Xdec}").WithPosition(0.2, 0.2).WithSize(2).WithAlign(StiTextHorAlignment.Center)
                       .WithFont(FontStyle.Bold, 15).Then();

            CurrentPageHeader.Components.Add(xdec);


            CurrentPageHeader.BeforePrintEvent = new StiBeforePrintEvent("Xdec=Xdec+1;");
            CurrentPageHeader.AfterPrintEvent  = new StiAfterPrintEvent("Xdec=Xdec+1;");



            if (showDatetime)
            {
                var top     = CurrentPageHeader.Height - 0.2;
                var stiText = _textBuilder.New($"<b>Date/Time:</b> {DateTime.Now}").WithPosition(0, top).
                              WithSize(2).WithBorder(StiBorderSides.None).Then();
                CurrentPageHeader.Components.Add(stiText);
            }

            if (showPaging)
            {
                var top     = CurrentPageHeader.Height - 0.2;
                var left    = Page.Width - 2;
                var stiText = _textBuilder.New("{PageNofM}").WithPosition(left, top).WithSize(2).WithAlign(StiTextHorAlignment.Right)
                              .WithBorder(StiBorderSides.None).WithDockStyle(StiDockStyle.Top).Then();
                CurrentPageHeader.Components.Add(stiText);
            }

            return(this);
        }
Exemplo n.º 5
0
 public PageTextProperties(IPageHeaderTextBox builder, StiPageHeaderBand band, StiText currentText) : base(currentText)
 {
     _builder = builder;
     _band    = band;
 }
Exemplo n.º 6
0
 private void InitializeComponent()
 {
     T_Detail = new T_DetailDataSource();
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyName", "MyCompanyName", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyTaxCode", "MyCompanyTaxCode", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyDirectorName", "MyCompanyDirectorName", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyCountryCode", "MyCompanyCountryCode", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyCountryName", "MyCompanyCountryName", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyCity", "MyCompanyCity", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyPostalCode", "MyCompanyPostalCode", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyAddress", "MyCompanyAddress", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyPhone", "MyCompanyPhone", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyFax", "MyCompanyFax", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyBankName", "MyCompanyBankName", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyBankCode", "MyCompanyBankCode", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyBankAccountNumber", "MyCompanyBankAccountNumber", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyVATPayerFlag", "MyCompanyVATPayerFlag", "", typeof(bool), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyConditionalUnitCurrencyCode", "MyCompanyConditionalUnitCurrencyCode", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyDefaultTradingCurrencyCode", "MyCompanyDefaultTradingCurrencyCode", "", typeof(string), "", false, false, false));
     Dictionary.Variables.Add(new StiVariable("", "MyCompanyConditionalUnitCurrencyRate", "MyCompanyConditionalUnitCurrencyRate", "", typeof(decimal), "", false, false, false));
     NeedsCompiling = false;
     // Variables init
     // Variables init
     MyCompanyName                        = "";
     MyCompanyTaxCode                     = "";
     MyCompanyDirectorName                = "";
     MyCompanyCountryCode                 = "";
     MyCompanyCountryName                 = "";
     MyCompanyCity                        = "";
     MyCompanyPostalCode                  = "";
     MyCompanyAddress                     = "";
     MyCompanyPhone                       = "";
     MyCompanyFax                         = "";
     MyCompanyBankName                    = "";
     MyCompanyBankCode                    = "";
     MyCompanyBankAccountNumber           = "";
     MyCompanyVATPayerFlag                = false;
     MyCompanyConditionalUnitCurrencyCode = "";
     MyCompanyDefaultTradingCurrencyCode  = "";
     MyCompanyConditionalUnitCurrencyRate = 0m;
     EngineVersion                        = StiEngineVersion.EngineV2;
     ReferencedAssemblies                 = new[] {
         "System.Dll",
         "System.Drawing.Dll",
         "System.Windows.Forms.Dll",
         "System.Data.Dll",
         "System.Xml.Dll",
         "Stimulsoft.Controls.Dll",
         "Stimulsoft.Base.Dll",
         "Stimulsoft.Report.Dll"
     };
     ReportAlias  = "Rpt Produc Location Price";
     ReportAuthor = "Programmer.GE";
     //
     // ReportChanged
     //
     ReportChanged = new DateTime(2011, 6, 12, 21, 55, 48, 0);
     //
     // ReportCreated
     //
     ReportCreated     = new DateTime(2009, 6, 28, 22, 3, 23, 0);
     ReportDescription = "პრაისი";
     ReportFile        = "D:\\User\\Documents\\Projects\\Apothex\\Source\\Class Library\\Apothex.Reporting\\Product" +
                         "ion\\RptProducLocationPrice.mrt";
     ReportGuid     = "e242476ffaeb44b39344532841ed84f0";
     ReportName     = "RptProducLocationPrice";
     ReportUnit     = StiReportUnitType.Centimeters;
     ReportVersion  = "2010.3.900";
     ScriptLanguage = StiReportLanguageType.CSharp;
     //
     // Page1
     //
     Page1            = new StiPage();
     Page1.Columns    = 2;
     Page1.Guid       = "0edad2017ef5402da56612e0faa7a32a";
     Page1.Name       = "Page1";
     Page1.PageHeight = 29.7;
     Page1.PageWidth  = 21;
     Page1.PaperSize  = PaperKind.A4;
     Page1.Border     = new StiBorder(StiBorderSides.None, Color.Black, 2, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     Page1.Brush      = new StiSolidBrush(Color.Transparent);
     //
     // PageHeaderBand1
     //
     PageHeaderBand1 = new StiPageHeaderBand();
     PageHeaderBand1.ClientRectangle = new RectangleD(0, 0.4, 20, 2.2);
     PageHeaderBand1.Name            = "PageHeaderBand1";
     PageHeaderBand1.PrintOn         = StiPrintOnType.OnlyFirstPage;
     PageHeaderBand1.Border          = new StiBorder(StiBorderSides.None, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     PageHeaderBand1.Brush           = new StiSolidBrush(Color.Transparent);
     //
     // Text4
     //
     Text4 = new StiText();
     Text4.ClientRectangle = new RectangleD(2.4, 0, 7.6, 2);
     Text4.Name            = "Text4";
     Text4.GetValue       += new StiGetValueEventHandler(Text4__GetValue);
     Text4.VertAlignment   = StiVertAlignment.Center;
     Text4.Border          = new StiBorder(StiBorderSides.None, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     Text4.Brush           = new StiSolidBrush(Color.Transparent);
     Text4.Font            = new Font("BPG Glaho Arial", 7F, FontStyle.Bold);
     Text4.Guid            = null;
     Text4.Interaction     = null;
     Text4.Margins         = new StiMargins(0, 0, 0, 0);
     Text4.TextBrush       = new StiSolidBrush(Color.Black);
     Text4.TextOptions     = new StiTextOptions(false, false, false, 0F, HotkeyPrefix.None, StringTrimming.None);
     //
     // Image1
     //
     Image1                      = new StiImage();
     Image1.AspectRatio          = true;
     Image1.ClientRectangle      = new RectangleD(0, 0, 2, 2);
     Image1.Guid                 = "b4725dd4d92a41f5a0f373916b5b430e";
     Image1.HorAlignment         = StiHorAlignment.Center;
     Image1.Name                 = "Image1";
     Image1.Stretch              = true;
     Image1.VertAlignment        = StiVertAlignment.Center;
     Image1.Border               = new StiBorder(StiBorderSides.None, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     Image1.Brush                = new StiSolidBrush(Color.Transparent);
     Image1.Image                = null;
     Image1.Interaction          = null;
     PageHeaderBand1.Guid        = null;
     PageHeaderBand1.Interaction = null;
     //
     // PageFooterBand1
     //
     PageFooterBand1 = new StiPageFooterBand();
     PageFooterBand1.ClientRectangle = new RectangleD(0, 28.1, 20, 0.6);
     PageFooterBand1.Name            = "PageFooterBand1";
     PageFooterBand1.Border          = new StiBorder(StiBorderSides.None, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     PageFooterBand1.Brush           = new StiSolidBrush(Color.Transparent);
     //
     // Text3
     //
     Text3 = new StiText();
     Text3.ClientRectangle       = new RectangleD(0, 0, 19, 0.6);
     Text3.HorAlignment          = StiTextHorAlignment.Center;
     Text3.Name                  = "Text3";
     Text3.GetValue             += new StiGetValueEventHandler(Text3__GetValue);
     Text3.VertAlignment         = StiVertAlignment.Center;
     Text3.Border                = new StiBorder(StiBorderSides.None, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     Text3.Brush                 = new StiSolidBrush(Color.Transparent);
     Text3.Font                  = new Font("Arial", 8F);
     Text3.Guid                  = null;
     Text3.Interaction           = null;
     Text3.Margins               = new StiMargins(0, 0, 0, 0);
     Text3.TextBrush             = new StiSolidBrush(Color.Black);
     Text3.TextOptions           = new StiTextOptions(false, false, false, 0F, HotkeyPrefix.None, StringTrimming.None);
     PageFooterBand1.Guid        = null;
     PageFooterBand1.Interaction = null;
     //
     // HeaderVW_ProductLocation
     //
     HeaderVW_ProductLocation = new StiHeaderBand();
     HeaderVW_ProductLocation.ClientRectangle = new RectangleD(0, 3.4, 10, 0.6);
     HeaderVW_ProductLocation.Name            = "HeaderVW_ProductLocation";
     HeaderVW_ProductLocation.Border          = new StiBorder(StiBorderSides.None, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     HeaderVW_ProductLocation.Brush           = new StiSolidBrush(Color.Transparent);
     //
     // HeaderVW_ProductLocation_MedicamentName
     //
     HeaderVW_ProductLocation_MedicamentName = new StiText();
     HeaderVW_ProductLocation_MedicamentName.ClientRectangle = new RectangleD(0, 0, 5.2, 0.6);
     HeaderVW_ProductLocation_MedicamentName.HorAlignment    = StiTextHorAlignment.Center;
     HeaderVW_ProductLocation_MedicamentName.Name            = "HeaderVW_ProductLocation_MedicamentName";
     HeaderVW_ProductLocation_MedicamentName.GetValue       += new StiGetValueEventHandler(HeaderVW_ProductLocation_MedicamentName__GetValue);
     HeaderVW_ProductLocation_MedicamentName.VertAlignment   = StiVertAlignment.Center;
     HeaderVW_ProductLocation_MedicamentName.Border          = new StiBorder(StiBorderSides.All, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     HeaderVW_ProductLocation_MedicamentName.Brush           = new StiSolidBrush(Color.Gainsboro);
     HeaderVW_ProductLocation_MedicamentName.Font            = new Font("BPG Glaho Arial", 7F, FontStyle.Bold);
     HeaderVW_ProductLocation_MedicamentName.Guid            = null;
     HeaderVW_ProductLocation_MedicamentName.Interaction     = null;
     HeaderVW_ProductLocation_MedicamentName.Margins         = new StiMargins(0, 0, 0, 0);
     HeaderVW_ProductLocation_MedicamentName.TextBrush       = new StiSolidBrush(Color.Black);
     HeaderVW_ProductLocation_MedicamentName.TextOptions     = new StiTextOptions(false, false, true, 0F, HotkeyPrefix.None, StringTrimming.None);
     //
     // HeaderVW_ProductLocation_CountryName
     //
     HeaderVW_ProductLocation_CountryName = new StiText();
     HeaderVW_ProductLocation_CountryName.ClientRectangle = new RectangleD(5.2, 0, 2.2, 0.6);
     HeaderVW_ProductLocation_CountryName.HorAlignment    = StiTextHorAlignment.Center;
     HeaderVW_ProductLocation_CountryName.Name            = "HeaderVW_ProductLocation_CountryName";
     HeaderVW_ProductLocation_CountryName.GetValue       += new StiGetValueEventHandler(HeaderVW_ProductLocation_CountryName__GetValue);
     HeaderVW_ProductLocation_CountryName.VertAlignment   = StiVertAlignment.Center;
     HeaderVW_ProductLocation_CountryName.Border          = new StiBorder(StiBorderSides.All, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     HeaderVW_ProductLocation_CountryName.Brush           = new StiSolidBrush(Color.Gainsboro);
     HeaderVW_ProductLocation_CountryName.Font            = new Font("BPG Glaho Arial", 7F, FontStyle.Bold);
     HeaderVW_ProductLocation_CountryName.Guid            = null;
     HeaderVW_ProductLocation_CountryName.Interaction     = null;
     HeaderVW_ProductLocation_CountryName.Margins         = new StiMargins(0, 0, 0, 0);
     HeaderVW_ProductLocation_CountryName.TextBrush       = new StiSolidBrush(Color.Black);
     HeaderVW_ProductLocation_CountryName.TextOptions     = new StiTextOptions(false, false, true, 0F, HotkeyPrefix.None, StringTrimming.None);
     //
     // HeaderVW_ProductLocation_ListPrice
     //
     HeaderVW_ProductLocation_ListPrice = new StiText();
     HeaderVW_ProductLocation_ListPrice.ClientRectangle = new RectangleD(9, 0, 1, 0.6);
     HeaderVW_ProductLocation_ListPrice.HorAlignment    = StiTextHorAlignment.Center;
     HeaderVW_ProductLocation_ListPrice.Name            = "HeaderVW_ProductLocation_ListPrice";
     HeaderVW_ProductLocation_ListPrice.GetValue       += new StiGetValueEventHandler(HeaderVW_ProductLocation_ListPrice__GetValue);
     HeaderVW_ProductLocation_ListPrice.VertAlignment   = StiVertAlignment.Center;
     HeaderVW_ProductLocation_ListPrice.Border          = new StiBorder(StiBorderSides.All, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     HeaderVW_ProductLocation_ListPrice.Brush           = new StiSolidBrush(Color.Gainsboro);
     HeaderVW_ProductLocation_ListPrice.Font            = new Font("BPG Glaho Arial", 7F, FontStyle.Bold);
     HeaderVW_ProductLocation_ListPrice.Guid            = null;
     HeaderVW_ProductLocation_ListPrice.Interaction     = null;
     HeaderVW_ProductLocation_ListPrice.Margins         = new StiMargins(0, 0, 0, 0);
     HeaderVW_ProductLocation_ListPrice.TextBrush       = new StiSolidBrush(Color.Black);
     HeaderVW_ProductLocation_ListPrice.TextOptions     = new StiTextOptions(false, false, true, 0F, HotkeyPrefix.None, StringTrimming.None);
     //
     // Text2
     //
     Text2 = new StiText();
     Text2.ClientRectangle                = new RectangleD(7.4, 0, 1.6, 0.6);
     Text2.Guid                           = "b2ee6a7204874db4bc1e2bae90edc3a9";
     Text2.HorAlignment                   = StiTextHorAlignment.Center;
     Text2.Name                           = "Text2";
     Text2.GetValue                      += new StiGetValueEventHandler(Text2__GetValue);
     Text2.Type                           = StiSystemTextType.Expression;
     Text2.VertAlignment                  = StiVertAlignment.Center;
     Text2.Border                         = new StiBorder(StiBorderSides.All, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     Text2.Brush                          = new StiSolidBrush(Color.Gainsboro);
     Text2.Font                           = new Font("BPG Glaho Arial", 7F, FontStyle.Bold);
     Text2.Interaction                    = null;
     Text2.Margins                        = new StiMargins(0, 0, 0, 0);
     Text2.TextBrush                      = new StiSolidBrush(Color.Black);
     Text2.TextOptions                    = new StiTextOptions(false, false, true, 0F, HotkeyPrefix.None, StringTrimming.None);
     HeaderVW_ProductLocation.Guid        = null;
     HeaderVW_ProductLocation.Interaction = null;
     //
     // DataVW_ProductLocation
     //
     DataVW_ProductLocation = new StiDataBand();
     DataVW_ProductLocation.ClientRectangle = new RectangleD(0, 4.8, 10, 0.6);
     DataVW_ProductLocation.DataSourceName  = "T_Detail";
     DataVW_ProductLocation.Name            = "DataVW_ProductLocation";
     DataVW_ProductLocation.Sort            = new[] {
         "ASC",
         "ProductName"
     };
     DataVW_ProductLocation.Border             = new StiBorder(StiBorderSides.None, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     DataVW_ProductLocation.Brush              = new StiSolidBrush(Color.Transparent);
     DataVW_ProductLocation.BusinessObjectGuid = null;
     //
     // DataVW_ProductLocation_MedicamentName
     //
     DataVW_ProductLocation_MedicamentName                 = new StiText();
     DataVW_ProductLocation_MedicamentName.CanGrow         = true;
     DataVW_ProductLocation_MedicamentName.ClientRectangle = new RectangleD(0, 0, 5.2, 0.6);
     DataVW_ProductLocation_MedicamentName.Name            = "DataVW_ProductLocation_MedicamentName";
     DataVW_ProductLocation_MedicamentName.GetValue       += new StiGetValueEventHandler(DataVW_ProductLocation_MedicamentName__GetValue);
     DataVW_ProductLocation_MedicamentName.VertAlignment   = StiVertAlignment.Center;
     DataVW_ProductLocation_MedicamentName.Border          = new StiBorder(StiBorderSides.None, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     DataVW_ProductLocation_MedicamentName.Brush           = new StiSolidBrush(Color.Transparent);
     DataVW_ProductLocation_MedicamentName.Font            = new Font("BPG Glaho Arial", 6F);
     DataVW_ProductLocation_MedicamentName.Guid            = null;
     DataVW_ProductLocation_MedicamentName.Interaction     = null;
     DataVW_ProductLocation_MedicamentName.Margins         = new StiMargins(0, 0, 0, 0);
     DataVW_ProductLocation_MedicamentName.TextBrush       = new StiSolidBrush(Color.Black);
     DataVW_ProductLocation_MedicamentName.TextOptions     = new StiTextOptions(false, false, true, 0F, HotkeyPrefix.None, StringTrimming.None);
     //
     // DataVW_ProductLocation_CountryName
     //
     DataVW_ProductLocation_CountryName                 = new StiText();
     DataVW_ProductLocation_CountryName.CanGrow         = true;
     DataVW_ProductLocation_CountryName.ClientRectangle = new RectangleD(5.2, 0, 2.2, 0.6);
     DataVW_ProductLocation_CountryName.HorAlignment    = StiTextHorAlignment.Right;
     DataVW_ProductLocation_CountryName.Name            = "DataVW_ProductLocation_CountryName";
     DataVW_ProductLocation_CountryName.GetValue       += new StiGetValueEventHandler(DataVW_ProductLocation_CountryName__GetValue);
     DataVW_ProductLocation_CountryName.VertAlignment   = StiVertAlignment.Center;
     DataVW_ProductLocation_CountryName.Border          = new StiBorder(StiBorderSides.None, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     DataVW_ProductLocation_CountryName.Brush           = new StiSolidBrush(Color.Transparent);
     DataVW_ProductLocation_CountryName.Font            = new Font("BPG Glaho Arial", 6F);
     DataVW_ProductLocation_CountryName.Guid            = null;
     DataVW_ProductLocation_CountryName.Interaction     = null;
     DataVW_ProductLocation_CountryName.Margins         = new StiMargins(0, 0, 0, 0);
     DataVW_ProductLocation_CountryName.TextBrush       = new StiSolidBrush(Color.Black);
     DataVW_ProductLocation_CountryName.TextFormat      = new StiPercentageFormatService(0, 0, ",", 4, " ", 3, "%", true, false, " ");
     DataVW_ProductLocation_CountryName.TextOptions     = new StiTextOptions(false, false, true, 0F, HotkeyPrefix.None, StringTrimming.None);
     //
     // DataVW_ProductLocation_ListPrice
     //
     DataVW_ProductLocation_ListPrice                 = new StiText();
     DataVW_ProductLocation_ListPrice.CanGrow         = true;
     DataVW_ProductLocation_ListPrice.ClientRectangle = new RectangleD(9, 0, 1, 0.6);
     DataVW_ProductLocation_ListPrice.HorAlignment    = StiTextHorAlignment.Right;
     DataVW_ProductLocation_ListPrice.Name            = "DataVW_ProductLocation_ListPrice";
     DataVW_ProductLocation_ListPrice.GetValue       += new StiGetValueEventHandler(DataVW_ProductLocation_ListPrice__GetValue);
     DataVW_ProductLocation_ListPrice.VertAlignment   = StiVertAlignment.Center;
     DataVW_ProductLocation_ListPrice.Border          = new StiBorder(StiBorderSides.Right, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     DataVW_ProductLocation_ListPrice.Brush           = new StiSolidBrush(Color.Transparent);
     DataVW_ProductLocation_ListPrice.Font            = new Font("BPG Glaho Arial", 6F);
     DataVW_ProductLocation_ListPrice.Guid            = null;
     DataVW_ProductLocation_ListPrice.Interaction     = null;
     DataVW_ProductLocation_ListPrice.Margins         = new StiMargins(0, 0, 0, 0);
     DataVW_ProductLocation_ListPrice.TextBrush       = new StiSolidBrush(Color.Black);
     DataVW_ProductLocation_ListPrice.TextFormat      = new StiNumberFormatService(1, ",", 2, " ", 3, true, false, " ");
     DataVW_ProductLocation_ListPrice.TextOptions     = new StiTextOptions(false, false, true, 0F, HotkeyPrefix.None, StringTrimming.None);
     //
     // Text1
     //
     Text1                 = new StiText();
     Text1.CanGrow         = true;
     Text1.ClientRectangle = new RectangleD(7.4, 0, 1.6, 0.6);
     Text1.Guid            = "5cfcbb441d534f4ba95c949ddd2c6da5";
     Text1.HorAlignment    = StiTextHorAlignment.Right;
     Text1.Name            = "Text1";
     Text1.GetValue       += new StiGetValueEventHandler(Text1__GetValue);
     Text1.Type            = StiSystemTextType.DataColumn;
     Text1.VertAlignment   = StiVertAlignment.Center;
     Text1.Border          = new StiBorder(StiBorderSides.None, Color.Black, 1, StiPenStyle.Solid, false, 4, new StiSolidBrush(Color.Black));
     Text1.Brush           = new StiSolidBrush(Color.Transparent);
     Text1.Font            = new Font("BPG Glaho Arial", 6F);
     Text1.Interaction     = null;
     Text1.Margins         = new StiMargins(0, 0, 0, 0);
     Text1.TextBrush       = new StiSolidBrush(Color.Black);
     Text1.TextFormat      = new StiPercentageFormatService(0, 0, ",", 2, " ", 3, "%", true, true, " ");
     Text1.TextOptions     = new StiTextOptions(false, false, true, 0F, HotkeyPrefix.None, StringTrimming.None);
     DataVW_ProductLocation.DataRelationName = null;
     DataVW_ProductLocation.Guid             = null;
     DataVW_ProductLocation.Interaction      = null;
     DataVW_ProductLocation.MasterComponent  = null;
     Page1.ExcelSheetValue     = null;
     Page1.Interaction         = null;
     Page1.Margins             = new StiMargins(0.5, 0.5, 0.5, 0.5);
     Page1_Watermark           = new StiWatermark();
     Page1_Watermark.Font      = new Font("Arial", 100F);
     Page1_Watermark.Image     = null;
     Page1_Watermark.TextBrush = new StiSolidBrush(Color.FromArgb(50, 0, 0, 0));
     Page1.Rendering          += new EventHandler(Page1_Rendering);
     RptProducLocationPrice_PrinterSettings = new StiPrinterSettings();
     PrinterSettings                 = RptProducLocationPrice_PrinterSettings;
     Page1.Report                    = this;
     Page1.Watermark                 = Page1_Watermark;
     PageHeaderBand1.Page            = Page1;
     PageHeaderBand1.Parent          = Page1;
     Text4.Page                      = Page1;
     Text4.Parent                    = PageHeaderBand1;
     Image1.Page                     = Page1;
     Image1.Parent                   = PageHeaderBand1;
     PageFooterBand1.Page            = Page1;
     PageFooterBand1.Parent          = Page1;
     Text3.Page                      = Page1;
     Text3.Parent                    = PageFooterBand1;
     HeaderVW_ProductLocation.Page   = Page1;
     HeaderVW_ProductLocation.Parent = Page1;
     HeaderVW_ProductLocation_MedicamentName.Page   = Page1;
     HeaderVW_ProductLocation_MedicamentName.Parent = HeaderVW_ProductLocation;
     HeaderVW_ProductLocation_CountryName.Page      = Page1;
     HeaderVW_ProductLocation_CountryName.Parent    = HeaderVW_ProductLocation;
     HeaderVW_ProductLocation_ListPrice.Page        = Page1;
     HeaderVW_ProductLocation_ListPrice.Parent      = HeaderVW_ProductLocation;
     Text2.Page   = Page1;
     Text2.Parent = HeaderVW_ProductLocation;
     DataVW_ProductLocation.Page   = Page1;
     DataVW_ProductLocation.Parent = Page1;
     DataVW_ProductLocation_MedicamentName.Page   = Page1;
     DataVW_ProductLocation_MedicamentName.Parent = DataVW_ProductLocation;
     DataVW_ProductLocation_CountryName.Page      = Page1;
     DataVW_ProductLocation_CountryName.Parent    = DataVW_ProductLocation;
     DataVW_ProductLocation_ListPrice.Page        = Page1;
     DataVW_ProductLocation_ListPrice.Parent      = DataVW_ProductLocation;
     Text1.Page   = Page1;
     Text1.Parent = DataVW_ProductLocation;
     EndRender   += new EventHandler(RptProducLocationPriceWordsToEnd__EndRender);
     //
     // Add to PageHeaderBand1.Components
     //
     PageHeaderBand1.Components.Clear();
     PageHeaderBand1.Components.AddRange(new StiComponent[] {
         Text4,
         Image1
     });
     //
     // Add to PageFooterBand1.Components
     //
     PageFooterBand1.Components.Clear();
     PageFooterBand1.Components.AddRange(new StiComponent[] {
         Text3
     });
     //
     // Add to HeaderVW_ProductLocation.Components
     //
     HeaderVW_ProductLocation.Components.Clear();
     HeaderVW_ProductLocation.Components.AddRange(new StiComponent[] {
         HeaderVW_ProductLocation_MedicamentName,
         HeaderVW_ProductLocation_CountryName,
         HeaderVW_ProductLocation_ListPrice,
         Text2
     });
     //
     // Add to DataVW_ProductLocation.Components
     //
     DataVW_ProductLocation.Components.Clear();
     DataVW_ProductLocation.Components.AddRange(new StiComponent[] {
         DataVW_ProductLocation_MedicamentName,
         DataVW_ProductLocation_CountryName,
         DataVW_ProductLocation_ListPrice,
         Text1
     });
     //
     // Add to Page1.Components
     //
     Page1.Components.Clear();
     Page1.Components.AddRange(new StiComponent[] {
         PageHeaderBand1,
         PageFooterBand1,
         HeaderVW_ProductLocation,
         DataVW_ProductLocation
     });
     //
     // Add to Pages
     //
     Pages.Clear();
     Pages.AddRange(new[] {
         Page1
     });
     T_Detail.Columns.AddRange(new[] {
         new StiDataColumn("ProductID", "ProductID", "ProductID", typeof(int)),
         new StiDataColumn("ProductName", "ProductName", "ProductName", typeof(string)),
         new StiDataColumn("CountryName", "CountryName", "CountryName", typeof(string)),
         new StiDataColumn("Serie", "Serie", "Serie", typeof(string)),
         new StiDataColumn("UnitPrice", "UnitPrice", "UnitPrice", typeof(decimal)),
         new StiDataColumn("Discount", "Discount", "Discount", typeof(decimal))
     });
     DataSources.Add(T_Detail);
 }
Exemplo n.º 7
0
 public PageHeaderTextBox(IReportBuilder reportBuilder, StiPage page, double height = 0.2)
 {
     _reportBuilder    = reportBuilder;
     CurrentPageHeader = new StiPageHeaderBand(new RectangleD(0, 0, 0, height));
     page.Components.Add(CurrentPageHeader);
 }
Exemplo n.º 8
0
        public StiReport GetReport(SystemReportType SRT, SystemReportTypeFilterConditions SrtFilterConditions)
        {
            try
            {
                ReportHelper reportHelper = ReportHelper.Instance("شرکت طرح و پردازش غدیر", BUser.CurrentUser.ID, BUser.CurrentUser.Person.Name, new List <decimal>(), Guid.NewGuid().ToString(), string.Empty, false, string.Empty, string.Empty, new List <decimal>());


                StiReport stiReport           = new StiReport();
                double    columnWidth         = 0;
                double    dataBandRowHeight   = 1.0;
                double    dataBandHeight      = 4;
                double    dataHeaderRowHeight = 1;
                double    dataHeaderHeight    = 3;
                Font      dataBandFont        = new Font("Tahoma", 8, FontStyle.Bold);
                Font      headerBandFont      = new Font("arial", 11, FontStyle.Bold);
                Font      titleBandFont       = new Font("Tahoma", 16, FontStyle.Bold);
                Font      groupBandFont       = new Font("Tahoma", 10, FontStyle.Bold);
                Font      pageHeaderFont      = new Font("Tahoma", 18, FontStyle.Bold);
                stiReport.Unit = Stimulsoft.Report.Units.StiUnit.Centimeters;
                StiPage page = stiReport.Pages[0];
                page.Orientation    = StiPageOrientation.Landscape;
                page.Width          = 29.7;
                page.Height         = 21;
                page.Margins.Bottom = 0.5;
                page.Margins.Left   = 0.5;
                page.Margins.Right  = 0.5;
                page.Margins.Top    = 0.5;



                StiPageHeaderBand pageHeader = new StiPageHeaderBand();
                pageHeader.Height       = 2;
                pageHeader.Width        = page.Width;
                pageHeader.Name         = "PageHeader";
                pageHeader.Border.Side  = StiBorderSides.All;
                pageHeader.Border.Color = Color.Cornsilk;
                page.Components.Add(pageHeader);

                StiText officeNameText_pageHeader = new StiText(new RectangleD(0, 0, 10.6, 0.6));
                officeNameText_pageHeader.Left = (page.Width / 2) - 5.3;
                officeNameText_pageHeader.Top  = 0;
                IList <Presentaion_Helper.Proxy.DataAccessProxy> dataAccessList = new BDataAccess().GetAllByUserId(DataAccessParts.Corporation, BUser.CurrentUser.ID);
                string headerText = string.Empty;
                if (dataAccessList != null && dataAccessList.Count > 0)
                {
                    headerText = dataAccessList.FirstOrDefault().Name;
                }
                officeNameText_pageHeader.Text          = headerText;
                officeNameText_pageHeader.HorAlignment  = StiTextHorAlignment.Center;
                officeNameText_pageHeader.VertAlignment = StiVertAlignment.Center;
                officeNameText_pageHeader.Name          = "OfficeNameHeader";
                officeNameText_pageHeader.Font          = pageHeaderFont;
                officeNameText_pageHeader.Height        = 1;
                pageHeader.Components.Add(officeNameText_pageHeader);


                StiText reportNameText_pageHeader = new StiText(new RectangleD(0, 0, 10.6, 0.6));
                reportNameText_pageHeader.Left = (page.Width / 2) - 5.3;
                reportNameText_pageHeader.Top  = 1;

                reportNameText_pageHeader.HorAlignment  = StiTextHorAlignment.Center;
                reportNameText_pageHeader.VertAlignment = StiVertAlignment.Center;
                reportNameText_pageHeader.Name          = "reportNameText";
                reportNameText_pageHeader.Font          = pageHeaderFont;
                reportNameText_pageHeader.Height        = 1;
                pageHeader.Components.Add(reportNameText_pageHeader);


                StiText reportCreateDateLabelText_pageHeader = new StiText(new RectangleD(0, 0, 2.6, 0.6));
                reportCreateDateLabelText_pageHeader.Left = 2.4;
                reportCreateDateLabelText_pageHeader.Top  = 0;
                switch (BLanguage.CurrentLocalLanguage)
                {
                case LanguagesName.Unknown:
                    reportCreateDateLabelText_pageHeader.Text = ": تاریخ تهیه گزارش";
                    break;

                case LanguagesName.Parsi:
                    reportCreateDateLabelText_pageHeader.Text = ": تاریخ تهیه گزارش";
                    break;

                case LanguagesName.English:
                    reportCreateDateLabelText_pageHeader.Text = "Report Date :";
                    break;

                default:
                    break;
                }
                reportCreateDateLabelText_pageHeader.HorAlignment  = StiTextHorAlignment.Center;
                reportCreateDateLabelText_pageHeader.VertAlignment = StiVertAlignment.Center;
                reportCreateDateLabelText_pageHeader.Name          = "reportCreateDateLabelText";
                reportCreateDateLabelText_pageHeader.Font          = dataBandFont;
                reportCreateDateLabelText_pageHeader.TextBrush     = new StiSolidBrush(Color.FromArgb(89, 89, 89));
                pageHeader.Components.Add(reportCreateDateLabelText_pageHeader);

                StiText reportCreateDateText_pageHeader = new StiText(new RectangleD(0, 0, 2.4, 0.6));
                reportCreateDateText_pageHeader.Left          = 0;
                reportCreateDateText_pageHeader.Top           = 0;
                reportCreateDateText_pageHeader.Text          = ReportHelper.Instance().ShamsiGetNow();
                reportCreateDateText_pageHeader.HorAlignment  = StiTextHorAlignment.Center;
                reportCreateDateText_pageHeader.VertAlignment = StiVertAlignment.Center;
                reportCreateDateText_pageHeader.Name          = "reportCreateDateText";
                reportCreateDateText_pageHeader.Font          = dataBandFont;
                reportCreateDateText_pageHeader.TextBrush     = new StiSolidBrush(Color.FromArgb(183, 117, 64));
                pageHeader.Components.Add(reportCreateDateText_pageHeader);

                StiText reportCreatorLabelText_pageHeader = new StiText(new RectangleD(0, 0, 2, 0.6));
                reportCreatorLabelText_pageHeader.Left = 3;
                reportCreatorLabelText_pageHeader.Top  = 0.6;
                switch (BLanguage.CurrentLocalLanguage)
                {
                case LanguagesName.Unknown:
                    reportCreatorLabelText_pageHeader.Text = ": تهیه کننده";
                    break;

                case LanguagesName.Parsi:
                    reportCreatorLabelText_pageHeader.Text = ": تهیه کننده";
                    break;

                case LanguagesName.English:
                    reportCreatorLabelText_pageHeader.Text = "Creator :";
                    break;

                default:
                    break;
                }
                reportCreatorLabelText_pageHeader.HorAlignment  = StiTextHorAlignment.Center;
                reportCreatorLabelText_pageHeader.VertAlignment = StiVertAlignment.Center;
                reportCreatorLabelText_pageHeader.Name          = "reportCreatorLabelText";
                reportCreatorLabelText_pageHeader.Font          = dataBandFont;
                reportCreatorLabelText_pageHeader.TextBrush     = new StiSolidBrush(Color.FromArgb(89, 89, 89));
                pageHeader.Components.Add(reportCreatorLabelText_pageHeader);


                StiText reportCreatorText_pageHeader = new StiText(new RectangleD(0, 0, 3, 0.6));
                reportCreatorText_pageHeader.Left          = 0;
                reportCreatorText_pageHeader.Top           = 0.6;
                reportCreatorText_pageHeader.Text          = ReportHelper.Instance().UserName;
                reportCreatorText_pageHeader.HorAlignment  = StiTextHorAlignment.Center;
                reportCreatorText_pageHeader.VertAlignment = StiVertAlignment.Center;
                reportCreatorText_pageHeader.Name          = "reportCreatorText";
                reportCreatorText_pageHeader.Font          = dataBandFont;
                reportCreatorText_pageHeader.TextBrush     = new StiSolidBrush(Color.FromArgb(183, 117, 64));
                pageHeader.Components.Add(reportCreatorText_pageHeader);

                StiHeaderBand headerBand = new StiHeaderBand();
                headerBand.Name         = "HeaderBand";
                headerBand.Width        = page.Width;
                headerBand.Border.Side  = StiBorderSides.All;
                headerBand.Border.Color = Color.DimGray;
                page.Components.Add(headerBand);

                StiDataBand dataBand = new StiDataBand();

                dataBand.Name  = "DataBand";
                dataBand.Width = page.Width;

                dataBand.Border.Side  = StiBorderSides.All;
                dataBand.Border.Color = Color.Gainsboro;
                StiCondition conditionDataBand = new StiCondition("{Line%2==0}", Color.Black, Color.PeachPuff, dataBandFont, true);
                dataBand.Conditions.Add(conditionDataBand);
                page.Components.Add(dataBand);



                DataTable dtReport        = new DataTable();
                string    modelReportName = string.Empty;
                switch (SRT)
                {
                case SystemReportType.SystemBusinessReport:
                    IList <GTS.Clock.Model.Report.SystemBusinessReport> SystemBusinessReportList = this.GetSystemBusinessReportList(SRT, SrtFilterConditions);
                    dtReport = Utility.ListToDataTable <GTS.Clock.Model.Report.SystemBusinessReport>(SystemBusinessReportList);
                    reportNameText_pageHeader.Text = "System Business Report";
                    modelReportName   = dataBand.DataSourceName = typeof(GTS.Clock.Model.Report.SystemBusinessReport).Name;
                    dataBand.Height   = dataBandHeight;
                    headerBand.Height = dataHeaderHeight;
                    break;

                case SystemReportType.SystemEngineReport:
                    IList <GTS.Clock.Model.Report.SystemEngineReport> SystemEngineReportList = this.GetSystemEngineReportList(SRT, SrtFilterConditions);
                    dtReport = Utility.ListToDataTable <GTS.Clock.Model.Report.SystemEngineReport>(SystemEngineReportList);
                    reportNameText_pageHeader.Text = "System Engine Report";
                    modelReportName   = dataBand.DataSourceName = typeof(GTS.Clock.Model.Report.SystemEngineReport).Name;
                    dataBand.Height   = dataBandHeight;
                    headerBand.Height = dataHeaderHeight;
                    break;

                case SystemReportType.SystemWindowsServiceReport:
                    IList <GTS.Clock.Model.Report.SystemWindowsServiceReport> SystemWindowsServiceReportList = this.GetSystemWindowsServiceReportList(SRT, SrtFilterConditions);
                    dtReport = Utility.ListToDataTable <GTS.Clock.Model.Report.SystemWindowsServiceReport>(SystemWindowsServiceReportList);
                    reportNameText_pageHeader.Text = "System Windows Service Report";
                    modelReportName   = dataBand.DataSourceName = typeof(GTS.Clock.Model.Report.SystemWindowsServiceReport).Name;
                    dataBand.Height   = dataBandHeight;
                    headerBand.Height = dataHeaderHeight;
                    break;

                case SystemReportType.SystemUserActionReport:
                    IList <GTS.Clock.Model.Report.SystemUserActionReport> SystemUserActionReportList = this.GetSystemUserActionReportList(SRT, SrtFilterConditions);
                    dtReport = Utility.ListToDataTable <GTS.Clock.Model.Report.SystemUserActionReport>(SystemUserActionReportList);
                    reportNameText_pageHeader.Text = "System User Action Report";
                    modelReportName   = dataBand.DataSourceName = typeof(GTS.Clock.Model.Report.SystemUserActionReport).Name;
                    dataBand.Height   = dataBandHeight;
                    headerBand.Height = dataHeaderHeight;
                    break;

                case SystemReportType.SystemEngineDebugReport:
                    IList <GTS.Clock.Model.Report.SystemEngineDebugReport> SystemEngineDebugReportList = this.GetSystemEngineDebugReportList(SRT, SrtFilterConditions);
                    dtReport = Utility.ListToDataTable <GTS.Clock.Model.Report.SystemEngineDebugReport>(SystemEngineDebugReportList);
                    reportNameText_pageHeader.Text = "System Engine Debug Report";
                    modelReportName   = dataBand.DataSourceName = typeof(GTS.Clock.Model.Report.SystemEngineDebugReport).Name;
                    dataBand.Height   = dataBandHeight;
                    headerBand.Height = dataHeaderHeight;
                    break;

                case SystemReportType.SystemDataCollectorReport:
                    IList <GTS.Clock.Model.Report.SystemDataCollectorReport> SystemDataCollectorReportList = this.GetSystemDataCollectorReportList(SRT, SrtFilterConditions);
                    dtReport = Utility.ListToDataTable <GTS.Clock.Model.Report.SystemDataCollectorReport>(SystemDataCollectorReportList);
                    reportNameText_pageHeader.Text = "System Data Collector Report";
                    modelReportName   = dataBand.DataSourceName = typeof(GTS.Clock.Model.Report.SystemDataCollectorReport).Name;
                    dataBand.Height   = dataBandHeight;
                    headerBand.Height = dataHeaderHeight;
                    break;
                }


                columnWidth = (page.Width) / (dtReport.Columns.Count - 2);
                stiReport.RegData(dtReport);
                stiReport.Dictionary.Synchronize();

                double pos       = 0;
                int    nameIndex = 1;
                for (int i = 0; i < dtReport.Columns.Count; i++)
                {
                    StiText headerColumnText;
                    switch (dtReport.Columns[i].ColumnName.ToLower())
                    {
                    case "exception":
                    {
                        headerColumnText = new StiText(new RectangleD(columnWidth, 1, (page.Width - columnWidth), 1));

                        break;
                    }

                    case "message":
                    {
                        headerColumnText = new StiText(new RectangleD(columnWidth, 2, (page.Width - columnWidth), 1));
                        break;
                    }

                    case "id":
                    {
                        if (SRT == SystemReportType.SystemUserActionReport)
                        {
                            headerColumnText = new StiText(new RectangleD(pos, 0, columnWidth, 1));
                        }
                        else
                        {
                            headerColumnText = new StiText(new RectangleD(pos, 0, columnWidth, dataHeaderHeight));
                        }

                        break;
                    }

                    case "cnpname":
                    {
                        headerColumnText = new StiText(new RectangleD(columnWidth, 1, (page.Width - columnWidth), 1));
                        break;
                    }

                    default:
                        headerColumnText       = new StiText(new RectangleD(pos, 0, columnWidth, 1));
                        headerColumnText.Width = columnWidth;
                        break;
                    }
                    headerColumnText.HorAlignment  = StiTextHorAlignment.Center;
                    headerColumnText.VertAlignment = StiVertAlignment.Center;
                    headerColumnText.Name          = "HeaderText" + nameIndex.ToString();
                    headerColumnText.Brush         = new StiSolidBrush(Color.FromArgb(191, 191, 191));
                    headerColumnText.Border.Side   = StiBorderSides.All;
                    headerColumnText.Font          = headerBandFont;
                    headerColumnText.Text.Value    = dtReport.Columns[i].Caption;

                    headerBand.Components.Add(headerColumnText);

                    StiText dataText;
                    switch (dtReport.Columns[i].ColumnName.ToLower())
                    {
                    case "exception":
                    {
                        dataText = new StiText(new RectangleD(columnWidth, dataBandRowHeight, (page.Width - columnWidth), 1.5));

                        pos = pos - columnWidth;
                        break;
                    }

                    case "message":
                    {
                        dataText = new StiText(new RectangleD(columnWidth, dataBandRowHeight + 1.5, (page.Width - columnWidth), 1.5));
                        pos      = pos - columnWidth;
                        break;
                    }

                    case "id":
                    {
                        if (SRT == SystemReportType.SystemUserActionReport)
                        {
                            dataText = new StiText(new RectangleD(pos, 0, columnWidth, 1));
                        }
                        else
                        {
                            dataText = new StiText(new RectangleD(pos, 0, columnWidth, dataBandHeight));
                        }

                        break;
                    }

                    case "cnpname":
                    {
                        dataText = new StiText(new RectangleD(columnWidth, dataBandRowHeight, (page.Width - columnWidth), 1.5));
                        pos      = pos - columnWidth;

                        break;
                    }

                    default:
                        dataText = new StiText(new RectangleD(pos, 0, columnWidth, dataBandRowHeight));

                        break;
                    }
                    dataText.Type          = StiSystemTextType.DataColumn;
                    dataText.Text          = "{Trim(" + modelReportName + "." + Stimulsoft.Report.CodeDom.StiCodeDomSerializator.ReplaceSymbols(dtReport.Columns[i].ColumnName) + ")}";
                    dataText.HorAlignment  = StiTextHorAlignment.Center;
                    dataText.VertAlignment = StiVertAlignment.Center;
                    dataText.Name          = "DataText" + nameIndex.ToString();
                    dataText.Border.Side   = StiBorderSides.All;
                    dataText.Font          = dataBandFont;
                    dataText.WordWrap      = true;

                    dataBand.Components.Add(dataText);


                    pos = pos + columnWidth;
                    nameIndex++;
                }
                stiReport.Compile();
                return(stiReport);
            }
            catch (Exception)
            {
                throw;
            }
        }