Пример #1
0
        /// <summary>
        ///
        /// </summary>
        private void Template()
        {
            PropertyInfo[] properties = informacion.GetType().GetProperties();
            foreach (var prop in properties)
            {
                //report.RegisterData((string)prop.GetValue(informacion, null).ToString(), prop.Name);
                //report.GetDataSource(prop.Name).Enabled = true;
                //report.GetDataSource(prop.Name).InitSchema();

                FastReport.TextObject myText = (FastReport.TextObject)report.FindObject(prop.Name);
                myText.Text = (string)prop.GetValue(informacion, null).ToString();
            }

            //report.Show();

            //thread.Suspend();
        }
Пример #2
0
        private void btnConfirmar_Click(object sender, EventArgs e)
        {
            if (cmbNomeProduto.SelectedItem != null)
            {
                VendasClasse novaVenda = new VendasClasse();
                DataTable    dt        = new DataTable();
                dt = novaVenda.BuscaVendaBanco(listaBrinquedo[cmbNomeProduto.SelectedIndex].Cod_Brinquedo);

                Report report = new Report();

                report.Load("Relatorio.frx");

                report.RegisterData(dt, "Tabela_de_Dados");
                report.GetDataSource("Tabela_de_Dados").Enabled = true;
                FastReport.DataBand dados = (FastReport.DataBand)report.FindObject("Data1");
                dados.DataSource = report.GetDataSource("Tabela_de_Dados");



                FastReport.TextObject Nome_brinquedo = (FastReport.TextObject)report.FindObject("txtNomeBrinq");
                FastReport.TextObject Nome           = (FastReport.TextObject)report.FindObject("txtNomeCliente");
                FastReport.TextObject data_Venda     = (FastReport.TextObject)report.FindObject("txtdataVenda");
                FastReport.TextObject quantidade     = (FastReport.TextObject)report.FindObject("txtqtd");



                Nome_brinquedo.Text = "[Tabela_de_Dados.Nome_Brinquedo]";
                data_Venda.Text     = "[Tabela_de_Dados.data_Venda]";
                Nome.Text           = "[Tabela_de_Dados.Nome]";
                quantidade.Text     = "[Tabela_de_Dados.quantidade]";

                report.Show();
            }
            else
            {
                MessageBox.Show("Não há nenhum produto selecionado!");
            }
        }
Пример #3
0
        private Report CreateReport()
        {
            const int ROW_HIGHT = 20;
            Report    report    = new Report();

            ReportPage page = new ReportPage();

            page.Name = "FontList";
            report.Pages.Add(page);
            ReportTitleBand headerBand = new ReportTitleBand();

            headerBand.Name   = "Title";
            headerBand.Height = 40;
            page.ReportTitle  = headerBand;

            TextObject header = new FastReport.TextObject();

            header.Name   = "HeaderMemo";
            header.Width  = 300;
            header.Height = 30;
            header.Text   = "List of enumerated fonts";
            header.Font   = new Font(FontFamily.GenericSansSerif, 18);
            headerBand.Objects.Add(header);

            DataBand dataBand = new DataBand();

            dataBand.Name   = "DataBand";
            dataBand.Top    = 30;
            dataBand.Height = ROW_HIGHT;
            page.Bands.Add(dataBand);
            TextObject index = new FastReport.TextObject();

            index.Name   = "Index";
            index.Text   = "[Row#]";
            index.Height = ROW_HIGHT;
            index.Width  = 50;
            dataBand.Objects.Add(index);
            TextObject font_id = new FastReport.TextObject();

            font_id.Name   = "FontOD";
            font_id.Text   = "[FontList1.FontID]";
            font_id.Height = ROW_HIGHT;
            font_id.Width  = 300;
            font_id.Left   = 50;
            dataBand.Objects.Add(font_id);
            TextObject font_path = new FastReport.TextObject();

            font_path.Name   = "FilePath";
            font_path.Text   = "[FontList1.FontPath]";
            font_path.Left   = 350;
            font_path.Width  = 600;
            font_path.Height = ROW_HIGHT;
            dataBand.Objects.Add(font_path);

            report.RegisterData(fontList);
            FastReport.Data.DataSourceBase dsb = report.GetDataSource("FontList1");
            dsb.Enabled         = true;
            dataBand.DataSource = dsb;

            report.ReportInfo.Name = "font.list";

            if (WYSIWYG.Checked)
            {
                font_id.AfterData += Font_id_AfterData;
            }
            return(report);
        }
Пример #4
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            if (writer.SerializeTo == SerializeTo.Preview && AutoWidth)
            {
                WordWrap = false;
                float width = CalcSize().Width;
                if ((Anchor & AnchorStyles.Right) != 0)
                {
                    Left = Right - width;
                }
                Width = width;
            }
            TextObject c = writer.DiffObject as TextObject;

            base.Serialize(writer);

            if (AutoWidth != c.AutoWidth)
            {
                writer.WriteBool("AutoWidth", AutoWidth);
            }
            if (AutoShrink != c.AutoShrink)
            {
                writer.WriteValue("AutoShrink", AutoShrink);
            }
            if (FloatDiff(AutoShrinkMinSize, c.AutoShrinkMinSize))
            {
                writer.WriteFloat("AutoShrinkMinSize", AutoShrinkMinSize);
            }
            if (HorzAlign != c.HorzAlign)
            {
                writer.WriteValue("HorzAlign", HorzAlign);
            }
            if (VertAlign != c.VertAlign)
            {
                writer.WriteValue("VertAlign", VertAlign);
            }
            if (Angle != c.Angle)
            {
                writer.WriteInt("Angle", Angle);
            }
            if (RightToLeft != c.RightToLeft)
            {
                writer.WriteBool("RightToLeft", RightToLeft);
            }
            if (WordWrap != c.WordWrap)
            {
                writer.WriteBool("WordWrap", WordWrap);
            }
            if (Underlines != c.Underlines)
            {
                writer.WriteBool("Underlines", Underlines);
            }
            if (!Font.Equals(c.Font))
            {
                writer.WriteValue("Font", Font);
            }
            TextFill.Serialize(writer, "TextFill", c.TextFill);
            if (Trimming != c.Trimming)
            {
                writer.WriteValue("Trimming", Trimming);
            }
            if (FontWidthRatio != c.FontWidthRatio)
            {
                writer.WriteFloat("FontWidthRatio", FontWidthRatio);
            }
            if (FirstTabOffset != c.FirstTabOffset)
            {
                writer.WriteFloat("FirstTabOffset", FirstTabOffset);
            }
            if (TabWidth != c.TabWidth)
            {
                writer.WriteFloat("TabWidth", TabWidth);
            }
            if (Clip != c.Clip)
            {
                writer.WriteBool("Clip", Clip);
            }
            if (Wysiwyg != c.Wysiwyg)
            {
                writer.WriteBool("Wysiwyg", Wysiwyg);
            }
            if (LineHeight != c.LineHeight)
            {
                writer.WriteFloat("LineHeight", LineHeight);
            }
            if (HtmlTags != c.HtmlTags)
            {
                writer.WriteBool("HtmlTags", HtmlTags);
            }
            if (ForceJustify != c.ForceJustify)
            {
                writer.WriteBool("ForceJustify", ForceJustify);
            }
            if (writer.SerializeTo != SerializeTo.Preview)
            {
                if (Style != c.Style)
                {
                    writer.WriteStr("Style", Style);
                }
                if (Highlight.Count > 0)
                {
                    writer.Write(Highlight);
                }
            }
        }