Page 1 of 1

Placing Border at bottom of Second Line in data band.

Posted: Wed Feb 19, 2014 1:00 pm
by shivkrsingh
Hi,
I'm creating a dynamic report. I want to display One Line below second Line. how can I achieve this functionality through code side in c#.

My code is below

Code: Select all

//Create Databand
        StiDataBand dataBand = new StiDataBand();
        dataBand.DataSourceName = ds.Tables[i].TableName;
        dataBand.Height = rowHeight;
        dataBand.KeepDetailsTogether = true;
        dataBand.Name = ds.Tables[i].TableName + i.ToString();        
        page.Components.Add(dataBand);
        dataBand.BeforePrint += new EventHandler(dataBand_BeforePrint);

        //details for other tables        
        foreach (DataColumn dataColumn in ds.Tables[i].Columns)
        {
          StiText dataText = new StiText(new RectangleD(pos, 0, columnWidth, rowHeight));
          dataText.Text = "{" + ds.Tables[i].TableName + "." + Stimulsoft.Report.CodeDom.StiCodeDomSerializator.ReplaceSymbols(dataColumn.ColumnName) + "}";
          dataText.Name = "DataText" + nameIndex.ToString() + i.ToString();
          dataText.Font = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Regular);
          dataText.AllowHtmlTags = true;
          dataText.Border = new StiBorder(StiBorderSides.All, Color.FromArgb(200, 200, 200), 1,
            StiPenStyle.Solid, false, 4, new StiSolidBrush(System.Drawing.Color.FromArgb(200, 200, 200)), false);

          //for changing alternative column color.
          if ((nameIndex % 2) != 0)
          {
            dataText.Brush = new StiSolidBrush(System.Drawing.Color.FromArgb(210, 210, 210));
          }          
          dataBand.Components.Add(dataText);
          pos = pos + columnWidth;
          nameIndex++;          
        }
how can I place line below second line of result. It can be easily done through condition of databand while use MRT. but how can I implement same from code side of c#.

thanks

Re: Placing Border at bottom of Second Line in data band.

Posted: Thu Feb 20, 2014 9:10 am
by HighAley
Hello.

You could add a condition. Here is a sample code how to add a Condition.

Code: Select all

StiCondition highlightcond = new StiCondition();
highlightcond.DataType = StiFilterDataType.Numeric;
highlightcond.TextColor = Color.Red;
highlightcond.Column = "{dt." + ColumnName + "}";
highlightcond.Condition = StiFilterCondition.EqualTo;
highlightcond.Value1 = "1";
highlightcond.Font = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Bold);
highlightcond.BackColor = Color.Beige;
highlightcond.Enabled = true;
txtColValue.Conditions.Add(highlightcond); 
Thank you.

Re: Placing Border at bottom of Second Line in data band.

Posted: Mon Mar 03, 2014 5:33 am
by shivkrsingh
thanks

Re: Placing Border at bottom of Second Line in data band.

Posted: Mon Mar 03, 2014 11:28 am
by Alex K.
Hello,

Let us know if you need any additional help.