AssemblyInitializer.cs 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. using FastReport.Utils;
  2. using FastReport.Data;
  3. using FastReport.Table;
  4. using FastReport.Export.Image;
  5. using FastReport.Barcode;
  6. using FastReport.Matrix;
  7. using FastReport.CrossView;
  8. using FastReport.Format;
  9. using FastReport.Functions;
  10. using FastReport.Gauge.Linear;
  11. using FastReport.Gauge.Simple;
  12. using FastReport.Gauge.Radial;
  13. using FastReport.Gauge.Simple.Progress;
  14. using System.Runtime.CompilerServices;
  15. namespace FastReport
  16. {
  17. /// <summary>
  18. /// The FastReport.dll assembly initializer.
  19. /// </summary>
  20. public sealed class AssemblyInitializer : AssemblyInitializerBase
  21. {
  22. /// <summary>
  23. /// Registers all core objects, wizards, export filters.
  24. /// </summary>
  25. public AssemblyInitializer()
  26. {
  27. // report
  28. RegisteredObjects.AddReport(typeof(Report), 134);
  29. // pages
  30. RegisteredObjects.AddPage(typeof(ReportPage), "ReportPage", 135);
  31. // data items
  32. RegisteredObjects.InternalAdd(typeof(Column), "", 0);
  33. RegisteredObjects.InternalAdd(typeof(CommandParameter), "", 0);
  34. RegisteredObjects.InternalAdd(typeof(ProcedureParameter), "", 0);
  35. RegisteredObjects.InternalAdd(typeof(Relation), "", 0);
  36. RegisteredObjects.InternalAdd(typeof(Parameter), "", 0);
  37. RegisteredObjects.InternalAdd(typeof(Total), "", 0);
  38. RegisteredObjects.InternalAdd(typeof(TableDataSource), "", 0);
  39. RegisteredObjects.InternalAdd(typeof(ProcedureDataSource), "", 0);
  40. RegisteredObjects.InternalAdd(typeof(ViewDataSource), "", 0);
  41. RegisteredObjects.InternalAdd(typeof(BusinessObjectDataSource), "", 0);
  42. RegisteredObjects.InternalAdd(typeof(SliceCubeSource), "", 0);
  43. RegisteredObjects.InternalAddConnection(typeof(XmlDataConnection));
  44. RegisteredObjects.InternalAddConnection(typeof(CsvDataConnection));
  45. // json
  46. RegisteredObjects.InternalAdd(typeof(Data.JsonConnection.JsonTableDataSource), "", 0);
  47. //RegisteredObjects.Add(typeof(Data.JsonConnection.JsonObjectDataSource), "", 0);
  48. //RegisteredObjects.Add(typeof(Data.JsonConnection.JsonArrayDataSource), "", 0);
  49. RegisteredObjects.InternalAddConnection(typeof(Data.JsonConnection.JsonDataSourceConnection));
  50. // formats
  51. RegisteredObjects.InternalAdd(typeof(BooleanFormat), "", 0);
  52. RegisteredObjects.InternalAdd(typeof(CurrencyFormat), "", 0);
  53. RegisteredObjects.InternalAdd(typeof(CustomFormat), "", 0);
  54. RegisteredObjects.InternalAdd(typeof(DateFormat), "", 0);
  55. RegisteredObjects.InternalAdd(typeof(GeneralFormat), "", 0);
  56. RegisteredObjects.InternalAdd(typeof(NumberFormat), "", 0);
  57. RegisteredObjects.InternalAdd(typeof(PercentFormat), "", 0);
  58. RegisteredObjects.InternalAdd(typeof(TimeFormat), "", 0);
  59. // bands
  60. RegisteredObjects.Add(typeof(ReportTitleBand), "", 154, "Objects,Bands,ReportTitle");
  61. RegisteredObjects.Add(typeof(ReportSummaryBand), "", 155, "Objects,Bands,ReportSummary");
  62. RegisteredObjects.Add(typeof(PageHeaderBand), "", 156, "Objects,Bands,PageHeader");
  63. RegisteredObjects.Add(typeof(PageFooterBand), "", 157, "Objects,Bands,PageFooter");
  64. RegisteredObjects.Add(typeof(ColumnHeaderBand), "", 158, "Objects,Bands,ColumnHeader");
  65. RegisteredObjects.Add(typeof(ColumnFooterBand), "", 159, "Objects,Bands,ColumnFooter");
  66. RegisteredObjects.Add(typeof(DataHeaderBand), "", 160, "Objects,Bands,DataHeader");
  67. RegisteredObjects.Add(typeof(DataFooterBand), "", 161, "Objects,Bands,DataFooter");
  68. RegisteredObjects.Add(typeof(DataBand), "", 162, "Objects,Bands,Data");
  69. RegisteredObjects.Add(typeof(GroupHeaderBand), "", 163, "Objects,Bands,GroupHeader");
  70. RegisteredObjects.Add(typeof(GroupFooterBand), "", 164, "Objects,Bands,GroupFooter");
  71. RegisteredObjects.Add(typeof(ChildBand), "", 165, "Objects,Bands,Child");
  72. RegisteredObjects.Add(typeof(OverlayBand), "", 166, "Objects,Bands,Overlay");
  73. // report objects
  74. RegisteredObjects.InternalAdd(typeof(TextObject), "ReportPage", 102, 1);
  75. RegisteredObjects.InternalAdd(typeof(PictureObject), "ReportPage", 103, 2);
  76. RegisteredObjects.AddCategory("ReportPage,Shapes", 106, 4, "Objects,Shapes");
  77. RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 105, "Objects,Shapes,Line", 0, true);
  78. RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 107, "Objects,Shapes,DiagonalLine", 1, true);
  79. RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 150, "Objects,Shapes,DiagonalLine", 2, true);
  80. RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 151, "Objects,Shapes,DiagonalLine", 3, true);
  81. RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 152, "Objects,Shapes,DiagonalLine", 4, true);
  82. RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 108, "Objects,Shapes,Rectangle", 0);
  83. RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 109, "Objects,Shapes,RoundRectangle", 1);
  84. RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 110, "Objects,Shapes,Ellipse", 2);
  85. RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 111, "Objects,Shapes,Triangle", 3);
  86. RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 131, "Objects,Shapes,Diamond", 4);
  87. RegisteredObjects.Add(typeof(PolyLineObject), "ReportPage,Shapes", 240, "Objects,Shapes,Polyline");
  88. RegisteredObjects.Add(typeof(PolygonObject), "ReportPage,Shapes", 241, "Objects,Shapes,Polygon");
  89. RegisteredObjects.Add(typeof(PolygonObject), "ReportPage,Shapes", 242, "Objects,Shapes,Pentagon", 0x50);
  90. RegisteredObjects.Add(typeof(PolygonObject), "ReportPage,Shapes", 243, "Objects,Shapes,Hexagon", 0x60);
  91. RegisteredObjects.Add(typeof(PolygonObject), "ReportPage,Shapes", 244, "Objects,Shapes,Heptagon", 0x70);
  92. RegisteredObjects.Add(typeof(PolygonObject), "ReportPage,Shapes", 245, "Objects,Shapes,Octagon", 0x80);
  93. RegisteredObjects.InternalAdd(typeof(SubreportObject), "ReportPage", 104, 5);
  94. RegisteredObjects.InternalAdd(typeof(ContainerObject), "ReportPage", 144, 5);
  95. RegisteredObjects.InternalAdd(typeof(TableObject), "ReportPage", 127, 6);
  96. RegisteredObjects.InternalAdd(typeof(TableColumn), "", 215);
  97. RegisteredObjects.InternalAdd(typeof(TableRow), "", 216);
  98. RegisteredObjects.InternalAdd(typeof(TableCell), "", 214);
  99. #if !COMMUNITY
  100. RegisteredObjects.AddCategory("ReportPage,Matrix", 142, 7, "Objects,Matrix");
  101. RegisteredObjects.InternalAdd(typeof(MatrixObject), "ReportPage,Matrix", 142, 1);
  102. #if !(WPF || AVALONIA)
  103. RegisteredObjects.InternalAdd(typeof(CrossViewObject), "ReportPage,Matrix", 247, 2);
  104. #endif
  105. #else
  106. RegisteredObjects.InternalAdd(typeof(MatrixObject), "ReportPage", 142, 7);
  107. #endif
  108. RegisteredObjects.AddCategory("ReportPage,Barcodes", 123, 9, "Objects,BarcodeObject");
  109. RegisteredObjects.AddCategory("ReportPage,Barcodes,2D", 149, 9, "Objects,BarcodeObject,TwoD");
  110. RegisteredObjects.AddCategory("ReportPage,Barcodes,EANUPC", 123, 9, "Objects,BarcodeObject,EANUPC");
  111. RegisteredObjects.AddCategory("ReportPage,Barcodes,Post", 123, 9, "Objects,BarcodeObject,Post");
  112. RegisteredObjects.AddCategory("ReportPage,Barcodes,GS1", 123, 9, "Objects,BarcodeObject,GS1");
  113. RegisteredObjects.AddCategory("ReportPage,Barcodes,Others", 123, 9, "Objects,BarcodeObject,Others");
  114. for (int i = 0; i <= Barcodes.Items.Length - 1; i++)
  115. {
  116. var barcode = Barcodes.Items[i];
  117. RegisteredObjects.Add(typeof(BarcodeObject), "ReportPage,Barcodes," + barcode.category, barcode.category == "2D" ? 149 : 123, barcode.barcodeName, i);
  118. }
  119. RegisteredObjects.InternalAdd(typeof(CheckBoxObject), "ReportPage", 124, 10);
  120. RegisteredObjects.InternalAdd(typeof(ZipCodeObject), "ReportPage", 129, 14);
  121. RegisteredObjects.InternalAdd(typeof(CellularTextObject), "ReportPage", 121, 15);
  122. RegisteredObjects.AddCategory("ReportPage,Gauge", 140, 17, "Objects,Gauge");
  123. RegisteredObjects.Add(typeof(LinearGauge), "ReportPage,Gauge", 140, "Objects,Gauge,Linear", 0, false);
  124. RegisteredObjects.Add(typeof(SimpleGauge), "ReportPage,Gauge", 140, "Objects,Gauge,Simple", 0, false);
  125. RegisteredObjects.Add(typeof(RadialGauge), "ReportPage,Gauge", 140, "Objects,Gauge,Radial", 0, false);
  126. RegisteredObjects.Add(typeof(SimpleProgressGauge), "ReportPage,Gauge", 140, "Objects,Gauge,SimpleProgress", 0, false);
  127. RegisteredObjects.InternalAdd(typeof(HtmlObject), "ReportPage", 246, 18);
  128. RegisteredObjects.InternalAdd(typeof(RFIDLabel), "ReportPage", 265, 19);
  129. // exports
  130. RegisteredObjects.InternalAddExport(typeof(ImageExport), "Image", "Export,Image,File");
  131. // functions
  132. StdFunctions.Register();
  133. }
  134. }
  135. }