Advertisement
Guest User

XMLPort Creator Report

a guest
Apr 7th, 2015
1,122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.46 KB | None | 0 0
  1. OBJECT Report 50666 XMLPort creator
  2. {
  3. OBJECT-PROPERTIES
  4. {
  5. Date=07/04/15;
  6. Time=12:57:06;
  7. Modified=Yes;
  8. Version List=EVO;
  9. }
  10. PROPERTIES
  11. {
  12. ProcessingOnly=Yes;
  13. OnPreReport=BEGIN
  14. TempBlob.INIT;
  15. TempBlob.Blob.CREATEOUTSTREAM(OutStr);
  16. CR := 13;
  17. LF := 10;
  18. END;
  19.  
  20. OnPostReport=BEGIN
  21. FileManagement.BLOBExport(TempBlob,'XMLP50000.txt',TRUE);
  22. END;
  23.  
  24. }
  25. DATASET
  26. {
  27. { 1000000000;;DataItem; ;
  28. DataItemTable=Table2000000001;
  29. DataItemTableView=WHERE(Type=CONST(Table));
  30. OnPreDataItem=BEGIN
  31. WriteString('OBJECT XMLport 50000 New XMLport');
  32. WriteString('{');
  33. WriteString(' OBJECT-PROPERTIES');
  34. WriteString(' {');
  35. WriteString(STRSUBSTNO(' Date=%1;',FORMAT(TODAY,0,'<Day,2>.<Month,2>.<Year>')));
  36. WriteString(STRSUBSTNO(' Time=%1;',FORMAT(SYSTEM.TIME,0,'<Hours24,2>:<Minutes,2>:<Seconds,2>')));
  37. WriteString(' Modified=No;');
  38. WriteString(' Version List=;');
  39. WriteString(' }');
  40. WriteString(' PROPERTIES');
  41. WriteString(' {');
  42. WriteString(' Format=Variable Text;');
  43. WriteString(' FieldDelimiter=<None>;');
  44. WriteString(' FieldSeparator=|;');
  45. WriteString(' {');
  46. WriteString('');
  47. WriteString(' }');
  48. WriteString(' ELEMENTS');
  49. WriteString(' {');
  50.  
  51. GUIDString := CREATEGUID;
  52.  
  53. WriteString(STRSUBSTNO(' { [%1]; ;Root ;Element ;Text }',GUIDString));
  54. WriteString('');
  55. END;
  56.  
  57. OnAfterGetRecord=BEGIN
  58. GUIDString := CREATEGUID;
  59. ObjName := Object.Name;
  60. ObjName := DELCHR(ObjName,'=',' ');
  61. ObjName := DELCHR(ObjName,'=','.');
  62. ObjName := DELCHR(ObjName,'=','<');
  63. ObjName := DELCHR(ObjName,'=','>');
  64. ObjName := DELCHR(ObjName,'=','&');
  65. ObjName := DELCHR(ObjName,'=','/');
  66. ObjName := DELCHR(ObjName,'=','%');
  67. ObjName := DELCHR(ObjName,'=','(');
  68. ObjName := DELCHR(ObjName,'=',')');
  69. IF STRLEN(ObjName) < 20 THEN ObjName := ObjName + PADSTR('',20 - STRLEN(ObjName),' ');
  70. WriteString(STRSUBSTNO(' { [%1];1 ;%2;Element ;Table ;',GUIDString,ObjName));
  71. WriteString(STRSUBSTNO(' SourceTable=Table%1;',Object.ID));
  72. WriteString(STRSUBSTNO(' MinOccurs=Zero }',Object.ID));
  73. WriteString('');
  74. END;
  75.  
  76. OnPostDataItem=BEGIN
  77. WriteString(' }');
  78. WriteString(' EVENTS');
  79. WriteString(' {');
  80. WriteString(' }');
  81. WriteString(' REQUESTPAGE');
  82. WriteString(' {');
  83. WriteString(' PROPERTIES');
  84. WriteString(' {');
  85. WriteString(' }');
  86. WriteString(' CONTROLS');
  87. WriteString(' {');
  88. WriteString(' }');
  89. WriteString(' }');
  90. WriteString(' CODE');
  91. WriteString(' {');
  92. WriteString(' }');
  93. WriteString('}');
  94. END;
  95.  
  96. ReqFilterFields=ID }
  97.  
  98. { 1000000001;1;DataItem; ;
  99. DataItemTable=Table2000000041;
  100. DataItemTableView=SORTING(TableNo,No.)
  101. WHERE(Class=CONST(Normal),
  102. Enabled=CONST(Yes));
  103. OnAfterGetRecord=BEGIN
  104. CASE TRUE OF
  105. Field.Class = Field.Class::FlowField:
  106. CurrReport.SKIP;
  107. Field.Class = Field.Class::FlowFilter:
  108. CurrReport.SKIP;
  109. Field.Enabled = FALSE:
  110. CurrReport.SKIP;
  111. Field.Type = Field.Type::TableFilter:
  112. CurrReport.SKIP;
  113. Field.Type = Field.Type::RecordID:
  114. CurrReport.SKIP;
  115. Field.Type = Field.Type::Binary:
  116. CurrReport.SKIP;
  117. Field.Type = Field.Type::BLOB:
  118. CurrReport.SKIP;
  119. END;
  120.  
  121. GUIDString := CREATEGUID;
  122. ObjName := Field.FieldName;
  123. ObjName := DELCHR(ObjName,'=',' ');
  124. ObjName := DELCHR(ObjName,'=','.');
  125. ObjName := DELCHR(ObjName,'=','<');
  126. ObjName := DELCHR(ObjName,'=','>');
  127. ObjName := DELCHR(ObjName,'=','&');
  128. ObjName := DELCHR(ObjName,'=','/');
  129. ObjName := DELCHR(ObjName,'=','%');
  130. ObjName := DELCHR(ObjName,'=','(');
  131. ObjName := DELCHR(ObjName,'=',')');
  132. IF STRLEN(ObjName) < 20 THEN ObjName := ObjName + PADSTR('',20 - STRLEN(ObjName),' ');
  133. IF COPYSTR(ObjName,1,1) IN ['1','2','3','4','5','6','7','8','9','0'] THEN ObjName := '_' + ObjName;
  134. WriteString(STRSUBSTNO(' { [%1];2 ;%2;Element ;Field ;',GUIDString,ObjName));
  135. WriteString(STRSUBSTNO(' DataType=%1;',Field.Type));
  136. WriteString(STRSUBSTNO(' FieldValidate=No;',Field.Type));
  137. WriteString(STRSUBSTNO(' SourceField=%1::%2;',Object.Name,Field.FieldName));
  138. WriteString(STRSUBSTNO(' MinOccurs=Zero;',Field.Type));
  139. WriteString(STRSUBSTNO(' MaxOccurs=Once }',Field.Type));
  140. WriteString('');
  141. END;
  142.  
  143. DataItemLink=TableNo=FIELD(ID) }
  144.  
  145. }
  146. REQUESTPAGE
  147. {
  148. PROPERTIES
  149. {
  150. }
  151. CONTROLS
  152. {
  153. }
  154. }
  155. LABELS
  156. {
  157. }
  158. CODE
  159. {
  160. VAR
  161. TempBlob@1000000010 : TEMPORARY Record 99008535;
  162. OutStr@1000000005 : OutStream;
  163. GUIDString@1000000003 : Text[50];
  164. ObjName@1000000002 : Text[30];
  165. CR@1000000001 : Char;
  166. LF@1000000000 : Char;
  167. FileManagement@1000000006 : Codeunit 419;
  168.  
  169. PROCEDURE WriteString@1200050001(String@1200050000 : Text[250]);
  170. BEGIN
  171. OutStr.WRITETEXT(STRSUBSTNO('%1%2%3',String,CR,LF));
  172. END;
  173.  
  174. BEGIN
  175. END.
  176. }
  177. RDLDATA
  178. {
  179. }
  180. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement