MVCxGridViewGeneratorHelper.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. using Autofac;
  2. using DevExpress.Data;
  3. using DevExpress.XtraEditors.Controls;
  4. using DevExpress.XtraPrinting;
  5. using DevExpress.XtraReports.UI;
  6. using GreenTree.Nachtragsmanagement.Core;
  7. using GreenTree.Nachtragsmanagement.Core.Authentication;
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. using System.Drawing;
  12. using System.IO;
  13. using System.Linq;
  14. using System.Net.Mime;
  15. using System.Web;
  16. namespace GreenTree.Nachtragsmanagement.Web.Extensions
  17. {
  18. public class MVCxGridViewGeneratorHelper
  19. {
  20. public delegate void CustomizeColumnsCollectionEventHandler(object source, ColumnsCreationEventArgs e);
  21. public delegate void CustomizeColumnEventHandler(object source, ControlCustomizationEventArgs e);
  22. public delegate void CustomizeFormattingRulesEventHandler(object source, CustomFormattingRulesEventArgs e);
  23. public delegate void CustomizeColumnTotalSummaryEventHandler(object source, ColumnSummaryCreationEventArgs e);
  24. public delegate void CustomizeColumnGroupSummaryEventHandler(object source, ColumnSummaryCreationEventArgs e);
  25. public class MVCReportGeneratonHelper
  26. {
  27. const int initialGroupOffset = 0;
  28. const int subGroupOffset = 10;
  29. const int bandHeight = 20;
  30. const bool shouldRepeatGroupHeadersOnEveryPage = false;
  31. XtraReport report;
  32. Hashtable detailsInfo = new Hashtable();
  33. Hashtable detailsWidth = new Hashtable();
  34. public event CustomizeColumnsCollectionEventHandler CustomizeColumnsCollection;
  35. public event CustomizeColumnEventHandler CustomizeColumn;
  36. public event CustomizeFormattingRulesEventHandler CustomizeFormattingRules;
  37. public event CustomizeColumnTotalSummaryEventHandler CustomizeTotalColumnSummary;
  38. public event CustomizeColumnGroupSummaryEventHandler CustomizeGroupColumnSummary;
  39. public XtraReport GenerateMVCReport(MVCxGridViewState gridViewState, object model, string title)
  40. {
  41. report = new XtraReport
  42. {
  43. Font = new Font("Calibri", 10f, FontStyle.Regular),
  44. Landscape = true,
  45. PaperKind = System.Drawing.Printing.PaperKind.A4
  46. };
  47. InitStyles();
  48. InitReportTitle(title);
  49. InitDataSource(model);
  50. InitDetailsAndPageHeader(gridViewState);
  51. InitDetailReports(gridViewState);
  52. InitSortings(gridViewState);
  53. InitGroupHeaders(gridViewState);
  54. InitFilters(gridViewState);
  55. InitTotalSummaries(gridViewState);
  56. InitPageFooter();
  57. return report;
  58. }
  59. private void InitStyles()
  60. {
  61. report.StyleSheet.Add(new XRControlStyle
  62. {
  63. Name = "Title",
  64. Borders = DevExpress.XtraPrinting.BorderSide.None,
  65. Font = new Font(report.Font.FontFamily, 24f, FontStyle.Regular),
  66. ForeColor = Color.FromArgb(35, 133, 160)
  67. });
  68. report.StyleSheet.Add(new XRControlStyle
  69. {
  70. Name = "OddRow",
  71. Borders = (DevExpress.XtraPrinting.BorderSide.Bottom |
  72. DevExpress.XtraPrinting.BorderSide.Left |
  73. DevExpress.XtraPrinting.BorderSide.Right),
  74. Padding = new PaddingInfo(30, 600)
  75. });
  76. report.StyleSheet.Add(new XRControlStyle
  77. {
  78. Name = "EvenRow",
  79. BackColor = Color.LightGray,
  80. Borders = (DevExpress.XtraPrinting.BorderSide.Bottom |
  81. DevExpress.XtraPrinting.BorderSide.Left |
  82. DevExpress.XtraPrinting.BorderSide.Right),
  83. Padding = new PaddingInfo(30, 600)
  84. });
  85. report.StyleSheet.Add(new XRControlStyle
  86. {
  87. Name = "HeaderRow",
  88. BackColor = Color.FromArgb(156, 183, 191),
  89. Borders = DevExpress.XtraPrinting.BorderSide.All,
  90. Padding = new PaddingInfo(30, 600),
  91. Font = new Font(report.Font, FontStyle.Bold)
  92. });
  93. report.StyleSheet.Add(new XRControlStyle
  94. {
  95. Name = "GroupHeader",
  96. BackColor = Color.Beige,
  97. Borders = DevExpress.XtraPrinting.BorderSide.All,
  98. Padding = new PaddingInfo(30, 600),
  99. Font = new Font(report.Font, FontStyle.Bold)
  100. });
  101. report.StyleSheet.Add(new XRControlStyle
  102. {
  103. Name = "SummaryRow",
  104. BackColor = Color.FromArgb(35, 133, 160),
  105. Borders = DevExpress.XtraPrinting.BorderSide.All,
  106. BorderColor = Color.FromArgb(35, 133, 160),
  107. Padding = new PaddingInfo(30, 600),
  108. ForeColor = Color.White,
  109. Font = new Font(report.Font, FontStyle.Bold)
  110. });
  111. report.StyleSheet.Add(new XRControlStyle
  112. {
  113. Name = "DetailRow",
  114. BackColor = Color.FromArgb(209, 228, 255),
  115. Borders = DevExpress.XtraPrinting.BorderSide.All
  116. });
  117. report.StyleSheet.Add(new XRControlStyle
  118. {
  119. Name = "DetailRowLabel",
  120. Padding = new PaddingInfo(30, 600),
  121. Borders = DevExpress.XtraPrinting.BorderSide.Bottom |
  122. DevExpress.XtraPrinting.BorderSide.Left |
  123. DevExpress.XtraPrinting.BorderSide.Right
  124. });
  125. report.StyleSheet.Add(new XRControlStyle
  126. {
  127. Name = "FooterRow",
  128. Font = new Font(report.Font, FontStyle.Italic)
  129. });
  130. }
  131. private void InitReportTitle(string title)
  132. {
  133. report.Bands.Add(new ReportHeaderBand
  134. {
  135. HeightF = 32f
  136. });
  137. report.Bands[BandKind.ReportHeader].Controls.Add(new XRLabel
  138. {
  139. Text = title,
  140. StyleName = "Title",
  141. WidthF = (report.PageWidth - (report.Margins.Left + report.Margins.Right))
  142. });
  143. }
  144. private void InitDataSource(object model)
  145. {
  146. report.DataSource = model;
  147. }
  148. private void InitDetailsAndPageHeader(MVCxGridViewState gridViewState)
  149. {
  150. var groupedColumns = gridViewState.GroupedColumns;
  151. var pagewidth = (report.PageWidth - (report.Margins.Left + report.Margins.Right)) - groupedColumns.Count * subGroupOffset;
  152. var columns = GetColumnsInfo(gridViewState, pagewidth);
  153. if (CustomizeColumnsCollection != null)
  154. CustomizeColumnsCollection(report, new ColumnsCreationEventArgs(pagewidth)
  155. {
  156. ColumnsInfo = columns
  157. });
  158. report.Bands.Add(new DetailBand()
  159. {
  160. HeightF = bandHeight,
  161. KeepTogetherWithDetailReports = true
  162. });
  163. report.Bands.Add(new PageHeaderBand()
  164. {
  165. HeightF = bandHeight
  166. });
  167. var headerTable = new XRTable()
  168. {
  169. StyleName = "HeaderRow"
  170. };
  171. var row = new XRTableRow();
  172. var detailTable = new XRTable
  173. {
  174. OddStyleName = "OddRow",
  175. EvenStyleName = "EvenRow"
  176. };
  177. var row2 = new XRTableRow();
  178. for (var i = 0; i < columns.Count; i++)
  179. {
  180. if (columns[i].IsVisible)
  181. {
  182. var cell = new XRTableCell
  183. {
  184. Width = columns[i].ColumnWidth,
  185. Text = columns[i].GridViewColumn.Caption,
  186. Borders = DevExpress.XtraPrinting.BorderSide.All,
  187. TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
  188. };
  189. row.Cells.Add(cell);
  190. var cell2 = new XRTableCell
  191. {
  192. Width = columns[i].ColumnWidth
  193. };
  194. var cc = new ControlCustomizationEventArgs
  195. {
  196. FieldName = columns[i].FieldName,
  197. IsModified = false,
  198. Owner = cell2,
  199. Header = cell
  200. };
  201. if (CustomizeColumn != null)
  202. CustomizeColumn(report, cc);
  203. if (cc.IsModified == false)
  204. {
  205. cell2.DataBindings.Add("Text", null, columns[i].FieldName,
  206. "{0:" + columns[i].GridViewColumn.DisplayFormat + "}");
  207. }
  208. detailsInfo.Add(columns[i].GridViewColumn, cell2);
  209. row2.Cells.Add(cell2);
  210. detailsWidth.Add(columns[i].GridViewColumn, cell2.WidthF);
  211. }
  212. }
  213. if (CustomizeFormattingRules != null)
  214. CustomizeFormattingRules(report, new CustomFormattingRulesEventArgs { Rules = report.FormattingRuleSheet });
  215. foreach (var rule in report.FormattingRuleSheet)
  216. detailTable.FormattingRules.Add(rule);
  217. headerTable.Rows.Add(row);
  218. headerTable.Width = pagewidth;
  219. headerTable.LocationF = new PointF(groupedColumns.Count * subGroupOffset, 0);
  220. headerTable.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
  221. detailTable.Rows.Add(row2);
  222. detailTable.LocationF = new PointF(groupedColumns.Count * subGroupOffset, 0);
  223. detailTable.Width = pagewidth;
  224. report.Bands[BandKind.PageHeader].Controls.Add(headerTable);
  225. report.Bands[BandKind.Detail].Controls.Add(detailTable);
  226. }
  227. private void InitDetailReports(MVCxGridViewState gridViewState)
  228. {
  229. var groupedColumns = gridViewState.GroupedColumns;
  230. var pagewidth = (report.PageWidth - (report.Margins.Left + report.Margins.Right)) - groupedColumns.Count * subGroupOffset;
  231. var columns = GetColumnsInfo(gridViewState, pagewidth);
  232. if (CustomizeColumnsCollection != null)
  233. CustomizeColumnsCollection(report, new ColumnsCreationEventArgs(pagewidth)
  234. {
  235. ColumnsInfo = columns
  236. });
  237. var detailColumns = columns
  238. .Where(c => c.IsDetail)
  239. .ToList();
  240. if (!detailColumns.Any()) return;
  241. var detailReportBand = new DetailReportBand()
  242. {
  243. HeightF = bandHeight
  244. };
  245. report.Bands.Add(detailReportBand);
  246. var detailReportTable = new XRTable
  247. {
  248. OddStyleName = "DetailRow",
  249. EvenStyleName = "DetailRow",
  250. WidthF = pagewidth
  251. };
  252. var detailReportRow = new XRTableRow();
  253. foreach (var detailColumn in detailColumns)
  254. {
  255. var cellDetail = new XRTableCell
  256. {
  257. WidthF = pagewidth / detailColumns.Count
  258. };
  259. var label = new XRLabel
  260. {
  261. StyleName = "DetailRowLabel",
  262. WidthF = pagewidth / detailColumns.Count,
  263. WordWrap = true
  264. };
  265. label.DataBindings.Add("Text", null, detailColumn.FieldName,
  266. "{0:" + detailColumn.GridViewColumn.DisplayFormat + "}");
  267. cellDetail.Controls.Add(label);
  268. detailReportRow.Cells.Add(cellDetail);
  269. }
  270. detailReportTable.Rows.Add(detailReportRow);
  271. detailReportTable.LocationF = new PointF(groupedColumns.Count * subGroupOffset, 0);
  272. DetailBand detailBand = new DetailBand();
  273. detailBand.Height = detailReportTable.Height;
  274. detailReportBand.Bands.Add(detailBand);
  275. detailBand.Controls.Add(detailReportTable);
  276. }
  277. private void InitSortings(MVCxGridViewState gridViewState)
  278. {
  279. var columns = gridViewState.Columns;
  280. var groupedColumns = gridViewState.GroupedColumns;
  281. for (var i = 0; i < columns.Count; i++)
  282. {
  283. if (!groupedColumns.Contains(columns[i]))
  284. {
  285. if (columns[i].SortOrder != ColumnSortOrder.None)
  286. ((DetailBand)report.Bands[BandKind.Detail]).SortFields.Add(new GroupField(columns[i].FieldName, columns[i].SortOrder == ColumnSortOrder.Ascending ? XRColumnSortOrder.Ascending : XRColumnSortOrder.Descending));
  287. }
  288. }
  289. }
  290. private void InitGroupHeaders(MVCxGridViewState gridViewState)
  291. {
  292. var groupedColumns = gridViewState.GroupedColumns;
  293. for (var i = groupedColumns.Count - 1; i >= 0; i--)
  294. {
  295. var groupedColumn = groupedColumns[i];
  296. var gb = new GroupHeaderBand
  297. {
  298. Height = bandHeight
  299. };
  300. var groupHeaderTable = new XRTable
  301. {
  302. StyleName = "GroupHeader",
  303. LocationF = new PointF(initialGroupOffset + i * 10, 0),
  304. SizeF = new SizeF((report.PageWidth - (report.Margins.Left + report.Margins.Right)) - (initialGroupOffset + i * subGroupOffset), bandHeight)
  305. };
  306. var groupHeaderRow = new XRTableRow();
  307. var l = new XRTableCell
  308. {
  309. Text = groupedColumn.Caption + ": [" + groupedColumn.FieldName + "]",
  310. Borders = DevExpress.XtraPrinting.BorderSide.Left |
  311. DevExpress.XtraPrinting.BorderSide.Top |
  312. DevExpress.XtraPrinting.BorderSide.Bottom
  313. };
  314. groupHeaderRow.Cells.Add(l);
  315. foreach (MVCxSummaryItemState item in gridViewState.TotalSummary)
  316. {
  317. var sum = new XRTableCell
  318. {
  319. Borders = DevExpress.XtraPrinting.BorderSide.Top |
  320. DevExpress.XtraPrinting.BorderSide.Bottom
  321. };
  322. sum.Summary = new XRSummary
  323. {
  324. Running = SummaryRunning.Group
  325. };
  326. sum.Summary.Func = GetSummaryFunc(item.SummaryType);
  327. sum.DataBindings.Add("Text", null, item.FieldName);
  328. groupHeaderRow.Cells.Add(sum);
  329. if (CustomizeGroupColumnSummary != null)
  330. CustomizeGroupColumnSummary(report, new ColumnSummaryCreationEventArgs(item.FieldName, sum.Summary));
  331. }
  332. groupHeaderTable.Rows.Add(groupHeaderRow);
  333. gb.Controls.Add(groupHeaderTable);
  334. gb.RepeatEveryPage = shouldRepeatGroupHeadersOnEveryPage;
  335. var gf = new GroupField(
  336. groupedColumn.FieldName, groupedColumn.SortOrder == ColumnSortOrder.Ascending
  337. ? XRColumnSortOrder.Ascending
  338. : XRColumnSortOrder.Descending);
  339. gb.GroupFields.Add(gf);
  340. report.Bands.Add(gb);
  341. }
  342. }
  343. private void InitFilters(MVCxGridViewState gridViewState)
  344. {
  345. report.FilterString = gridViewState.FilterExpression;
  346. }
  347. private void InitTotalSummaries(MVCxGridViewState gridViewState)
  348. {
  349. if (gridViewState.TotalSummary.Count == 0) return;
  350. report.Bands.Add(new ReportFooterBand
  351. {
  352. HeightF = bandHeight,
  353. StyleName = "SummaryRow"
  354. });
  355. foreach (MVCxSummaryItemState item in gridViewState.TotalSummary)
  356. {
  357. var col = gridViewState.Columns[item.ShowInColumn == string.Empty
  358. ? item.FieldName
  359. : item.ShowInColumn];
  360. if (col == null) continue;
  361. if (!detailsInfo.Contains(col)) continue;
  362. var label = new XRLabel
  363. {
  364. LocationF = new PointF(
  365. ((XRTableCell)detailsInfo[col]).LocationF.X + subGroupOffset * gridViewState.GroupedColumns.Count,
  366. ((XRTableCell)detailsInfo[col]).LocationF.Y),
  367. SizeF = ((XRTableCell)detailsInfo[col]).SizeF
  368. };
  369. label.DataBindings.Add("Text", null, col.FieldName);
  370. label.Summary = new XRSummary
  371. {
  372. Running = SummaryRunning.Report
  373. };
  374. label.Summary.FormatString = item.DisplayFormat;
  375. label.Summary.Func = GetSummaryFunc(item.SummaryType);
  376. report.Bands[BandKind.ReportFooter].Controls.Add(label);
  377. if (CustomizeTotalColumnSummary != null)
  378. CustomizeTotalColumnSummary(report, new ColumnSummaryCreationEventArgs(col.FieldName, label.Summary));
  379. }
  380. }
  381. private void InitPageFooter()
  382. {
  383. var userHelper = Singleton<IContainer>.Instance.Resolve<IUserHelper>();
  384. var user = userHelper.FromCookies();
  385. report.Bands.Add(new PageFooterBand
  386. {
  387. HeightF = 23f
  388. });
  389. var footerTable = new XRTable
  390. {
  391. WidthF = (report.PageWidth - (report.Margins.Left + report.Margins.Right)),
  392. HeightF = 23f,
  393. Borders = DevExpress.XtraPrinting.BorderSide.Top,
  394. StyleName = "FooterRow"
  395. };
  396. var footerRow = new XRTableRow
  397. {
  398. Cells =
  399. {
  400. new XRTableCell
  401. {
  402. TextAlignment = TextAlignment.MiddleLeft,
  403. Text = DateTime.Now.ToString("dd.MM.yyyy - HH:mm \"Uhr\" |"),
  404. WidthF = 145f,
  405. HeightF = 23f
  406. },
  407. new XRTableCell
  408. {
  409. Controls =
  410. {
  411. new XRPageInfo
  412. {
  413. TextAlignment = TextAlignment.MiddleLeft,
  414. Format = "Seite {0} von {1}",
  415. PageInfo = PageInfo.NumberOfTotal,
  416. StartPageNumber = 1,
  417. Padding = 5,
  418. HeightF = 23f
  419. }
  420. },
  421. WidthF = 100f,
  422. HeightF = 23f
  423. },
  424. new XRTableCell
  425. {
  426. TextAlignment = TextAlignment.MiddleRight,
  427. Text = String.Format("{0}, {1}", user.Lastname, user.Forename),
  428. WidthF = (report.PageWidth - (report.Margins.Left + report.Margins.Right)) - 230
  429. }
  430. }
  431. };
  432. footerTable.Rows.Add(footerRow);
  433. report.Bands[BandKind.PageFooter].Controls.Add(footerTable);
  434. }
  435. private List<MVCxColumnInfo> GetColumnsInfo(MVCxGridViewState gridViewState, int pagewidth)
  436. {
  437. var columns = new List<MVCxColumnInfo>();
  438. var visibleColumns = gridViewState.Columns;
  439. foreach (var dataColumn in visibleColumns)
  440. {
  441. MVCxColumnInfo column = new MVCxColumnInfo(dataColumn)
  442. {
  443. ColumnCaption = string.IsNullOrEmpty(dataColumn.Caption) ? dataColumn.FieldName : dataColumn.Caption,
  444. ColumnWidth = ((int)pagewidth / visibleColumns.Count),
  445. FieldName = dataColumn.FieldName,
  446. IsVisible = true
  447. };
  448. columns.Add(column);
  449. }
  450. return columns;
  451. }
  452. private SummaryFunc GetSummaryFunc(SummaryItemType summaryItemType)
  453. {
  454. switch (summaryItemType)
  455. {
  456. case SummaryItemType.Sum:
  457. return SummaryFunc.Sum;
  458. case SummaryItemType.Average:
  459. return SummaryFunc.Avg;
  460. case SummaryItemType.Max:
  461. return SummaryFunc.Max;
  462. case SummaryItemType.Min:
  463. return SummaryFunc.Min;
  464. case SummaryItemType.Count:
  465. return SummaryFunc.Count;
  466. default:
  467. return SummaryFunc.Custom;
  468. }
  469. }
  470. public void WritePdfToResponse(HttpResponseBase Response, string fileName, string type)
  471. {
  472. report.CreateDocument(false);
  473. using (MemoryStream ms = new MemoryStream())
  474. {
  475. report.ExportToPdf(ms);
  476. ms.Seek(0, SeekOrigin.Begin);
  477. WriteResponse(Response, ms.ToArray(), "application/pdf", type, fileName);
  478. }
  479. }
  480. public void WriteXlsToResponse(HttpResponseBase Response, string fileName, string type)
  481. {
  482. report.CreateDocument(false);
  483. using (MemoryStream ms = new MemoryStream())
  484. {
  485. report.ExportToXls(ms);
  486. ms.Seek(0, SeekOrigin.Begin);
  487. WriteResponse(Response, ms.ToArray(), "application/vnd.ms-excel", type, fileName);
  488. }
  489. }
  490. public void WriteXlsxToResponse(HttpResponseBase Response, string fileName, string type)
  491. {
  492. report.CreateDocument(false);
  493. using (MemoryStream ms = new MemoryStream())
  494. {
  495. report.ExportToXlsx(ms);
  496. ms.Seek(0, SeekOrigin.Begin);
  497. WriteResponse(Response, ms.ToArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", type, fileName);
  498. }
  499. }
  500. public static void WriteResponse(HttpResponseBase response, byte[] filearray, string contentType, string type, string fileName)
  501. {
  502. response.ClearContent();
  503. response.Buffer = true;
  504. response.Cache.SetCacheability(HttpCacheability.Private);
  505. response.ContentType = contentType;
  506. ContentDisposition contentDisposition = new ContentDisposition();
  507. contentDisposition.FileName = fileName;
  508. contentDisposition.DispositionType = type;
  509. response.AddHeader("Content-Disposition", contentDisposition.ToString());
  510. response.BinaryWrite(filearray);
  511. HttpContext.Current.ApplicationInstance.CompleteRequest();
  512. try
  513. {
  514. response.End();
  515. }
  516. catch (System.Threading.ThreadAbortException)
  517. {
  518. }
  519. }
  520. }
  521. public class CustomFormattingRulesEventArgs : EventArgs
  522. {
  523. private FormattingRuleSheet rules;
  524. public FormattingRuleSheet Rules
  525. {
  526. get { return rules; }
  527. set { rules = value; }
  528. }
  529. }
  530. public class ControlCustomizationEventArgs : EventArgs
  531. {
  532. XRControl owner;
  533. public XRControl Owner
  534. {
  535. get
  536. {
  537. return owner;
  538. }
  539. set
  540. {
  541. owner = value;
  542. }
  543. }
  544. XRControl header;
  545. public XRControl Header
  546. {
  547. get
  548. {
  549. return header;
  550. }
  551. set
  552. {
  553. header = value;
  554. }
  555. }
  556. bool isModified;
  557. public bool IsModified
  558. {
  559. get
  560. {
  561. return isModified;
  562. }
  563. set
  564. {
  565. isModified = value;
  566. }
  567. }
  568. string fieldName;
  569. public string FieldName
  570. {
  571. get
  572. {
  573. return fieldName;
  574. }
  575. set
  576. {
  577. fieldName = value;
  578. }
  579. }
  580. }
  581. public class ColumnSummaryCreationEventArgs : EventArgs
  582. {
  583. public ColumnSummaryCreationEventArgs(string fieldName, XRSummary summary)
  584. {
  585. this.fieldName = fieldName;
  586. this.summary = summary;
  587. }
  588. XRSummary summary;
  589. public XRSummary Summary
  590. {
  591. get
  592. {
  593. return summary;
  594. }
  595. set
  596. {
  597. summary = value;
  598. }
  599. }
  600. string fieldName;
  601. public string FieldName
  602. {
  603. get
  604. {
  605. return fieldName;
  606. }
  607. set
  608. {
  609. fieldName = value;
  610. }
  611. }
  612. }
  613. public class ColumnsCreationEventArgs : EventArgs
  614. {
  615. int pageWidth;
  616. public int PageWidth
  617. {
  618. get
  619. {
  620. return pageWidth;
  621. }
  622. }
  623. public ColumnsCreationEventArgs(int pageWidth)
  624. {
  625. this.pageWidth = pageWidth;
  626. }
  627. List<MVCxColumnInfo> columnsInfo;
  628. public List<MVCxColumnInfo> ColumnsInfo
  629. {
  630. get
  631. {
  632. return columnsInfo;
  633. }
  634. set
  635. {
  636. columnsInfo = value;
  637. }
  638. }
  639. }
  640. public class MVCxColumnInfo
  641. {
  642. public MVCxColumnInfo(GridViewDataColumnState gridViewColumn)
  643. {
  644. this.gridViewColumn = gridViewColumn;
  645. }
  646. GridViewDataColumnState gridViewColumn;
  647. public GridViewDataColumnState GridViewColumn
  648. {
  649. get
  650. {
  651. return gridViewColumn;
  652. }
  653. }
  654. string columnCaption;
  655. public string ColumnCaption
  656. {
  657. get
  658. {
  659. return columnCaption;
  660. }
  661. set
  662. {
  663. columnCaption = value;
  664. }
  665. }
  666. string fieldName;
  667. public string FieldName
  668. {
  669. get
  670. {
  671. return fieldName;
  672. }
  673. set
  674. {
  675. fieldName = value;
  676. }
  677. }
  678. int columnWidth;
  679. public int ColumnWidth
  680. {
  681. get
  682. {
  683. return columnWidth;
  684. }
  685. set
  686. {
  687. columnWidth = value;
  688. }
  689. }
  690. bool isVisible;
  691. public bool IsVisible
  692. {
  693. get
  694. {
  695. return isVisible;
  696. }
  697. set
  698. {
  699. isVisible = value;
  700. }
  701. }
  702. bool isDetail;
  703. public bool IsDetail
  704. {
  705. get
  706. {
  707. return isDetail;
  708. }
  709. set
  710. {
  711. isDetail = value;
  712. }
  713. }
  714. }
  715. }
  716. }