PDA

View Full Version : merge کردن سلول های table استیمال رپورت با استفاده از C#



zohre66
سه شنبه 21 آبان 1392, 10:09 صبح
سلام خدمت همه دوستان
چگونه می تونم تو برنامه ام table رو که در استیمال ساخته ام تعدادی از ستون های آن رو merge کنم و یا جدا کنم.
با تشکر از همه دوستان

webpooyan
جمعه 24 آبان 1392, 16:04 عصر
پاسخ خدمت شما عرض شد
موفق باشید

aslan
جمعه 24 آبان 1392, 18:16 عصر
سلام خدمت همه دوستان
چگونه می تونم تو برنامه ام table رو که در استیمال ساخته ام تعدادی از ستون های آن رو merge کنم و یا جدا کنم.
با تشکر از همه دوستان

سلام
به احتمال زیاد منظورتون از طریق کدنویسی هستش که بهترین را ه طراحی جدول در محیط دیزاین استیمول و استفاده از کدهای تولید شده میباشد.
مانند متال زیر :


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Stimulsoft.Report.Components.Table;
using Stimulsoft.Report;
using Stimulsoft.Report.Components;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
/*
System.Data.DataTable tbl = new System.Data.DataTable("f");

tbl.Columns.Add("a", typeof(float));
tbl.Columns.Add("b", typeof(float));

object[] csp = new object[2];
for (int i = 0; i < 50; i = i + 5)
{
csp[0] = i;
csp[1] = 50 - i;
tbl.Rows.Add(csp);
}
DataView objview = new DataView(tbl);
*/
Stimulsoft.Report.StiReport stiReport1 = new Stimulsoft.Report.StiReport();
stiReport1.Load(System.Windows.Forms.Application.S tartupPath + "\\ReportMerge.mrt");
StiPage page = (StiPage)stiReport1.Pages[0].Page;
StiTable table = new StiTable();
table.Name = "Table1";

table.ColumnCount = 2;
table.Width = page.Width;

page.Components.Add(table);

//
// Table1_Cell1
//
StiTableCell Cell1 = new Stimulsoft.Report.Components.Table.StiTableCell();
Cell1.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 0, 3.7, 0.3);
Cell1.ID = 0;
Cell1.JoinCells = new int[0];
Cell1.Name = "Table1_Cell1";
Cell1.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base. Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.FromArgb(255, 105, 105, 105)));
Cell1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.Transparent);
//
// Table1_Cell2
//
StiTableCell Cell2 = new Stimulsoft.Report.Components.Table.StiTableCell();
Cell2.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(3.7, 0, 3.79, 0.3);
Cell2.ID = 1;
Cell2.JoinCells = new int[0];
Cell2.Name = "Table1_Cell2";
Cell2.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base. Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.FromArgb(255, 105, 105, 105)));
Cell2.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.Transparent);
//
// Table1_Cell3
//
StiTableCell Cell3 = new Stimulsoft.Report.Components.Table.StiTableCell();
Cell3.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 0.3, 3.7, 0.3);
Cell3.Enabled = false;
Cell3.ID = 2;
Cell3.JoinCells = new int[0];
Cell3.Name = "Table1_Cell3";
Cell3.ParentJoin = 3;
Cell3.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base. Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.FromArgb(255, 105, 105, 105)));
Cell3.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.Transparent);
//
// Table1_Cell4
//
StiTableCell Cell4 = new Stimulsoft.Report.Components.Table.StiTableCell();
Cell4.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 0.3, 7.49, 0.3);
Cell4.ID = 3;
Cell4.Join = true;
Cell4.JoinCells = new int[] {
2,
3};
Cell4.JoinHeight = 1;
Cell4.JoinWidth = 2;
Cell4.Name = "Table1_Cell4";
Cell4.ParentJoin = 3;
Cell4.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base. Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.FromArgb(255, 105, 105, 105)));
Cell4.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.Transparent);
Cell4.HorAlignment = Stimulsoft.Base.Drawing.StiTextHorAlignment.Center ;
Cell4.VertAlignment = Stimulsoft.Base.Drawing.StiVertAlignment.Center;
Cell4.Text = "این دو تا سلول در هم ادغام شده است";
//
// Table1_Cell5
//
StiTableCell Cell5 = new Stimulsoft.Report.Components.Table.StiTableCell();
Cell5.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 0.6, 3.7, 0.3);
Cell5.ID = 4;
Cell5.JoinCells = new int[0];
Cell5.Name = "Table1_Cell5";
Cell5.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base. Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.FromArgb(255, 105, 105, 105)));
Cell5.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.Transparent);
//
// Table1_Cell6
//
StiTableCell Cell6 = new Stimulsoft.Report.Components.Table.StiTableCell();
Cell6.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(3.7, 0.6, 3.79, 0.3);
Cell6.ID = 5;
Cell6.JoinCells = new int[0];
Cell6.Name = "Table1_Cell6";
Cell6.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base. Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.FromArgb(255, 105, 105, 105)));
Cell6.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.Transparent);
//
// Table1_Cell7
//
StiTableCell Cell7 = new Stimulsoft.Report.Components.Table.StiTableCell();
Cell7.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 0.9, 3.7, 0.3);
Cell7.ID = 6;
Cell7.JoinCells = new int[0];
Cell7.Name = "Table1_Cell7";
Cell7.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base. Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.FromArgb(255, 105, 105, 105)));
Cell7.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.Transparent);
//
// Table1_Cell8
//
StiTableCell Cell8 = new Stimulsoft.Report.Components.Table.StiTableCell();
Cell8.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(3.7, 0.9, 3.79, 0.3);
Cell8.ID = 7;
Cell8.JoinCells = new int[0];
Cell8.Name = "Table1_Cell8";
Cell8.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base. Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.FromArgb(255, 105, 105, 105)));
Cell8.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.Transparent);
//
// Table1_Cell9
//
StiTableCell Cell9 = new Stimulsoft.Report.Components.Table.StiTableCell();
Cell9.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 1.2, 3.7, 0.3);
Cell9.ID = 8;
Cell9.JoinCells = new int[0];
Cell9.Name = "Table1_Cell9";
Cell9.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base. Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.FromArgb(255, 105, 105, 105)));
Cell9.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.Transparent);
//
// Table1_Cell10
//
StiTableCell Cell10 = new Stimulsoft.Report.Components.Table.StiTableCell();
Cell10.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(3.7, 1.2, 3.79, 0.3);
Cell10.ID = 9;
Cell10.JoinCells = new int[0];
Cell10.Name = "Table1_Cell10";
Cell10.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base. Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.FromArgb(255, 105, 105, 105)));
Cell10.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawi ng.Color.Transparent);

