Page 1 of 1

create group band in run time

Posted: Tue Aug 28, 2012 6:32 am
by maryam
I want to create run time report and need to dynamically add group band, I follow your code and add to my report code

Code: Select all

{ StiReport report = new StiReport();
            if (File.Exists(Manage.ClGlobal.ReportDirAcc + @"\\RptAccDoc.mrt"))
            {
                report.Load(Manage.ClGlobal.ReportDirAcc + @"\\RptAccDoc.mrt");
                ((Stimulsoft.Report.Dictionary.StiSqlDatabase)report.Dictionary.Databases[0]).ConnectionString = Manage.ClGlobal.ConnectionStr;
                StiPage page = new StiPage();
                page = (StiPage)report.Pages[0];
                DataTable dtAccDoc = new DataTable();
                dtAccDoc = ClBase.exec(@"exec[acc].[PrcAccDoc]
		@HdrId =9,
		@Type = 51");
                            

                foreach (RadTreeNode node in treeLevel.Nodes)
                {
                    if (node.Checked)
                    {
                        StiGroupHeaderBand GhBand = new StiGroupHeaderBand();
                        GhBand.Height = 0.5;
                        GhBand.Name = GhBand + node.Value.ToString();
                        GhBand.Condition = new StiGroupConditionExpression(@"{dtAccDoc.l" +node.Value.ToString()+"}");
                        GhBand.Enabled = true;
                       
                        page.Components.Add(GhBand);
                       

                        StiText headerText = new StiText(new RectangleD(0, 0, 5, 0.5));
                        headerText.Text = "l" + node.Value.ToString();
                        headerText.HorAlignment = StiTextHorAlignment.Center;
                        headerText.Name = "HeaderText"+node.Value.ToString();
                        headerText.Brush = new StiSolidBrush(Color.LightGreen);
                        GhBand.Components.Clear();
                        GhBand.Components.Add(headerText);
			

                    }
                }
                
                report.Compile();
                report.Show();

            }
        }
it doesn't have error but doesn't happen when execute my application, where is my mistake and how can i solve it?

Re: create group band in run time

Posted: Wed Aug 29, 2012 6:44 am
by HighAley
Hello.

Please, send us a working project for analysis.

Thank you.

Re: create group band in run time

Posted: Sat Sep 01, 2012 5:19 am
by maryam
hello that's my file

Re: create group band in run time

Posted: Mon Sep 03, 2012 6:22 am
by Alex K.
Hello,

Can you please send us a sample project which reproduce the issue for analysis.

Thank you.

Re: create group band in run time

Posted: Sun Sep 09, 2012 5:06 am
by maryam
i solve my problem, thanks a lot for your attention, now I want to grow rectangle and fit this to page width in run time program, when trace it is ok and width of rectangle is page's width, but in design it is in old width what should i do?

Re: create group band in run time

Posted: Mon Sep 10, 2012 7:12 am
by Alex K.
Hello,

Can you please send us a sample project which reproduce the issue for analysis.

Thank you.