سلام دوستان
من یک دیتاتیبل ساختم و یک دیتا باندی ساختم که اطلاعات رو به اون پاس دادم
من یه دیتا باندی داخل گزارشم طراحی کردم که میخوام دیتاباند داخل گزارشم مثل دیتاباند ساخته شده در c# باشه
به عنوانی دیگر : نمیخوام دیتاباند درون سی شارپ را اضافه کنم فقط میخوام اطلاعاتشو پاس بده بده دیتاباند داخل گزارشم
چکار باید بکنم ؟
stiReport1.RegData(table);
StiPage page = stiReport1.Pages.Items[0];
StiHeaderBand headerband = new StiHeaderBand();
headerband.Height = 0.5f;
headerband.Name = "headerband";
page.Components.Add(headerband);
StiDataBand databand = new StiDataBand();
databand.RightToLeft = true;
databand.DataSourceName = table.TableName;
databand.Name = table.TableName+"s";
page.Components.Add(databand);
//page.Components["Datadatagrid12"] = databand;
Double pos = page.Width;
int nameIndex = 1;
foreach (DataColumn column in table.Columns)
{
Double columnWidth = datagrid1.Columns[column.Caption].Width / 37.936;
StiText headerText = new StiText(new RectangleD(pos-columnWidth , 0, columnWidth, 0.5f));
headerText.Text.Value =datagrid1.Columns[column.Caption].HeaderText ;
headerText.HorAlignment = StiTextHorAlignment.Center;
headerText.Name = "HeaderText" + nameIndex.ToString();
headerText.Brush = new StiSolidBrush(Color.LightGreen);
headerText.Border.Side = StiBorderSides.All;
headerband.Components.Add(headerText);
//Create text on Data Band
StiText dataText = new StiText(new RectangleD(pos- columnWidth, 0, columnWidth, 0.5f));
dataText.Text.Value = "{" + table.TableName + "." +
Stimulsoft.Report.CodeDom.StiCodeDomSerializator.ReplaceSymbols(column.ColumnName) + "}";
dataText.Font = datagrid1.Font;
if (datagrid1.Columns[nameIndex].DefaultCellStyle.Alignment == DataGridViewContentAlignment.MiddleRight)
{
dataText.HorAlignment = StiTextHorAlignment.Right;
}
else if (datagrid1.Columns[nameIndex].DefaultCellStyle.Alignment == DataGridViewContentAlignment.MiddleLeft)
{
dataText.HorAlignment = StiTextHorAlignment.Left;
}
else
{
dataText.HorAlignment = StiTextHorAlignment.Center;
}
dataText.Name = "DataText" + nameIndex.ToString();
dataText.Border.Side = StiBorderSides.All;
pos -= columnWidth;
nameIndex++;
}
stiReport1.Show();