PDA

View Full Version : راست به چپ کردن محتویاط نشان داده شده در StimulSoft



angoori
چهارشنبه 17 مهر 1392, 06:59 صبح
سلام به همه
من از این تکه کد برای نمایش اطلاعات دیتا گرید تو استیمول سافت استفاده میکنم
ولی هر کاری میکنم نمیتونم راست به چپ ستونهای نمایش داده شده رو تغییر بدم ؟!


private void PrintTable(DataTable data)
{
StiReport report = new StiReport();

//Add data to datastore
report.RegData("data", data);

//Fill dictionary
report.Dictionary.Synchronize();
report.Dictionary.DataSources[0].Name = "data";
report.Dictionary.DataSources[0].Alias = "data";

StiPage page = report.Pages[0];

//Create HeaderBand
StiHeaderBand headerBand = new StiHeaderBand();
headerBand.Height = 0.5;
headerBand.Name = "HeaderBand";
page.Components.Add(headerBand);

//Create Databand
StiDataBand dataBand = new StiDataBand();
dataBand.DataSourceName = "data";
dataBand.Height = 0.5;
dataBand.Name = "DataBand";
page.Components.Add(dataBand);

//Create texts
double pos = 0;

double columnWidth = StiAlignValue.AlignToMinGrid(page.Width / data.Columns.Count, 0.1, true);

int nameIndex = 1;

foreach (DataColumn dataColumn in data.Columns)
{

//Create text on header
StiText headerText = new StiText(new RectangleD(pos, 0, columnWidth, 0.5));
headerText.Text.Value = dataColumn.Caption;
headerText.HorAlignment = StiTextHorAlignment.Center;
headerText.VertAlignment = StiVertAlignment.Center;

headerText.Name = "HeaderText" + nameIndex.ToString();
headerText.Brush = new StiSolidBrush(Color.WhiteSmoke);
headerText.Border.Side = StiBorderSides.All;
headerBand.Components.Add(headerText);

//Create text on Data Band
StiText dataText = new StiText(new RectangleD(pos, 0, columnWidth, rowheight));
dataText.Text.Value = "{data." + Stimulsoft.Report.CodeDom.StiCodeDomSerializator.R eplaceSymbols(dataColumn.ColumnName) + "}";
dataText.Name = "DataText" + nameIndex.ToString();
dataText.Border.Side = StiBorderSides.All;
dataText.HorAlignment = StiTextHorAlignment.Center;


StiCondition condition = new StiCondition();

condition.BackColor = Color.White;
condition.TextColor = Color.Black;
condition.Expression = "(Line & 1) == 1";
condition.Item = StiFilterItem.Expression;
dataText.Conditions.Add(condition);

dataBand.Components.Add(dataText);

pos = pos + columnWidth;

nameIndex++;
}

//Create FooterBand
StiFooterBand footerBand = new StiFooterBand();
footerBand.Height = 0.5;
footerBand.Name = "FooterBand";
page.Components.Add(footerBand);



//Render without progress bar
report.Render(false);
report.Show();
}

hamid_hr
چهارشنبه 17 مهر 1392, 09:10 صبح
srp = new StiReport();
srp.Load("آدرس فايل طراحي شده");
stxt = (StiText)srp.GetComponents()["TxtCol"];
stxt.TextOptions.RightToLeft = true;