本文整理汇总了C#中System.Data.DataView.set_Sort方法的典型用法代码示例。如果您正苦于以下问题:C# DataView.set_Sort方法的具体用法?C# DataView.set_Sort怎么用?C# DataView.set_Sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.DataView
的用法示例。
在下文中一共展示了DataView.set_Sort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateReportFromDataTable
public static StiReport GenerateReportFromDataTable(System.Data.DataTable dataTable, string reportHeader, StiPageOrientation orientation)
{
if ((dataTable == null) || (dataTable.Rows.get_Count() == 0))
{
throw new System.ApplicationException("Не сформирован входящий набор данных.");
}
StiReport report = new StiReport();
report.RegData("data", (System.Data.DataTable) dataTable);
report.Dictionary.Synchronize();
report.Dictionary.DataSources[0].Name = "data";
report.Dictionary.DataSources[0].Alias = "data";
StiReportTitleBand titleBand = new StiReportTitleBand {
Height = 2.0,
Name = "TitleBand"
};
StiText component = new StiText(new RectangleD(0.0, 0.0, 30.0, 1.0), reportHeader) {
DockStyle = StiDockStyle.Top,
HorAlignment = StiTextHorAlignment.Center,
Name = "TextHeader",
Font = (System.Drawing.Font) new System.Drawing.Font("Arial", 12f, System.Drawing.FontStyle.Regular),
Editable = true
};
titleBand.Components.Add(component);
StiDataBand dataBand = new StiDataBand {
DataSourceName = "data",
Height = 1.0,
Name = "DataBand"
};
double x = 0.0;
double y = 0.0;
double height = 1.0;
System.Data.DataView view = new System.Data.DataView(dataTable);
view.set_Sort("OrderColumn");
int num4 = 0;
foreach (System.Data.DataRow row in view.ToTable("OutputTable").Rows)
{
if (System.Convert.ToBoolean(row.get_Item("PrintColumn")))
{
double width = System.Convert.ToDouble(row.get_Item("WidthColumn"));
component = CreateHeaderStiText("TextHeader" + ((int) num4), row.get_Item("HeaderColumn").ToString(), x, 1.0, width, 1.0);
StiText dataText = CreateDataStiText("TextData" + ((int) num4), row.get_Item("DataColumn").ToString(), System.Convert.ToBoolean(row.get_Item("AlignColumn")), x, y, width, height);
AddStitexts(component, dataText, ref titleBand, ref dataBand, ref x, width);
}
num4 = (int) (num4 + 1);
}
report.Pages[0].Components.Add(titleBand);
report.Pages[0].Components.Add(dataBand);
report.Pages[0].Orientation = orientation;
report.Pages[0].Margins = new StiMargins(0.5, 0.5, 0.5, 0.5);
return report;
}