home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_2 / XUDL / XTALUDL.ME < prev   
Encoding:
Text File  |  1993-08-14  |  4.4 KB  |  120 lines

  1. XTALUDL (c) 1993, Robert J. Johnston. All Rights Reserved
  2.  
  3. You have the right to distribute royalty-fee free XTALUDL.EXE 
  4. with you own apps. Use at your own risk.
  5.  
  6. XTALUDL allows you to set user-defined label dimensions at
  7. runtime for label reports created with Crystal Reports.
  8.  
  9. XTALUDL writes directly to your original reports. Make
  10. sure you have backup copies of the your reports in case
  11. XTALUDL does something unforeseen.
  12.  
  13. XTALUDL is a Visual Basic 3.0 app that you run from your
  14. app--sort of a psuedo DLL. XTALUDL is hidden off screen so
  15. you or your users won't see it. You create you own dialog for
  16. getting the dimensions of the labels. Then you send the 
  17. information to XTALUDL using "SENDKEYS."  You determine when
  18. the report is updated by checking a control that is DDE linked
  19. to a control in XTALUDL. It is possible to set up DDE links
  20. to the XTALUDL controls and pass dimensions using DDE 
  21. instead of using the "SENDKEYS" method; however, this
  22. requires more coding.
  23.  
  24. ( I didn't feel like pulling out the C++ CD-ROM or spending the
  25. extra time needed to create a DLL. Hopefully Crystal Services
  26. will do that.)
  27.  
  28. There is a demo program called UDLDEMO.MAK that you can
  29. load into the VB Environment. The only executable code 
  30. in the demo is in the Command1_Click event. This code
  31. shows what is required. I assume that XTALUDL.EXE is
  32. going to be in the same directory as your own app.
  33.  
  34. The one control on the demo form named frmXTALUDL_Status can
  35. be named something else, but you will have to change the
  36. code as well. This links to another control on the XTALUDL
  37. form. It provides status and error information.
  38.  
  39. You can copy the demo code to your own app. The report name
  40. and dimensions have been hard-coded into the demo. You
  41. will have to add code to build the strings of information.
  42.  
  43.  
  44. Command Letters:
  45.    I    Initialize 
  46.    P    Full Path name of report to modify.
  47.    L    Left Margin
  48.    R    Right Margin
  49.    T    Top Margin
  50.    B    Bottom Margin
  51.    W    Label Width
  52.    H    Label Height
  53.    Z    Horizontal Gap
  54.    V    Vertical Gap
  55.    D    Direction
  56.    X    Execute (Updates report)
  57.    U    Unload XTALEXE
  58.  
  59. For example:
  60.    SendKeys "I~"                    Initialize.
  61.    SendKeys "R.25~"                .25" Right Margin 
  62.    SendKeys "W1~"                   1" Width
  63.    SendKeys "H.5~"                  .5" Height
  64.    SendKeys "H .5 ~"                .5" Height. Leading and trailing
  65.                      spaces trimmed by XTALUDL.
  66.    SendKeys "DA~"                   Direction is across
  67.    SendKeys "DD~"                   Direction is down
  68.    SendKeys "Pc:\reports\xyz.rpt~"  C:\REPORTS\XYZ.RPT
  69.    SendKeys "X~"                    Updates report      
  70.    SendKeys "U"                     Unload XTALUDL. NOTE: no tilde.
  71.  
  72. Your first command must be (I)nitialize. Your next
  73. to last command must be e(X)ecute. Your last command
  74. must be (U)nload.  Other commands inbetween can be in
  75. any order. You don't have to send dimensions that you
  76. don't want to change. 
  77.  
  78. ------------------------------------------------------------
  79. All commands must end with a tilde ~, EXCEPT (U)nload!!!! 
  80. ------------------------------------------------------------
  81.  
  82. Keep each sendkey command on a separate line.
  83.  
  84. After sending the initialize command you must wait until
  85. initialization is complete. You do this by checking a
  86. DDE link (see demo code).
  87.  
  88. After sending the execute command you must wait until
  89. XTALUDL has finished updating your report. You do this
  90. by checking a DDE link (see demo code).  If a DOS error
  91. is generated in XTALUDL, then txtXTALUDL_Status.Text 
  92. will contain a string representation of the DOS error
  93. code, STR$(ERR). Success is represented by STR$(0). If the
  94. report was not designed for labels, then error codes "32000" or
  95. "32001" will be returned.  "32000" will be returned if XTALUDL 
  96. couldn't find margin information. "32001" will be returned if
  97. XTALUDL couldn't find label dimension information.
  98.    
  99. Normally the txtXTALUDL_Status visible property will be set to FALSE.
  100. It is visible in the demo so you can see the error codes.
  101. To generate an error, try sending an non-existent path or file name.
  102.  
  103. Dimensions are not checked in XTALUDL. You will have to verify
  104. dimensions yourself. Dimensions received by XTALUDL are in inches.
  105. If your users enter dimensions using some other system, such as
  106. metric, you will have to convert to inches.
  107.  
  108.  
  109. Robert J. Johnston
  110. 2017 Murchison Drive, #15
  111. Burlingame, CA 94010
  112.  
  113. Compuserve: 71611,1370
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.