Programmaticaly built report

Stimulsoft Reports.WEB discussion
Post Reply
Mixxxa
Posts: 12
Joined: Fri Dec 02, 2011 10:09 am

Programmaticaly built report

Post by Mixxxa »

Hello!

I have dynamic report which looks like following:

Code: Select all

                    source.TableName = "DataSource1";
                    report.DataSources.Clear();
                    report.RegData("DataSource1",source);
                    report.Dictionary.Synchronize();

                    StiPage page = report.Pages[0];

                    //Create Databand
                    StiDataBand dataBand = new StiDataBand();
                    dataBand.DataSourceName = "Customers";
                    dataBand.Height = 0.5;
                    dataBand.Name = "DataBand";
                    page.Components.Add(dataBand);

                    //Create text
                    StiText dataText = new StiText(new RectangleD(0, 0, 5, 0.5));
                    dataText.Text = "{Line}.{Customers.CompanyName}";
                    dataText.Name = "DataText";
                    dataBand.Components.Add(dataText);

                    //Create FooterBand
                    StiFooterBand footerBand = new StiFooterBand();
                    footerBand.Height = 0.5;
                    footerBand.Name = "FooterBand";
                    page.Components.Add(footerBand);

                    //Create text on footer
                    StiText footerText = new StiText(new RectangleD(0, 0, 5, 0.5));
                    footerText.Text = "Count - {Count()}";
                    footerText.HorAlignment = StiTextHorAlignment.Right;
                    footerText.Name = "FooterText";
                    footerText.Brush = new StiSolidBrush(Color.LightGreen);
                    footerBand.Components.Add(footerText);
                    StiWebViewerFx1.Report = report;
but as I am trying to generate I get empty list.
Did I forget anything?

Thank you
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Programmaticaly built report

Post by Alex K. »

Hello,

Please see the sample project in attachment.

Thank you.
Attachments
1907.DynamicCreateReport.zip
(15.46 KiB) Downloaded 241 times
Post Reply