create group band in run time

Stimulsoft Reports.Silverlight discussion
Locked
maryam
Posts: 26
Joined: Tue Jun 05, 2012 1:13 am

create group band in run time

Post 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?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: create group band in run time

Post by HighAley »

Hello.

Please, send us a working project for analysis.

Thank you.
maryam
Posts: 26
Joined: Tue Jun 05, 2012 1:13 am

Re: create group band in run time

Post by maryam »

hello that's my file
Attachments
frmAccDoc.rar
(50.04 KiB) Downloaded 459 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: create group band in run time

Post by Alex K. »

Hello,

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

Thank you.
maryam
Posts: 26
Joined: Tue Jun 05, 2012 1:13 am

Re: create group band in run time

Post 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?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: create group band in run time

Post by Alex K. »

Hello,

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

Thank you.
Locked