table.Page = page;
table.Parent = page;
Cell1.Page = page;
Cell1.Parent =table;
Cell2.Page = page;
Cell2.Parent = table;
Cell3.Page = page;
Cell3.Parent = table;
Cell4.Page = page;
Cell4.Parent = table;
Cell5.Page = page;
Cell5.Parent = table;
Cell6.Page = page;
Cell6.Parent = table;
Cell7.Page = page;
Cell7.Parent = table;
Cell8.Page = page;
Cell8.Parent = table;
Cell9.Page = page;
Cell9.Parent = table;
Cell10.Page = page;
Cell10.Parent = table;
//
// Add to Table1.Components
//
table.Components.Clear();
table.Components.AddRange(new Stimulsoft.Report.Components.StiComponent[] {
Cell1,
Cell2,
Cell3,
Cell4,
Cell5,
Cell6,
Cell7,
Cell8,
Cell9,
Cell10});
//
// Add to Page1.Components
//
page.Components.Clear();
page.Components.AddRange(new Stimulsoft.Report.Components.StiComponent[] {
table});

stiReport1.Compile();
// stiReport1.RegData("viewTest", objview);
// stiReport1.Design();
stiReport1.Show();
}
}
}


بجای پیام خصوصی کدها را از طریق همین تاپیک ارسال کردم شاید به درد کس دیگه ای هم خورد
موفق باشید

FastCode
جمعه 24 آبان 1392, 18:46 عصر
استیمیول شنیده بودیم.ولی استیمال نه.

FastCode
جمعه 24 آبان 1392, 19:26 عصر
تو چقدر میفهمی.
من به تلفظ بریتیش افتضاحش اشاره کردم که یعنی "اگر بخواهی غلط تلفظ کنی باید بگی فلان.اینی که داری میگی از غلط هم بدتره."

FastCode
جمعه 24 آبان 1392, 20:03 عصر
تو چقدر میفهمی.خیلیکاملا مشخصه.چون
۱.من سوال نکردم که جواب بدی.
۲.وسط quote جواب نمیدن.