Home
SuperReport Pro User Manual - e-Node
Contents
1. ReportArea The desired SuperReport Pro area Variable Array Name The name this is a string parameter not the actual array of the array which contains the list of variables using the following format lt menu number gt lt menu item name gt lt vatiable name gt lt variable type gt lt array element gt menu number the desired menu item which you wish to add the variable menu item number the name of the menu or item variable name the name of the corresponding 4 Dimension variable variable type the type of variable 1 standard 4 Dimension variable 2 automatic array uses SRRecord as index item 3 specified array element array element if you have specified a variable type of 3 this item will contain the specific array element gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 96 of 226 Examples The following example will produce a hierarchical menu with 2 sub menus one for the standard SuperReport Pro variables and the second for application specific variables C_BLOB pReportData Case of Form event On Load ARRAY STRING 64 aSR_Variables 5 aSR_Variables 1 1 Standard Variables name menu 1 Standard Variables aSR_Variables
2. Rows Number of rows in a rectangle grid This parameter is only used when the ObjType is SR Object Type Rectangle Cols Number of columns in a rectangle grid This parameter is only used when the ObjType is SR Object Type Rectangle Repeat Horizontal Offset Desired horizontal offset for repeating object This parameter is only used when the Options is SR Obj Flag Repeat Horizontally Repeat Vertical Offset Desired vertical offset for repeating object This parameter is only used when the Options is SR Obj Flag Repeat Vertically gt Result Code If the routine completed successfully a valid ItemID greater than zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 176 of 226 Example The following example will create a new report see SR New Offscreen Area then create two new fields and finally save the report to disk as test srp C_LONGINT SR_AREA C_LONGINT SR_Err SR_ItemID SR_Err 0 SR_ItemID 0 SR_AREA SR New Offscreen Area If SR_AREA gt 0 add field SR_ObjName SR_ObjType SR Object Type Field SR_Opts 0 SR_Selected 0 SR_VarType 0 SR_ArrayElement 0 SR_CalcType 0 SR_CalcName SR_Rows 0 SR_Cols 0 SR_HRepeat 0 SR_VRepeat 0 offset 5 top 40 left 40 bottom top 12 rig
3. eeeeeceecccccccecesesenseaececececceceenssececeeceesesensnseaueeeeeceeecs 12 E SA AE ANE E AEE A ae tea 13 license types aina a E dh ates ates ed ta hed acta cesteaees Saute 13 Installation Plug In Objects OvervieW sssseesssseessssseosssseessssecesssseesssseoesssseessene 14 SuperReport Pro PIlUJ IN sessssssrereeessessesseveresssesrsreserecesesesrrseresessssee 14 Installation Plug In bundle MacOS amp WINAOWS sssesseeeeesseseesseee 14 Page 3 of 226 Chapter 3 Chapter 4 Chapter 5 SuperReport Pro Configuring SuperReport Pro Declaring SuperReport Pro Variables 0 0 ceecceesseccecessseeecesseteeeeeeesees 15 SuperReport Pro Variables oo ce ceeesesscecececeeceessnseceeeeeeeeesenenes 15 SuperReport Pro Fundamentals Creating SuperReport Pro ALOOS ce eceessccecsessececeseseeeceesseceeeseaseeeeees 17 Using OS External Wina aiaia ia ENE 17 Using ON 4th DIMENSION FO useeirrritra nerit rit n rE TEE 18 Customizing the SuperReport Pro AreQ sssssesssssessssssessssseessssseosssseesse 19 CUSTOMIZING File STTUCTUIE sense eai iia aA EEA S 19 Customizing User Access VaridblesS s ssesessseseessereesserrresserees 22 Customizing Standard SuperReport Pro Variables ccscee 23 Customizing SuperReport Pro Menu System eeesesseseesseeseessereese 23 CUSTOMIZING REPOrt Edito eseru ia a a adaa 24 Extending SuperReport Pro with Object Scripts sssessssseessssseessesees 25 SuperReport Pro Script LIMITATIONS
4. Action Desired configuration action If you pass a value of zero 0 as the action you must pass a valid 4 Dimension variable to Iterations parameter so that the current value can be returned You may choose one of the following values 1 SR MainTable Show Dialog 0 SR MainTable Query 1 SR MainTable Choose Table 2 SR MainTable Fixed Iteration 4 SR MainTable Variable 8 SR MainTable Array 1 Show Main File Iterations Dialog This should only be called when SuperReport Pro Editor is displayed 0 Query current setting for report 1 Set the iterations based on the table number specified in the iterations parameter 2 Set the iterations based on the literal value of the iterations parameter 4 Set the iterations based value stored in the variable specified in the varName parameter 8 Set the iterations based on the size of the array specified in the varName parameter Iterations Depending on the value passed in the Action parameter the Iterations parameter will may be either a literal value when using an Action value of 1 or 2 or a valid 4 Dimension variable which will receive the current iteration value when using an Action value of 0 VarName The name of the variable which contains the iteration value when passing a value of 4 or 8 as the Action value gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid Supe
5. Use Size Of Array Name Ce oF Figure 40 Report Iterations based on array size SuperReport Pro Page 68 of 226 Step 4 The last step is to create the arrays Select Start Script from the Scripts submenu located in the Database menu Enter the following code and save the script ALL RECORDS Customer SELECTION TO ARRAY Customer Code aCCode Customer Name aCName Customer Telenhone aCTel SORT ARRAY aCCodejaCName aCTel gt Step 5 Again we ll save our report the re open the record Step 6 Select Print Preview or Print Report from the File menu to see our work Page 1 Processed 7 of 7 Items Customer List aie Code Name Telephone Fax 4D 4D Inc 800 981 3466 408 557 4660 ASG Automated Solutions Group 714 375 4252 714 848 0382 FRED Frederick amp Sons 212 432 1098 212 432 8901 MACG MacGenerstion 404 981 8721 404 981 8755 RWM Me Cormick and Associates 714 960 1234 714 960 4321 SLIB System Liberation 817 544 3209 817 544 3210 SMITH dames Smith amp Co 212 555 1212 212 555 1213 Figure 41 Print Preview of Array data SuperReport Pro Page 69 of 226 Procedurally Creating Reports One of the newest additions to SuperReport Pro is the ability to procedurally create and manage report documents Using these routines you now have complete control over the report documents which are created and can even create customized user interface objects for managing report documents giving you all the
6. C g Points Figure 23 SuperReport Pro Object Properties Options tab Step 4 Select the Repeat This Object check box and click the Use Vertical Repeat Offset checkbox assigning a value of 2 points This value will be the number of pixels between each repeated object Step 5 The next step is optional depending on type of table relationship you have setup for the parent and many files SuperReport Pro Page 49 of 226 e Ifyou file structure is configured to use Automatic Relations you don t need to perform any further tasks If you file structure is configured to use Manual Relations you will need to add the following code in the Body section markers scripts so that SuperReport Pro can get the related records at print time RELATE MANY Customer Step 6 Save your report then return to our new report SuperReport Pro Page 50 of 226 Step 7 Now select the Print Report or Print Preview menu item from the File menu to see your new form report As you can see each record is printed on a separate page 1 Processed 1 of 1 Items 1s 1 Sv TS Te Customer Details With Invoice History Code 4D Name 4D Inc Address 3031 Tisch Way Suite 900 San Jose CA 95128 Telephone 800 881 3466 Fax 408 557 4660 Invoice History device Me Pate Fate Payment Fess 000015 Sat Jan 24 1998 2 000 16 Within 30 Days 000020 Fri Dec 1 1995 0 00 Within 30 Days 000022 Wed Apr 1 1998 321 84 Within 30 Days 000025 F
7. Cols Number of columns in a rectangle grid This parameter is only used when the ObjType is SR Object Type Rectangle Repeat Horizontal Offset Desired horizontal offset for repeating object This parameter is only used when the Options is SR Obj Flag Repeat Horizontally Repeat Vertical Offset Desired vertical offset for repeating object This parameter is only used when the Options is SR Obj Flag Repeat Vertically gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will change the font color for the referenced object depending on it s current value In this case we are going to change the foreground color to blue if the Customer Active code is true SR_Err SR Set Object Format SRArea SRObjectiD SR Attribute 4D Fore Color 0 0 0 0 0 0 0 0 0 0 0 0 Num Customer Active Oxff 0 See Also SR Set Object Scripts SR Set Object Data SR Set Object Format SR Set Object Properties SuperReport Pro Page 193 of 226 SR Get Object Data SR Get Object Data reportArea L objectID L staticPICT P staticText T gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Object ID C_LONGINT Report section ID StaticPICT C_PICTURE Object Static PICT St
8. ORDER BY Customer Customer Code gt ON ERR CALLC BEER Select Tabk or Fed Select Custom Variabk Select Custom Command D gt Customer gt General gt 4D Environment b B hwice b E section 2 gt Arrays D gt E item b Section 3 gt BLOB gt Boolean D Clipboard D Communications Load VO Save 3 f Cancel a OK gt Figure 5 SuperReport Pro Script Editor SuperReport Pro Page 25 of 226 SuperReport Pro Script Limitations While SuperReport Pro provides the ability to easily create custom scripts there are a few limitations that you should be aware of when creating your scripts 1 SuperReport Pro scripts cannot have standard 4 Dimension conditional commands such as For End for Case End case While End while If you need to perform conditional checks while printing a SuperReport Pro report you must call a custom 4 Dimension method that in turn calls the conditional code 2 SuperReport Pro scripts are not executed in compiled form regardless of your applications compiled status While this typically won t be a noticeable issue you should be aware that scripts are slower than compiled code 3 All scripts are executed in the same fashion as call the 4 Dimension EXECUTE command 4 When selecting a table or field which has been customized using SuperReport Pro s structure customization feature the script editor will display the actual table field inform
9. SR Get Number Of Pages SR Get Number Of Pages reportArea L printOpts L sectionFlag L gt resultCode L Parameter Data Type Description ReportArea C_BLOB Report PrintOption C_LONGINT Print Options SectionFlag C_LONGINT Print Section Flags gt NumPages C_LONGINT Number of pages SR Get Number Of Pages will return the number of pages for the desired report using the supply print options and section information Report Object A valid SuperReport Pro report BLOB format This is not the actual SuperReport Pro area but rather the report object as it would be stored in a 4 Dimension BLOB field or variable Print Options Print options flags You can pass the sum of the values you wish to execute using the following table 0 Default options don t do anything special 1 SR PrintToPict Validate Validate Page Setup 2 SR PrintToPict Job Dialog Show Job Setup 4 SR PrintToPict No Progress Don t display progress bar If the Page Setup is not correct for your chosen printer and you specify to check the Page Setup using the option parameter then the Page Setup dialog will be displayed If the user cancels either the Page Setup or Job Setup dialogs then the report will not be printed Section Flag The sections parameter is used to control which sections of the report ate printed assuming that you have not specified the Body section only using the options parameter To print specific sections pass
10. ssssssesssessssessesesersssseseeserrrsesssse 26 Understanding the SuperReport Pro Event Cycle eesssesssssseersesees 27 Dealing with multi platform ISSUES sseessssesesssseessssecesssseosssseessssseessssees 28 Dealing with platform pathnames sssesssssseesssseeesssseesssseossssseossesees 28 Dealing with Print OIVETS iaren EARE AAA AR 29 AIME SUDDO ea a Aa Gs Ledeen AS 30 Using CUSTOM Tag Vonalas eein en E A TEN 31 Understanding the SuperReport Pro Execution Cycle 3 Printing HIML RE DOMS orn ran eine EA tenet nate cae 32 Tutorial Besi INTEGATION s eecchos ara A A S 34 Using External WiINAOW sesssssseesssseessssecosssseessesecosssseosseseossssseossesees 34 USING PUGIN AGO oea E iA EAA A 35 SuperReport Pro Editor INTOCUCTION oo ce eccccesscecceeececeesersaseceeeeeees 38 Toolbar QV SMVICW ariun n aE ARa RAA a AREN 38 SECTION Morker Ovari W santnera aa ERNE AA R 40 Merny OVEIVIEW anane iaei aE E EE EATEN 4 Creating A basic listing Tepo leeri a iai 46 Creating A bose Tomni FEPOMT ena ea a AA ERN 48 Using Repeating ODJOCTHS ccccsesscccsssstsecesssnseccssssssecssssessecsenenes 49 Creating a break processing report sessssseessssseesssseessssseesseseesss 50 Creating AN HTML REPOST suier a aa s 59 PUING ANOV ia E A ETA 67 Procedurally Creating Reports ssessssssessssseossssseesssseessssecesssseosssse 70 Page 4 of 226 Chapter 6 SuperReport Pro Command Reference ROUTING OVEMVIOW merecieron reaa essan i erai
11. 2 1 Date SRDate 1 add a variable to menu 1 aSR_Variables 3 1 Time SRTime 1 add a variable to menu 1 aSR_Variables 4 1 Page Number SRPage 1 add a variable to menu 1 aSR_Variables 5 1 Record SRRecord 1 add a variable to menu 1 aSR_Variables 6 2 System Variables name menu 2 Standard Variables aSR_Variables 7 2 Username lt gt vUser 1 add a variable to menu 2 aSR_Variables 8 2 Month Names lt gt aMonths 2 add an array item automatic aSR_Variables 7 2 Monday aWkDays 3 2 add a specified array element result SR Variables eReportData aSR_Variables 3 4 5 6 7 8 7 iSR_Err SR New Report pReportData iSR_Err SR Set Area eReportArea pReportData End case See Also SR Commands SR Structure SuperReport Pro Page 97 of 226 SR Commands SR Commands reportArea L commandArrayName S options L excludeThemesArrayName S excludeCommandsName s gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area commandArrayName C_STRING 255 Name of array containing commands gt ResultCode C_LONGINT Result Code SR Commands allows you customize the list of available commands in the Script dialog for the defined SuperReport Pro area Using this command you can provide users access to specific commands and application routines without exposing the entire 4 Dimension Command list If you don t supply a command array name y
12. 256 SR Obj Flag Variable Width 512 SR Obj Flag Variable Height 1024 SR Obj Flag Replace If Empty 2048 SR Obj Flag Use Calc Value 4096 SR Obj Flag Show Calc Value 8192 SR Obj Flag Repeating Object 16384 SR Obj Flag Repeat Vertically 32768 SR Obj Flag Repeat Horizontally 65536 SR Obj Flag Replace Row If Empty Order Object order position in object list This value is ignored when using SR Set Object Properties If you wish to reorder an object use SR Change Object Order or SR Reorder Objects Selected Determines if the object is current selected within the report area 0 Object is not selected 1 Object is selected TableNo Object table number This parameter is only used when the ObjType is SR Object Type Field FieldNo Object field number This parameter is only used when the ObjType is SR Object Type Field VarType Object variable type This parameter is only used when the ObjType is SR Object Type Variable You may choose one of the following variable types 1 SR Variable Type Variable 2 SR Variable Type Array Auto 3 SR Variable Type Array Element ArrayElem Desired array element when the ObjType is SR Object Type Variable and the VarType is SR Variable Type Array Element SuperReport Pro Page 186 of 226 CalcType Desired calculation option This parameter is only used when the ObjType i
13. Step 1 Replace all field reference objects with new variable objects Click on the variable tool in the SuperReport Pro Editor Toolbar and draw a box in the same location as the original Customer Code field and assign a variable name of aCCode for Customer Code and select the Variable Type to be Array Automatic SkPro Variable Object Properties B E General Display Filter Variable Type Array Automatic Variable Name Array Element C g mDisplay Format Display Filter Example No Example Available Figure 38 Array Variable Object SuperReport Pro Page 67 of 226 Step 2 Repeat Step 1 for each of the following variable names aCName Customer Name aCTel Customer Phone When you have completed Step 2 you report should look simple like this Customer List faCNamefy Header Body Footer Figure 39 Sample Array Report Step 3 The next step is to define the report iterations based on the size of the array we are printing Since all the arrays will be equal size we can select any of the array s we wish to define the report iterations Select Report Table Iterations from the Database menu When the dialog is displayed select the Use Size Of Array radio button and use the aCCode array SRPro Main Table Iterations E Invoice E item QO Fixed Number Of Iterations Value C d QO Use Value In Yariable Name
14. This is the button script for our button which has the Command key sequence If SR_Event 20 switch from Preview back to editor mode CANCEL close the input layout End if WARNING It is very important that you do not try to issue the CLOSE WINDOW command when you receive a value of 35 as the event parameter in your callback method If you do you will CRASH To get around this problem you will need to send a message to another process to close the window for you ot to use the new postKey capability to generate an ACCEPT or CANCEL action The reason for not executing CLOSE WINDOW is that SuperReport Pro calls your callback procedure reverting execution control to 4D you kill the window when 4D returns to the calling procedure SuperReport Pro it doesn t exist anymore hence the crash By using processes and passing messages between them and delaying the killing of the window you are able to resolve this problem SuperReport Pro Page 135 of 226 SR Power Menu SR Power Menu reportArea L menuID L whereH L whereV L selectedValue L selectedItem S alias S gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area MenuID C_LONGINT Type of menu to display Receives selected menultemRef WhereH C_LONGINT Horizontal Coordinate WhereV C_LONGINT Vertical Coordinate SelectedValue C_LONGINT Selected Item Value SelectedItem C_STRING or C_TEXT Selected menu item text SelectedItemA
15. iSR_Err SR New Report pReportData iSR_Err SR Set Area eReportArea pReportData iSR_Err SR Options eReportArea 1 1 1 4 1 hide zoom 4 disable HTML End case SuperReport Pro Page 24 of 226 Extending SuperReport Pro with Object Scripts Like standard 4 Dimension reports created using the Form Editor SuperReport Pro objects may contain scripts which may call any 4 Dimension command method or 3 4 Party plug in routine Using SuperReport Pro scripts you can further customize your reports to produce output which cannot be created using standard SuperReport Pro objects For example let s say you wanted to create a report which a listing of sales broken down by customer and provide an average sale for each custom as well as an overall invoice average While SuperReport Pro can handle most of these tasks for you utilizing the advanced break processing capabilities built in to SuperReport Pro the extended averaging requirements would not be possible without the support of object scripts Using SuperReport Pro s object scripts you can place custom code on just about any SuperReport Pro object including section lines providing a very complete and flexible reporting system The following is the standard SuperReport Pro Script Editor Using the editor you can enter any valid 4 Dimension command method or plug in routine SRPro Script Editor Report Start Script MESSAGES OFF ALL RECORDS Customer
16. this behavior and you can do this in the Start script of the report itself and restore the setting in the End script of the report Note that this command is GLOBAL and will effect SuperReport Pro throughout your database The SR RELATIONS command can be used in the Start and End scripts of your reports so that the effect of using the command is local to specific reports only If you execute the statement SR RELATIONS 0 0 then you can still place an explicit RELATE ONE or RELATE MANY command in your report scripts to load specific record selection from other files Example Start script switches off all relations to process data as fast as possible before the report starts to print C_LONGINT iSR_RelateOne iSR_RelateMany iSR_RelateOne 1 iSR_RelateMany 1 SR RELATIONS iSR_RelateOne iSR_RelateMany get current settings SR RELATIONS 0 0 And the End script restores the previous settings after the report is generated SR RELATIONS iSR_RelateOne iSR_RelateMany restore previous settings SuperReport Pro Page 139 of 226 SR Set Modify SR Set Modify reportArea L status L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Status C_LONGINT Modified status gt ResultCode C_LONGINT Result Code SR Set Modify is used to either set or clear the report changed status for the report in the SuperReport Pro area area ReportArea The desired SuperReport Pro area Status
17. 0 SR_Err SR Get Object IDs SR_AREA SR Selected Objects aiSR_ObjectList See Also SR Count Objects SR Get Object Properties SR Set Object Properties SR Change Object Order SR Reorder Objects SuperReport Pro Page 171 of 226 SR Change Object Order SR Change Object Order reportArea L itemID L position L gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Item ID C_LONGINT Report Object ID Position C_LONGINT Object Position gt ResultCode C_LONGINT Result Code SR Change Object Order provides the ability to procedurally change the print order of a given report object You can place an object at the beginning or end of the object list or move an object forward or backwards Note When reordering an object it does not physically move the object on the report unless you move forward backward it only moves it within the internal list of objects This routine is useful when you wish to customize the order in which objects are printed to disk or HTML files ReportArea The desired SuperReport Pro area Object Item ID A valid report object ID Object Position Desired position where you would like to place the object You may use one of the following SuperReport Pro Constants 1 SR Position At Front 2 SR Position At End 3 SR Position Forward 4 SR Position Backward When choosing SR Position Forward or SR Position Backward the object will be moved fo
18. Also SR Get Options SuperReport Pro Page 91 of 226 Example The following example will disable access to scripts C_BLOB pReportData Case of Form event On Load iSR_Err SR New Report pReportData iSR_Err SR Set Area eReportArea pReportData iSR_Err SR Set Options eReportArea 1 1 1 End case The following example will disable the zoom window and disable access to HTML buttons C_BLOB pReportData Case of Form event On Load iSR_Err SR New Report pReportData iSR_Err SR Set Area eReportArea pReportData iSR_Err SR Set Options eReportArea 1 1 _SR Options Hide Zoom _SR Options Hide HTML End case SuperReport Pro Page 92 of 226 SR Std Vars SR Std Vars whichVar L varName S gt resultCode L Parameter Data Type Description Which Var C_LONGINT Which SR Pro variable Variable Name C_STRING 32 Replacement variable name gt ResultCode C_LONGINT Result Code SR Std Vars allows you to replace the standard SuperReport Pro reporting variables GRDate SRTime etc with ones of you own choosing When defining a replacement variable make sure the data types are the same as the original SR Pro variable and that your replacement variable has been properly declared and initialized Which Variable Which of the 4 SR Pro variables you wish to override 1 SRDate C_DATE 2 SRTime C_LONGINT 3 SRPage C_LLONGINT 4 SRRecord C_LONGINT Variable Name A valid 4 Dimension variable
19. C_LONGINT Report Area Options C_LONGINT Options Result Data C_BLOB Command List BLOB gt ResultCode C_LONGINT Format Number SR Get Structure As List BLOB builds a 4 Dimension hierarchical list BLOB using the database structure The hierarchical list will include all tables and their corresponding fields as configured by SR Structure Item Reference for each item is as follows e for tables root entries itemRef is the table number e for fields leaf sublist entries itemRef is 1000000 tableNumber 1000 fieldNumber This routine is used internally by the SuperReport Pro dialogs and may be used when creating customized report interface For more information on creating customized report interface please refer to Chapter 6 Command Reference Object Properties ReportArea The desired SuperReport Pro area Options Options for building table lists You may choose one of the following values 0 SR Structure Physical Use physical structure area is ignored 1 SR Structure Virtual Use virtual structure area is ignored 2 SR Structure Area Structure Use structure set by SR Structure If not set SR Structure Physical SR Structure Virtual are checked 4 SR Structure Get Invisible Include invisible tables 8 SR Structure Get Empty Tables Include empty tables not fields or indexed fields 16 SR Structure Sort By Name Sort result array by name Result Data A va
20. C_LONGINT Report Area Options C_LONGINT Options Result Data C_BLOB Command List BLOB ExcludeThemeList ARRAY INTEGER or ARRAY LONGINT Excluded Theme List ExcludeCommandList ARRAY INTEGER or ARRAY LONGINT Excluded Command List gt ResultCode C_LONGINT Format Number SR Get Commands As List BLOB builds a 4 Dimension hierarchical list BLOB using the reports command list see SR Commands You can supply an optional filter array which will remove specific themes and or specific commands This routine is used internally by the SuperReport Pro dialogs and may be used when creating customized report interface For more information on creating customized report interface please refer to Chapter 6 Command Reference Object Properties ReportArea The desired SuperReport Pro area Options You may choose one or more of the following values 0 SR Commands By First Char Sort commands by first character of routine name 1 SR Commands By Theme Sort commands by theme name 2 SR Commands Area Commands Get all commands as configured by SR Commands 4 SR Commands Sort Second Level Sort commands by second level 8 SR Commands Sort First Level Sort commands by first level Result Data A valid 4 Dimension BLOB variable which will receive the formatted command hierarchical list You may use this BLOB as a 4 Dimension list object where ever hLists are supported ExeludeThemeArray A 4 Dimensio
21. Code SR Get Area Format will return the report pages format either physical page or printable area ReportArea The desired SuperReport Pro area AreaFormat Returns the report area format One of the following values will be returned 1 SR AreaFormat Physical Page 2 SR AreaFormat Printable Area gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below See Also SR Set Area Format Example The following example will return the report area format for a SuperReport Pro area SR_Err SR Get Area Format SR_AREA SR_AreaFormat See Also SR Set Area Format SuperReport Pro Page 87 of 226 SR Set Atea Format SR Set Area Format reportArea L areaFormat L adjustOptions L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area AreaFormat C_LONGINT Report area format AdjustOptions C_LONGINT Report adjustment options gt ResultCode C_LONGINT Result Code SR Set Area Format will set the report pages format either physical page or printable area and perform any specified formatting options This routine performs the same task as selecting Options Physical Page or Options Printable Area when using the SuperReport Pro editor ReportArea The desired SuperReport Pro
22. Creator Extension on Windows gt ResultCode C_LONGINT Result Code SR File Types allows you to get or set the File Type and or Creator code for report documents created by SR Save Report SR Print To Disk and SR Print HTML commands and their corresponding command when using the SuperReport Pro Editor Platform The desired platform you wish to set the file type or creator 1 Macintosh platform 2 Windows platform Action Desired execution action You can either get or set the file type and creator codes 1 Get Creator Code not applicable on Windows 2 Get File Type TEXT Code returns file extension on Windows 4 Get File Type for SuperReport Pro documents i e SR Save Report 1 Set the Creator Code not applicable on Window 2 Set File Type Code for TEXT files those created with SR Print To Disk or SR Print HTML 4 Set File Type Code for SuperReport Pro documents i e SR Save Report Value Corresponding value for defined action If you are retrieving the value negative action code you must pass a valid 4 Dimension variable which will be used to receive the value gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Examples The following example will assign the Creator code for
23. DELETE OFFSCREEN AREA SR_AREA In the event you wish to review the report we just created you can either open the form which contains a SuperReport Pro area or open the saved report from disk or you can use the Open External Window command In this case we ll load the report from disk and display it using an external window open external window SuperReport Pro Page 71 of 226 SR_AREA Open external window 50 50 Screen width 50 Screen height 50 8 test srp SuperReport If SR_AREA gt 0 load the report we just created SR_Err SR Load Report SR_AREA test srp End if While this example demonstrates SuperReport Pro s ability to procedurally create reports the control does not stop there Fora more complete report based on these examples please refer to the X_CreateReport routine contained in the SuperReport Pro demo database This routine will demonstrate some more techniques you can use when creating reports as well as a number of additional objects to create a Real Life report SuperReport Pro Page 72 of 226 6 Command Reference This chapter outlines all the 4th Dimension procedure objects and supporting external routines SuperReport Pro Extras included in the SuperReport Pro package as well as examples on how to use the various SuperReport Pro routines The syntax used here is similar to the syntax used by 4th Dimension Language Reference manual and is broken down into the following s
24. Data RectTop Object Position Top The object position is relative to the upper left corner of the report area RectLeft Object Position Left The object position is relative to the upper left corner of the report area RectBottom Object Position Bottom The object position is relative to the upper left corner of the report area RectRight Object Position Right The object position is relative to the upper left corner of the report area Object Type Desired object type One of the following values will be returned 1 SR Object Type Text SuperReport Pro Page 181 of 226 2 SR Object Type Field 3 SR Object Type Variable 4 SR Object Type Line 5 SR Object Type Rectangle 6 SR Object Type Circle 8 SR Object Type Picture If you are retrieving properties for a static text object SR Object Type Text or picture object SR Object Type Picture you can retrieve the static information using SR Get Object Data after this routine has completed Options Object Options The value returned by this parameter will be the sum of the object options You can use 4Ds standard bitwise operators to extract individual item options 1 SR Obj Flag Left Line 2 SR Obj Flag Top Line 4 SR Obj Flag Right Line 8 SR Obj Flag Bottom Line 15 SR Obj Flag All Lines 16 SR Obj Flag Fixed Horizontal 32 SR Obj Flag Fixed Vertical 64 SR Obj Flag Grow Horizontal 128 SR O
25. Description ReportArea C_LONGINT Report plug in area Section ID C_LONGINT Report Section ID to obtain properties Use Section C_LONGINT Use section flag Print Section C_LONGINT Print section flag Position C_LONGINT Section vertical position Options C_LONGINT Miscellaneous Options Throw Page C_LONGINT Start New Page Setting Min Space C_LONGINT Minimum Space Break Type C_LONGINT Section break type Break Table C_LONGINT Break Table Number when break on field Break Field C_LONGINT Break Field Number when break on field Break VarName C_STRING or C_TEXT Break Variable Name when break on var gt ResultCode C_LONGINT Result Code SR Set Section Properties will assign the various properties for the given section object If the section is not active see SR Set Sections the settings will be ignored Note In most cases passing a value of 1 will use the current value for the section If you are unsure when to use a default value it is recommended that you pass the desired value you wish to use ReportArea The desired SuperReport Pro area Section ID A valid SuperReport Pro section i e SR Section Body or SR Section Header For a complete list of sections please refer to Chapter 7 SuperReport Pro Codes Section Codes Use Section Determines if the desired section will be used and in what capacity 1 SR Use Section Always 2 SR Use Section On Break 3 SR Use Section On First Page 4 SR Us
26. Document reportArea L document S gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Document C_STRING 255 Current document gt ResultCode C_LONGINT Result Code SR Document returns the current full pathname for the defined SuperReport Pro area ReportArea The desired SuperReport Pro area Document A valid 4 Dimension variable which will receive the full pathname for the defined SuperReport Pro area If the report area contains a new report or a report that was not read from disk the Document parameter will contain a null string gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will load a report from disk using the SR Load Report routine and then use the SR Document routine to determine the full pathname of the selected file C_TEXT tSR_ReportPath C_LONGINT iSR_Err iSR_Err SR Load Report eReportArea If iSR_Err 0 iSR_Err SR Document eReportArea tSR_ReportPath End if SuperReport Pro Page 111 of 226 SR File Types SR File Types platform L option L value S gt resultCode L Parameter Data Type Description Platform C_LONGINT Desired platform Option C_LONGINT File Type or Creator Option Value C_STRING 4 File Type or
27. Hide HTML Disable HTML access HTML button will be removed from appropriate dialogs 8 SR Options Use Std Guides Use standard guides when draw report area red blue etc 32 SR Options Hide Menubar Hide Menubar 64 SR Options Hide Toolbar Hide Toolbar 128 SR Options Hide Hor Scrollbar Hide Horizontal Scrollbar 256 SR Options Hide Vert Scrollbar Hide Vertical Scrollbar gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below NOTE Passing a value of 1 on any of the option parameters will use the current settings See Also SR Set Options SR Get Options SuperReport Pro Page 89 of 226 SR Get Options SR Get Options reportArea L showReportMenu L enableScriptAccess L miscReportOpts L zoomTitle gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area ShowReportMenu C_LONGINT Show Database menu EnableScriptAccess C_LONGINT Enable access to Scripts button Miscellaneous Opts C_LONGINT Additional configuration options Zoom Title C_STRING Zoomed window title gt ResultCode C_LONGINT Result Code SR Get Options allows you to retrieve the custom options see SR Set Options a SuperReport Pro area ReportArea The desired Super
28. L text S enable L mark L overrideMethod S gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Action C_LONGINT Menu item action SRProMenu C_LONGINT SuperReport Pro MenuID Text C_STRING 32 Menu item text Enable C_LONGINT Menu item enable flag Mark C_STRING 2 Menu item mark Override Method C_STRING 32 Replacement Method gt ResultCode C_LONGINT Result Code SR Menu Item is used to query a menu item s characteristics and attributes or to set one or more of the menu items attributes such as the menu item text This command can also be used to override the default menu action with a custom 4th Dimension method ReportArea The desired SuperReport Pro area Action Desired action to perform using the following action codes You may choose one of the following 1 SR Menultem Count Items 0 SR Menultem Query Or combination of the following 1 SR Menultem Set Text 2 SR Menultem Set Status 4 SR Menultem Set Mark 8 SR Menultem Set 4D Method 0 Query desired menuID 1 Set menu item text using Text parameter 2 Set menu item status using Enable parameter 4 Set menu item mark using Mark parameter 8 Set override method using Override Method parameter SRProMenu The internal SuperReport Pro menu number which you wish to work with For a complete list of SuperReport Pro MenulIDs please refer to Chapter 7 SuperRe
29. Modified status 0 Set status flag to not modified 1 Set status flag to modified needs saving gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will set the modified flag to zero For additional examples on how to use SR Set Modify please refer to the SR Is Modified example result SR Set Modify eReportArea 0 clear the modify flag for the report in eReportArea See Also SR Is Modified SuperReport Pro Page 140 of 226 SR Get Tips Enabled SR Get Tips Enabled gt tipState L Parameter Data Type Description gt tipState C_LONGINT Tool Tips State SR Get Tips Enabled will return to the tool tip state of SuperReport Pro tool tips Note This routine works in the same fashion as 4Ds built in tool tips Enabling or disabling tool tips with this routine will affect all application tool tips including those used by 4D gt Result Code Tool tip state 0 Tool tips are not enabled 1 Tool tips are enabled Example The following example determines if 4Ds tool tips are enabled If not they are enabled using the SR SET TIPS ENABLED routine state SR Get Tips Enabled returns the tool tip state If state 0 SR SET TIPS ENABLED state End if See Al
30. Node SuperReport Pro is a trademark of Automated Solutions Group SuperReport Pro Page 8 of 226 Introduction SuperReport Pro consists of a plug in area which is placed on your input form or dialog and a group of supporting plug in routines which can be used to procedurally interact with report templates You can implement SuperReport Pro by simply placing the report plug in area on your form and provided additional customization using the plug in routines About SuperReport Pro SuperReport Pro s greatest benefit is the fact that it provides the ability for users to create and modify report designs long after a 4Ddatabase application has been completed without requiting any code changes to the database This benefit is further enhanced in the case of compiled databases where SuperReport Pro allows reports to be changed without requiring either database changes or recompilation SuperReport Pro reports can be held as documents on disk or be contained within the data file belonging to the database Thus vertical market applications sold to many customers can be supplied with standard reports which can later be customized by the user Since these reports are held in the data file program updates installed at a later date will have no impact on the different users systems the same program update can be sent to all users and all the user s customized reports are preserved SuperReport Pro s power does not come at the expense of
31. SR Get Set Guides e SR Get Set Object Data e SR Get Set Object Format e SR Get Set Object Properties e SR Get Set Object Scripts e SR Get Set Scripts e SR Get Set Sections e SR Get Set Section Properties e SR Get Set Section Scripts e SR Get Set Section Scripts e SR Get Set Tool SuperReport Pro Page 163 of 226 SR Set Editor Callback SR Set Editor Callback reportArea L callbackMethod S gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Callback Method C_STRING Report Editor Callback Method gt ResultCode C_LONGINT Result Code SR Set Editor Callback installs the desired callback method you wish to be executed when a SuperReport Pro Editor event occurs ReportArea The desired SuperReport Pro area Callback Method A valid 4 Dimension method which will be executed whenever an editor event is executed gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below The callback method receives the following events Parameter Data Type Description ReportArea C_LONGINT Report plug in area that activated the event Action Type C_LONGINT Report Editor Action Item Reference C_LONGINT Report item associated with event Object Type C_LONGINT Report Object Type Item Reference Detail
32. SR Object Type Picture you can set the static information using SR Set Object Data after this routine has completed ReportArea The desired SuperReport Pro area ObjectID Desired objectID you wish to obtain object properties You can use the object support routines SR Get Object IDs SR Get Object Properties etc to obtain detailed information about each report object SuperReport Pro Page 184 of 226 Action Desired property you wish to set If you are setting multiple attributes you should pass the accumulative total of all action codes You may choose one or mote of the following selectors If you are setting all attributes you can use the SR Property All selector Property Name 1 SR Property All 1 SR Property Name 2 SR Property Position 4 SR Property Type 8 SR Property Options 16 SR Property Selected 32 SR Property Field 64 SR Property Variable Type 128 SR Property Calculation 256 SR Property Rows Cols 512 SR Property Repeat Offsets Description Set all object properties Set the objName set variable field Set rectTop rectLeft rectBottom rectRight Set type Set options Set selected Set table amp field set name if is SR Property Name also set field objects only Set varType variable objects only Set calcType amp calcName variable field objects only Set rows amp cols for rect objects only Set repeatH Offset amp repeat VO
33. SR_Err SR Count Objects SR_AREA SR All Objects See Also SR Get Object Properties SR Get Object IDs SR Set Object Properties SR Change Object Order SR Reorder Objects SuperReport Pro Page 170 of 226 SR Get Object IDs SR Get Object IDs teportArea L selectedOnlyFlag L objectIDlist X gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Selected Only Flag C_LONGINT Selected Objects Only Flag Object ID Array ARRAY INTEGER or LONGINT Array of Object IDs gt ResultCode C_LONGINT Result Code SR Get Object IDs builds a 4t Dimension array containing a list of report object IDs Using the Selected Only Flag you can conditionally return only those elements which are selected or all report objects ReportArea The desired SuperReport Pro area Selected Only Flag Determines of the array should contain all report objects or only those which are currently selected 0 SR All Objects 1 SR Selected Objects Object List A valid 4th Dimension array which will receive the list of object IDs gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will build an array of all selected objects for the desired report area ARRAY INTEGER aiSR_ObjectList
34. Select Table Select Field Name Address Turnover E Invoice HE Item Telephone Fax Active aTom Logo Display Format Figure 14 SuperReport Pro Field Object Dialog Text Object Properties SS HTML Data O Fix Horizontal Position Oo Fix Vertical Position Figure 15 SuperReport Pro Static Text Object Dialog SuperReport Pro Page 41 of 226 SuperReport Pro Variable Object Properties General HTML Data Display Filter Variable Type Yariable Variable Name I Report bate Report Time Array Element C g Page Number Record Number mDisplay Format Display Filter Example No Example Available Figure 16 SuperReport Pro Variable Object Dialog Page 42 of 226 e Database Report Table Iterations This item will display the Report Table Iterations definition dialog which will allow you set the main file for your report Main Table Iterations amp Invoice E Item ie Fixed Number Of Iterations value E Q Use Value In Yariable Name haa Use Size Of Array Name eee C IC Figure 17 SuperReport Pro Main Table Iterations Dialog SuperReport Pro Page 43 of 226 e Edit Add Delete Sections This item will display the Section management dialog allowing you to add delete report sections which are used for creating break processing reports You activa
35. The following is a list of possible result codes which may be returned NOTE If the routine completed successfully a value of zero will be returned Error Code Description 2000 SR Editor Item Invalid 2001 SR Editor Section Not Active 2002 SR Editor Sect Position Invalid 2003 SR Editor Cannot Disable Sects 2004 SR Editor Invalid Sect Option 2005 SR Editor Incompatible Obj Type 4001 Invalid Table SR Structure 4002 Invalid Record 4003 Invalid Field SR Structure 8000 Invalid Report Format 8001 Insufficient Memory Fatal Error 8002 Invalid Array Type 8003 User Cancelled Dialog or Operation 8004 No Selected Report Objects 8005 Unknown Standard Variable Type 8006 Invalid Menu ID 8007 Invalid Parameter 8008 Invalid Area Reference e g nil already destroyed etc In addition to the above described error codes SuperReport Pro may return a standard Macintosh OS error code which is not related to the internal working of SuperReport Pro Should you receive an error code which is not described in the above list please refer to the System Errors application provided with SuperReport Pro for more details SuperReport Pro Page 215 of 226 Event Codes When using a custom callback method installed by SR On Event one or more of the following event codes will be returned to the event method Event Code 11 12 13 14 15 20 21 30 31 32 33 34 35 40 41 SuperReport Pro Constant Name SR
36. When you ate display SuperReport Pro in an external window you should use a Window type of 8 so that the window can be resized by the user and the close box is available If you use a modal window type 1 or type 5 the user will not be able to close the window Step 2 If you wish to communicate with the SuperReport Pro editor in an external window you can use the window reference iSR_Win as the area reference parameter for those routines which interact with the plug in area C_TEXT tReportDoc tReportDoc Hard Disk myReport srp iSR_Err SR Load Report iSR_Win tReportDoc SuperReport Pro Page 34 of 226 Using Plug in Area The second and most common way to use SuperReport Pro is to place the plug in area on an input form then provide access to the input form either via the DIALOG command or through the standard MODIFY SELECTION command or User Mode access Step 1 Create a new input form or modify an existing input form which you wish to display the SuperReport Pro plug in area Step 2 Create a new plug in object using the 4 Dimension Property List Figure 9 Step 3 Select the SuperReport object from the Plug in Area popup menu to create a SuperReport Pro area Note The SuperReport Pro object is displayed as it is used when using SuperReport Por in 4D s user environment Report_i lt None gt Detail Form Inherited from 41 Groups K 4D Chart er SuperReport fe SuperReport Pro 7 i K TC Cursor
37. Zoom Area SR UnZoom Area SR Zoom Area to Back SR Orig Area to Back SR Atea Closing SR Editor Mode SR Preview Mode SR Preview First Page SR Preview Previous Page SR Preview Next Page SR Preview Last Page SR Preview Print Page SR Close Preview SR Menu Item Selected Before SR Menu item Selected After Description Report Area Zoomed Report Area Un zoomed returned to Editor Zoomed area has lost focus Original area has lost focus Report Area has been closed Switched from Preview to Editor Mode Switched from Editor to Preview Mode Preview Preview Preview Preview Preview Preview First Page Button Selected Previous Page Button Selected Next Page Button Selected Last Page Button Selected Print Button Selected Close Button Selected Menu Item Selected Before Menu Item Selected After Page 216 of 226 Menu Numbers When using the SR Menu Item or SR Menu Info routines you can reference the internal number of any SuperReport Pro menu using the following table Menu ID Apple Menu 0 File Menu 101 102 103 104 105 106 107 108 109 110 Edit Menu 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 SuperReport Pro Constant Name SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR SR Menultem New Menultem Open Menultem Close Menultem Save Menultem Save As Menultem Print To Disk Me
38. a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will save a SuperReport Pro document to disk which is contained in the eReportArea C_TEXT tReportDoc tReportDoc Hard disk myReport srp iSR_Err SR Save Report eReportArea 0 tReportDoc use the tReportDoc report iSR_Err SR Load Report eReportArea 1 tReportDoc display the Open File dialog See Also SR Save Report SuperReport Pro Page 82 of 226 SR New Report SR New Report resultBlobObject P gt resultCode L Parameter Data Type Description ResultBlobObject C_BLOB Result BLOB object gt ResultCode C_LONGINT Result Code SR New Report will create a new report and place it in the supplied report variable This routine should be called whenever you are creating a new report or display a dialog which contains a SuperReport Pro area and you have not called the SR Set Area routine to preload the area with an existing report ReportData A valid 4 Dimension variable which will contain the new report gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below NOTE If you don t call SR New Report SuperReport Pro attempts to create a new report when the form is displayed If the report area
39. developers and users so they aren t required to know the internal working of the SRP Developer API For more information about creating SRP wrapper routines please review the SRP Developer API section If Invoice Total lt 0 SR_SetFont SRObjectID 1 1 SR_SetForeColor SRObjectID 0OxOOFFOOOO Else SR_SetFont SRObjectID 1 0 SR_SetForeColor SRObjectID 0xO0000000 End if SuperReport Pro Page 169 of 226 SR Count Objects SR Count Objects reportArea L selectedOnlyFlag L gt numberOfObjects L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Selected Only Flag C_LONGINT Selected Objects Only Flag gt ResultCode C_LONGINT Number of Objects SR Count Objects returns the number of objects for the desired report area You may choose to only return the number of selected objects by using the Selected Only Flag ReportArea The desired SuperReport Pro area Selected Only Flag Determines of the array should contain all report objects or only those which are currently selected 0 SR All Objects 1 SR Selected Objects gt Result Code Returns the number of objects for the desired area greater than or equal to zero otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will return the total number of objects for the desited report area
40. foreground color in 4Ds style of expressing RGB colors BackBlue Object background color Blue You can also use the BackColor parameter which returns the foreground color in 4Ds style of expressing RGB colors ForePattern Object foreground pattern 0 32 BackPattern Object background pattern 0 32 Line Thickness Object line thickness when SR Object Type Line SR Object Type Circle or SR Object Type Rectangle Valid range of 1 9 1 equals hairline ForeColor Object foreground color using 4Ds style of expressing RGB colors 0xOORRGGBB BackColor Object background color using 4Ds style of expressing RGB colors 0xOORRGGBB See Also SR Get Object Scripts SR Get Object Data SR Set Object Format SR Get Object Properties SuperReport Pro Page 189 of 226 SR Set Object Format SR Set Object Format reportArea L objectID L action L fontName S fontSize L fontStyle L justification L formatString S foreRed L foreGreen L foreBlue L backRed L backGreen L backBlue L forePattern L backPattern L lineThickness L foreColor L backColor L gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Object ID C_LONGINT Report section ID Action C_LONGINT Action FontName C_STRING or C_TEXT Font Name FontSize C_LONGINT Font Size FontStyle C_LONGINT Font Style Justification C_LONGINT Justification Format String C_LONGINT Object Formatting String ForeRed C_LONGINT Foreg
41. how SuperReport Pro can be used in your applications SuperReport Pro provides an extensive feature set for providing reporting interfaces for your custom applications and your end users Whether you purchased SuperReport Pro to create custom reports or you wish to provide the ability for your users to create and maintain their own reports SuperReport Pro can handle the job This chapter outlines a variety of ways in which you can use SuperReport Pro to provide advanced reporting capabilities within your application SuperReport Pro Page 33 of 226 Basic Integration SuperReport Pro can be integrated into your applications in two different methods The first method uses the 4 Dimension Open external window the second uses a 4 Dimension form that can be displayed in a dialog or input form All examples discussed in this section assume you have a custom table for storing the various reports you create In our example we ll have the following table structure SR_ReportName SR_Descr iption SR_ReportData Figure 8 Report Manager Structure Using External Window Using the 4 Dimension Open external window command you can display the SuperReport Pro editor in a fashion similar to the New process command Step 1 Open the SuperReport Pro editor in an external window using the following code C_LONGINT iSR_Win iSR_Win Open external window 50 50 Screen width 50 Screen height 50 8 New Report SuperReport
42. of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will set the default filename for the HTML file to myReport html display the Save File dialog and print all sections C_LONGINT iSR_Result options section C_TEXT tSR_Document tSR_Document myReport html options 1 show Save File dialog section O all sections iSR_Result SR Print HTML ReportMgr ReportData tSR_Document options section 1 See Also SR Page Setup SR Preview SR Print Report SR Print Disk SR Print To BLOB SR Print PICT SuperReport Pro Page 159 of 226 SR Print To BLOB SR Print To BLOB reportObject P reportData O options L sectionFlag L fieldDelim L recDelim L objectOrder L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Report Data C_BLOB 4D BLOB Variable PrintOption C_LONGINT Print Options SectionFlag C_LONGINT Print Section Flags FieldDelim C_LONGINT Field Delimiter RecDelim C_LONGINT Record Delimiter Object Order C_LONGINT Printed Object Order gt ResultCode C_LONGINT Result Code SR Print To BLOB allows you to print the defined SuperReport Pro report to a 4 Dimension BLOB variable This is very useful when you wish to display reports created by SuperReport Pro as part of a dynamic web page using a tool such as Active4D All HTML tags defined using HTML dialog for the various report objects will be
43. of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 152 of 226 Example The following example will print a saved report in a 4 Dimension report record printing all sections except the header and footer C_LONGINT iSR_Err C_LONGINT options section C_STRING 255 sSR_Document options 1 4 display save file dialog and print static text items section 65535 1 32768 print all sections except the Header and Footer iSR_Err SR Print Disk ReportMgr ReportData sSR_Document options section 9 13 See Also SR Page Setup SR Preview SR Print Report SR Print HTML SR Print To BLOB SR Print PICT SuperReport Pro Page 153 of 226 SR Print PICT SR Print PICT reportObject P pictArrayName S options L sections L gt resultCode L Parameter Data Type Description ReportArea C_BLOB Report PictArrayName C_STRING 32 Name of PICT array PrintOption C_LONGINT Print Options SectionFlag C_LONGINT Print Section Flags gt ResultCode C_LONGINT Result Code SR Print PICT allows you to print a SuperReport Pro report to a picture array without requiring a SuperReport Pro area the printed pages are placed in each element of the picture array This command can be used to implement your own print preview or alternate web printing system instead of using SR Print HTML Repor
44. procedurally creating and managing reports as well as routines for customizing the entire Editor interface e Enhanced HTML Interface SuperReport Pro includes new interfaces for creating and working with reports from within web applications Developers can now create reports using SuperReport which may be invoked and displayed within web applications e New and Enhanced Commands SuperReport Pro includes over 50 new and enhanced commands providing more power and flexibility for report creation and management requitements e Report Manager Using the SuperReport Pro Report Manager users will be able to manage all the various reports for your application Since the Report Manager is based on standard 4 Dimension code you can modify the Report Manager system to suit your needs or use it as is e Procedural PDF Ouptut MacOSX Only SuperReport Pro 2 8 includes new routines for procedurally creating PDF reports when running on MacOSX These routines use the OSX native PDF libraries SuperReport Pro Page 11 of 226 System Requirements 4th Dimension SuperReport Pro is compatible with 4th Dimension v2004 and higher or 4D Server v2004 or higher including 4D v11 SQL and v12 System Software SuperReport Pro is compatible with Windows XP or greater and Mac OS 10 4 or greater Technical Support Technical support for SuperReport Pro will be provided electronically via e mail or our online support reporting system You ate
45. relative to the upper left corner of the report area RectRight Object Position Right The object position is relative to the upper left corner of the report area SuperReport Pro Page 174 of 226 Object Type Desired type of object you are creating You may use one of the following values 1 SR Object Type Text 2 SR Object Type Field 3 SR Object Type Variable 4 SR Object Type Line 5 SR Object Type Rectangle 6 SR Object Type Circle 8 SR Object Type Picture If you are creating a static text object SR Object Type Text or picture object SR Object Type Picture you can set the static information using SR Set Object Data after this routine has completed Options Object Options The value passed to this routine will vary depending on the type of object you are creating You may use one or more of the following values When using multiple values pass the sum of all objects you wish to activate 1 SR Obj Flag Left Line 2 SR Obj Flag Top Line 4 SR Obj Flag Right Line 8 SR Obj Flag Bottom Line 15 SR Obj Flag All Lines 16 SR Obj Flag Fixed Horizontal 32 SR Obj Flag Fixed Vertical 64 SR Obj Flag Grow Horizontal 128 SR Obj Flag Grow Vertical 256 SR Obj Flag Variable Width 512 SR Obj Flag Variable Height 1024 SR Obj Flag Replace If Empty 2048 SR Obj Flag Use Calc Value 4096 SR Obj Flag Show Calc Value 8192 SR Obj Flag Repeating Object 1
46. report should look something like the following The next step is to set the Main Table for this report The main file will be used table which contains the current selection of records in our case we ll select the Customer table Select Report Table Iterations from the Database menu The Report File Iterations dialog will be displayed SuperReport Pro Page 46 of 226 Main Table Iterations E Invoice f Item Oo Fixed Number Of Iterations Value Ey QO Use Value In Variable Name Do QO Use Size Of Array Name rr ICS Figure 21 SuperReport Pro Table Selector Dialog Step 6 We re just about done The last thing we need to do is establish a selection of records for the selected file Choose Select Records from the Database menu The standard 4 Dimension Query Editor will be displayed which will allow you to perform any query you wish to establish the record selection Step 7 You should now save your report before continuing Click the forms Save button which will in turn execute the Save code we created in the Using Plug In Area section Step 8 Return to the record we just created by double clicking it from the report table output form If you have successfully completed the steps outlined in the Using Plug In Area section your report will appear in the report editor and you are ready to Print your Report If you don t see the report template we just created please review the Using Plug In Area section a
47. routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example deletes a SuperReport Pro object SR_Err SR Delete Object SR_AREA SR_ObjectID See Also You may delete any object which you have created procedurally SR Create Object or objects which have been created by users in the report editor SuperReport Pro Page 178 of 226 SR Get Object Scripts SR Get Object Scripts reportArea L objectID L sectionScript T htmlPre T htmlPost T gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Object ID C_LONGINT Report section ID Object Script C_TEXT Object Script Object HTML Start C_TEXT HTML Start Block Object HTML End C_TEXT HTML End Block gt ResultCode C_LONGINT Result Code SR Get Object Scripts will retrieve the object script and HTML information for the defined object ReportArea The desired SuperReport Pro area Object ID Desired ObjectID You can use the object support routines SR Get Object IDs SR Get Object Properties etc to obtain detailed information about each report object Object Script A valid 4 Dimension variable which will receive the object script Object HTML Start A valid 4 Dimension variable which will receive the objects start HTML block Object HTML En
48. simplicity Most users will be able to grasp the concepts involved in designing reports since the editor is so similar to a drawing program Report operations like break processing which can be cumbersome and complex in 4D are also made simpler with the user able to specify when breaks occur and which objects are to be totaled without requiring any code SuperReport Pro Features SuperReport Pro includes a wide variety of features for creating fully customizable reports Using the full featured plug in area you can quickly and easily enhance your applications reporting capabilities If the standard functionality is not enough you can take advantage of the complete developer API to further extend the power of SuperReport Pro Included in SuperReport Pro are the following features e Compatibility with 4D 2004 and above including v11 SQL and v12 e Include a full featured reporting tool in any application quickly and easily e Enhance reporting capabilities using the SuperReport Pro developer API Complete support for creating HTML formatted reports e HTML Report Generation Support e Repeating objects for print related many records Supports printing 4 Dimension arrays including direct access to specific array elements Support for executing callback routines and object scripts when printing reports Support for execute custom script execution systems for enhanced script management e Support for custom structure views gre
49. the sum of the section numbers that you require which are listed in the Chapter 7 SuperReport Pro Codes Section Codes You may choose one or more of the following 0 SR All Sections 1 SR Section Header Mask 2 SR Section SubHeader1 Mask 4 SR Section SubHeader2 Mask 8 SR Section SubHeader3 Mask 16 SR Section SubHeader4 Mask 32 SR Section SubHeader5 Mask 64 SR Section SubHeader6 Mask 128 SR Section Body Mask 256 SR Section SubTotal6 Mask 512 SR Section SubTotal5 Mask 1024 SR Section SubTotal4 Mask 2048 SR Section SubTotal3 Mask 4096 SR Section SubTotal2 Mask 8192 SR Section SubTotall Mask 16384 SR Section Total Mask 32768 SR Section Footer Mask gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 146 of 226 Example C_BLOB pSR_ReportData C_LONGINT iSR_NumPages pSR_ReportData ReportMgr ReportData iSR_NumPages SR Get Number Of Pages pSR_ReportData 0 SR All Sections SuperReport Pro Page 147 of 226 SR Page Setup SR Page Setup reportArea L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area gt ResultCode C_LONGINT Result Code SR Page Setup is used to display t
50. tools you need to customize SuperReport Pro to integrate with vertical market and custom applications The following tutorial will teach you how to procedurally create a SuperReport Pro report and saving the report to disk After the report has been created we ll open it using SuperReport Pro s external window interface to see our new report Step 1 Step 2 Step 3 Step 4 The first step to creating a new report is to use the SR New Offscreen Area command to create an empty report document SR_AREA SR New Offscreen Area After you have successfully created the offscreen atea you are now ready to begin adding creating objects to the report The following code will add a header column title object SR Object Type Text to the report By default SuperReport Pro s sections are offset by 25 pixels starting with the top of the form header body etc Our first object will be placed at 40 pixels from the top of the form so that it will be placed near the top of the header section below the page boundaries create first column header top 40 left 50 right left objWidth SR_ObjType SR Object Type Text SR_ItemID SR Create Object SR_AREA SR_ObjName top left bottom right SR_ObjType SR_Opts SR_Selected tableNo fieldNo SR_VarType SR_ArrayElement SR_CalcType SR_CalcName SR_Rows SR_Cols SR_HRepeat SR_VRepeat Once the object has been created you can set some optional properti
51. use only blob fields It is possible to export all reports from picture fields in 4D 2004 and reimport them to blob fields in 4D v11 v12 as well Note that as parameter declaration of SuperReport Pro calls is changed from Picture to Blob compiler in 4D will show all places where picture variable or field are passed to SuperReport Pro as compiler errors e SuperReport Pro is now fully compatible with 4D v11 v12 e Fixed Print Preview on MacOS X e Fixed script editing on Windows CR LF handling e Removed Cancel button from SuperReport Pro Preview button In 4D v11 v12 a plugin cannot close its window in which it displays a plugin area e Fixed a problem where SuperRepott Pro tried to display a dialog when the Preview window was displayed This resulted in a freeze of 4D eade license system Only one registration key is required The key is either linked to the 4D or 4D Server serial number or to the name of the company developer Please refer to the Registration section on page 13 SuperReport Pro Page 10 of 226 What s New in SuperReport Pro 2 8 e Enhanced User Interface SuperReport Pro has been enhanced providing a revamped user editor interface All interface elements are now consistent with the internal 4 Dimension interface and utilizes modern interface elements Developer Interface SuperReport Pro now includes a full featured developer interface which provides 4 Dimension application developers will a suite of routines for
52. which objects are printed to disk or HTML files ReportArea The desired SuperReport Pro area Move To Front Move object items to front 0 SR Generic Option Set Off 1 SR Generic Option Set On Object ID List A valid 4 Dimension integer or longint array containing object IDs you wish to move If you would like to build an array of SuperReport Pro objects use the SR Get Object IDs routine gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example moves the array of objects to front of object list SR_Err SR Reorder Objects SR_AREA SR Generic Option Set Off aiSR_ObjectID See Also SR Count Objects SR Get Object Properties SR Get Object IDs SR Set Object Properties SR Change Object Order SuperReport Pro Page 173 of 226 SR Create Object SR Create Object reportArea L objName S recTop L rectLeft L rectBottom L rectRight L objType L options L selected L tableNo L fieldNo L varType L arrayElement L calcType L calcName S rows L cols L repeatHOffset L repeatVOffset L gt itemID result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area ObjName C_STRING or C_TEXT Object Name RectTop C_LONGINT Object Position Top RectLeft C_LON
53. you are required to convert your reports to be based on the Many table then print related one records SuperReport Pro provides the ability to include related many records as part of the primary table NOTE You can only expand one level if you need to print related many records more than one level you ll need to redesign the report to print from the Many table Step 1 Create the report as you normally would using the fields from the parent table etc Step 2 Next we ll place the following fields in the Body section fields from a related many table Invoice CreateDate Invoice Total You can apply any type of data formatting you wish to get a feel for what SuperReport Pro has to offer in the way of displaying data Step 3 Double click on the Invoice CreateDate field and click the Repeat button in the Object Definition dialog Options page the following dialog will be displayed SRPro Field Object Properties 5 HTML Data r djustment Options Miscellaneous Options Invoice CreateDate Field Options Oo Show Calculated Value Calculation Options Print With Yariable Width O Print With Variable Depth g Oo Calculate Total Don t Calculate This Object oO QO Calculate Minimum ie Calculate Average Repeating Options QO Calculate Maximum DA Repeat This Object J Record Value In Variable DI Use Vertical Repeat Offset ic Points oO Use Horizontal Repeat Offset
54. 16 S ears ejui z0 __ ee O a Header Body 250 400 Ao om 4 Ai Figure 10 SuperReport Pro on Input Form Step 8 Go ahead and staring adding objects to the report form by using the Report Toolbar just to get a feel for what SuperReport Pro is all about We ll go into more detail about the Report Editor later in this chapter SuperReport Pro Page 37 of 226 SuperReport Pro Editor Introduction Now that you have successfully created your SuperReport Pro area it is time to introduce you to the SuperReport Pro Editor This section will provide an overview over the various editor components and how they can be used to create reports e Toolbar Overview e Section Marker Overview e Menu Overview Creating a basic listing report e Creating a basic form report e Using Repeating Objects e Creating a basic break processing report Creating an HTML report Printing Arrays Toolbar Overview Before you can begin creating reports you should probably know a little about the SuperReport Pro Editor Toolbar First Row Figure 11 Master Toolbar Arrow Tool Select this tool whenever you wish to work with a specific report object Text Tool Select this tool whenever you wish to create a static text object Field Tool Select this tool whenever you wish to create a field object Variable Tool Select this tool whenever you wish to create a variable obje
55. 5 64 SR Section SubHeader6 Mask SubHeader6 128 SR Section Body Mask Body 256 SR Section SubTotal6 Mask SubTotal6 512 SR Section SubTotal5 Mask SubTotal5 1024 SR Section SubTotal4 Mask SubTotal4 2048 SR Section SubTotal3 Mask SubTotal3 4096 SR Section SubTotal2 Mask SubTotal2 8192 SR Section SubTotall Mask SubTotall 16384 SR Section Total Mask Total 32768 SR Section Footer Mask Footer If you are using the SR Get Sections routine and would like to determine if a given section is active you can use one of the section bit operands outlined below In addition you may use these constants with SR Get Set Section Properties and SR Get Set Section Scripts to define the sections that you wish to use Value Constant Name Description 65535 SR All Sections All Sections 0 SR Section Header Header 1 SR Section SubHeader1 SubHeader1 2 SR Section SubHeader2 SubHeader2 3 SR Section SubHeader3 SubHeader3 4 SR Section SubHeader4 SubHeader4 5 SR Section SubHeader5 SubHeader5 6 SR Section SubHeader6 SubHeader6 7 SR Section Body Body 8 SR Section SubTotal6 SubTotal6 9 SR Section SubTotal5 SubTotal5 10 SR Section SubTotal4 SubTotal4 11 SR Section SubTotal3 SubTotal3 12 SR Section SubTotal2 SubTotal2 13 SR Section SubTotal1 SubTotall 14 SR Section Total Total 15 SR Section Footer Footer SuperReport Pro Page 214 of 226 Error Codes Each of the SuperReport Pro commands returns some type of result code with the exception of the SR ABOUT routine
56. 6384 SR Obj Flag Repeat Vertically 32768 SR Obj Flag Repeat Horizontally 65536 SR Obj Flag Replace Row If Empty Selected Determines if the object will be selected after it appears on the report 0 Object is not selected 1 Object is selected TableNo Object table number This parameter is only used when the ObjType is SR Object Type Field FieldNo Object field number This parameter is only used when the ObjType is SR Object Type Field Var ype Object variable type This parameter is only used when the ObjType is SR Object Type Variable You may choose one of the following variable types 1 SR Variable Type Variable 2 SR Variable Type Array Auto 3 SR Variable Type Array Element ArrrayElem Desired array element when the ObjType is SR Object Type Variable and the VarT pe is SR Variable Type Array Element SuperReport Pro Page 175 of 226 CalcType Desired calculation option This parameter is only used when the ObjType is SR Object Type Field or SR Object Type Variable You may choose one of the following values 0 SR Calculation Type None 1 SR Calculation Type Total 2 SR Calculation Type Min 3 SR Calculation Type Average 4 SR Calculation Type Max Cal Name Name of the variable to store calculation This parameter is only used when the Options is SR Obj Flag Record Calc Value
57. 9 Save your report we have done a lot of work Step 10 Open the record we just created and select Print Report or Print Preview menu item from the File menu to see our report Your report should look something like this we selected Print Preview SuperReport Pro Page 1 Processed 19 of 19 Items r Invoice Sales Report ong Aice Na Date Tota Pamet Tems ooo004 Fri Jan 1 1999 2 700 00 Within 30 Days Total for Penod GOG 2 700 00 donne Na Date Tote Pamet Jens 000005 Wed Feb 1 1995 1 723 68 Within 30 Days ooo009 Sun Feb 5 1995 4 772 52 Within 30 Days Total tor Perad GSR 6 496 20 drmvice Me Date fate Pamet Jens 000010 Sat Jan 30 1999 2 921 11 Within 4 Days Total for Perad GGG 2 921 11 device Me Pate Fate Pamet Ferns 000011 Fri Mar 3 1995 1 240 92 Within 30 Days Figure 30 SuperReport Preview Sample Page 58 of 226 Creating an HTML Report SuperReport Pro enables users and developers the ability to include HTML tags in report objects which will be utilized when printing a report using SR Print HTML or by selecting HTML option when selecting Print To Disk from within the Report Editor Each object may contain a standard tag which is sent before the actual data of the object and an end tag which is sent after the object data Furthermore when reports are printed in HTML format all font attributes are retained and the corresponding font tags ate sent automatically when the report is created The foll
58. All structure customization must be called before calling SR Set Area otherwise SuperReport Pro will not function correctly Enter the following code ARRAY STRING 63 aSR_Structure 6 aSR_Structure 1 1 3 0 Customers aSR_Structure 2 1 3 0 add all of Customer file aSR_Structure 3 2 4 0 Invoice aSR_Structure 4 2 4 0 add all of Invoice file aSR_Structure 5 3 5 0 Item aSR_Structure 6 3 5 0 add all of Item file result SR Structure eReportArea aSR_Structure SuperReport Pro Page 21 of 226 Customizing User Access Variables Like the SuperReport Pro structure system you can also customize the SuperReport Pro variables by calling the SR Variables routine If you don t call SR Variables no variables will be available and the variable popup item will be disabled For more details on using SR Variables please refer to Chapter 6 Command Reference In your report forms On Load event add the following code All variable configuration must be called before calling SR Set Area otherwise SuperReport Pro will not function correctly Enter the following code ARRAY STRING 63 aSR_Variables 5 aSR_Variables 1 1 Report Variables aSR_Variables 2 1 Report Date SRDate 1 aSR_Variables 3 1 Report Time SRTime 1 aSR_Variables 4 1 Page Number SRPage 1 aSR_Variables 5 1 Record Number SRRecord 1 iSR_Err SR Variables eReportArea aVars When the SuperReport Pro editor i
59. Area Figure 9 Object Properties Palette using SuperReport area SuperReport Pro Page 35 of 226 Step 4 Step 5 Step 6 Assign a name to your variable which will be used by the related SuperReport Pro command to reference your report area If you define the name of the report area which is the same name followed by an underscore of a field which is in the table which contains the form you have created SuperReport Pro will automatically load and save the report when the record is loaded For example if you have a field entitled Reports ReportData_ when creating the SuperReport Pro area using a name of ReportData will instruct SuperReport Pro to automatically load save the report when the record is loaded and the form is displayed Tf you are using the auto save feature of SuperReport Pro you may proceed to Step 7 If you are not using a report table you will need to procedurally load save the reports using the appropriate SuperReport Pro routines Step 5 and Step 6 The next step is to create the report data so that your users can access it The first If test determines if we are access an existing record If so we load the data from the saved report record we ll cover how to save report data in a bit otherwise we create a new report using the SR New Report command C_BLOB pSR_Report used by SR Get Area and SR New Report C_LONGINT iSR_Err Case of Form event On Load If Record number Report_M
60. C_LONGINT 1 area C_LONGINT 2 event type C_LONGINT 3 addtl info reserved C_LONGINT iSR_Event event type C_TEXT eventTxt eventTxt iSR_Event 2 Case of SR_Event SR Zoom Area eventTxt Area Zoomed SR_Event SR UnZoom Area eventTxt Zoomed Area collapsed SR_Event SR Zoom Area to Back eventTxt Zoomed Window brought to front SR_Event SR Orig Area to Back eventTxt Original Windows brought to front SR_Event SR Area Closing eventTxt SuperReport Pro area closing SR_Event SR Editor Mode eventTxt Switching to Preview mode SR_Event SR Preview Mode eventTxt Switching to Editor mode SR_Event SR Preview First Page eventTxt Preview Button First Page SR_Event SR Preview Previous Page eventTxt Preview Button Previous Page SR_Event SR Preview Next Page eventTxt Preview Button Next Page SR_Event SR Preview Last Page eventTxt Preview Button Last Page SR_Event SR Preview Print Page eventTxt Preview Button Print One Page SR_Event SR Close Preview eventTxt Preview Button Close Preview SR_Event SR Menu Item Selected Before eventTxt Menu Item Selected Before SR_Event SR Menu Item Selected After eventTxt Menu Item Selected After End case ALERT eventTxt SuperReport Pro Page 134 of 226 SC Button script of Command invisible button DC
61. Code C_LONGINT Result Code SR Print Report allows you to print a SuperReport Pro report without requiring a SuperReport Pro area Report Object A valid SuperReport Pro Object This is not the actual SuperReport Pro area but rather the report object as it would be stored in a 4 Dimension BLOB field or variable Print Options Print options flags You can pass the sum of the values you wish to execute using the following table 0 Default options don t do anything special 1 SR Print Option Validate Validate Page Setup 2 SR Print Option Job Dialog Show Job Setup 4 SR Print Option No Progress Don t display progress bar If the Page Setup is not correct for your chosen printer and you specify to check the Page Setup using the option parameter then the Page Setup dialog will be displayed If the user cancels either the Page Setup or Job Setup dialogs then the report will not be printed Section Flag The sections parameter is used to control which sections of the report ate printed assuming that you have not specified the Body section only using the options parameter To print specific sections pass the sum of the section numbers that you require which are listed in the Chapter 7 SuperReport Pro Codes Section Codes You may choose one or more of the following 0 SR All Sections 1 SR Section Header Mask 2 SR Section SubHeader1 Mask 4 SR Section SubHeader2 Mask 8 SR Section SubHe
62. Definition dialog and click the Script tab Enter the following text the click the OK button to accept the script vTotalTxt Total for Period Invoice Period SRPro Section Properties HTML Data Section Bo Total for Period Invoice Period Select Table or Field Select Custom Variable Select Custom Command D E Report D 4D En b E Invoice D Arrays b E item gt BLOB D Boolean D Clipboard gt Communications Figure 27 SuperReport Pro Section Dialog Next we need to configure the SubHeader 1 section so that our break processing occurs correctly SuperReport Pro calculates the breaks in a report based on one of three items The value of a field for a given file e The value of a variable The value of an array element In our example we are going to use the value of a field the Invoice Period field SuperReport Pro Page 55 of 226 Step 6 Double click on the SubHeader 1 section to display the Section Definition dialog You will notice the Only use this Section on Value Change Of item is enabled page 1 e Select Only use this Section on Value Change Of e Select Field from the Object popup menu e Select Invoice Period from the field popup menu SRPro Section Properties Section Body X Use This Section On The First Page Only Only Use This Section After The First Page Only Use This Section On Yale Changes Of Obpet Field s3
63. FONT STYLE Font Justification Object font justification You may use one of the following values 1 Left 2 Center 3 Right Format String Object format string This format string is used when printing as the display format The format string can only be set on valid objects ObjectID greater than zero and will be ignored if you are setting the default attributes ObjectID 1 and a result value of 8007 will be returned ForeRed Object foreground color Red You can also use the ForeCo or parameter which returns the foreground color in 4Ds style of expressing RGB colors ForeGreen Object foreground color Green You can also use the ForeColor parameter which returns the foreground color in 4Ds style of expressing RGB colors ForeBlue Object foreground color Blue You can also use the ForeCo or parameter which returns the foreground color in 4Ds style of expressing RGB colors BackRed Object background color Red You can also use the BackColor parameter which returns the foreground color in 4Ds style of expressing RGB colors BackGreen Object background color Green You can also use the BackColor parameter which returns the foreground color in 4Ds style of expressing RGB colors BackBlue Object background color Blue You can also use the BackColor parameter which returns the foreground color in 4Ds style of expressing RGB colors SuperReport Pro Page 191 of 226 ForePatter
64. Fields As List BLOB SR Get Fields As List BLOB treportArea L tableNo L options L resultData O gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report Area MenuID C_LONGINT MenuID Options C_LONGINT Options Result Data C_BLOB Command List BLOB gt ResultCode C_LONGINT Format Number SR Get Fields As List BLOB builds a 4t Dimension hierarchical list BLOB using the fields for a given table see SR Structure Item Reference for each item is as follows e itemRef in each list item is the field number This routine is used internally by the SuperReport Pro dialogs and may be used when creating customized report interface For more information on creating customized report interface please refer to Chapter 6 Command Reference Object Properties ReportArea The desired SuperReport Pro area MenuID Desired menu number whose field information you wish to retrieve Options Options for building table lists You may choose one of the following values 0 SR Structure Physical Use physical structure area is ignored 1 SR Structure Virtual Use virtual structure area is ignored 2 SR Structure Area Structure Use structure set by SR Structure If not set SR Structure Physical SR Structure Virtual are checked 4 SR Structure Get Invisible Include invisible tables 8 SR Structure Get Empty Tables Include empty tables not fields or indexed fields 16 SR Structure So
65. GINT Object Position Left RectBottom C_LONGINT Object Position Bottom RectRight C_LONGINT Object Position Right ObjType C_LONGINT Object Type Options C_LONGINT Object Options Selected C_LONGINT Object Selected TableNo C_LONGINT Object Table Number FieldNo C_LONGINT Object Field Number VarType C_LONGINT Object Variable Type ArrayElem C_LONGINT Array Element CalcType C_LONGINT Object Cale Type CalcName C_STRING or C_TEXT Object Calc Name Rows C_LONGINT Object Rows Cols C_LONGINT Object Cols RepeatHOffset C_LONGINT Object Horizontal Repeat Offset RepeatV Offset C_LONGINT Object Vertical Repeat Offset gt ResultCode C_LONGINT New Item ID or Error Code SR Create Object provides the ability to procedurally create new objects You can create any type of report object supported by SuperReport Pro and may define all elements including object position calculation options etc ReportArea The desired SuperReport Pro area Object Name Desired object name If you are creating an object which provides static information i e a static text object or variable you can supply the information in the Object Name parameter RectT op Object Position Top The object position is relative to the upper left corner of the report area RectLeft Object Position Left The object position is relative to the upper left corner of the report area RectBottom Object Position Bottom The object position is
66. GINT Options gt ResultCode C_LONGINT Format Number SR Get Field List builds an array of report field names and field numbers as well as field types and field attributes see SR Structure for more information ReportArea The desired SuperReport Pro area MenuID Desired menu number whose field information you wish to retrieve Fieldname Array A valid 4 Dimension string array which will receive the list of field names for the defined report area Fieldnumber Array A valid 4 Dimension integer or longint array which will receive the list of field numbers for the defined report area Note Fieldnumber array is always filled with physical 4D table number Field Types Array A valid 4 Dimension integer or longint array which will receive the list of field types for the defined report area Field Attributes Array A valid 4 Dimension integer or longint array which will receive the list of field attributes for the defined report area For more information on the field attributes please refer to the 4t Dimension Language Reference GET FIELD PROPERTIES command Options Options for building table lists You may choose one of the following values O0 SR Structure Physical Use physical structure area is ignored 1 SR Structure Virtual Use virtual structure area is ignored 2 SR Structure Area Structure Use structure set by SR Structure If not set SR Structure Physical SR Structure
67. L varName S gt varType L Parameter Data Type ReportArea C_LONGINT VariableName C_STRING gt ResultCode C_LONGINT Description Report plug in area Variable Name Result Code SR Get Variable Type will return the variable type of a given variable name The value returned by this routine is identical to that of the 4D command Type with the exception of C_LPICTURE variables which will return a value of 10 This routine is used internally by the SuperReport Pro dialogs and may be used when creating customized report interface For more information on creating customized report interface please refer to Chapter 6 Command Reference Object Properties ReportArea The desired SuperReport Pro area VarName Desired report variable name gt VarType Returns the variable type for the desired variable See Also SR Variables SuperReport Pro Page 125 of 226 SR Get Virtual Variable SR Get Virtual Variable reportArea L varID L varName S varElement L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area VarID C_LONGINT Variable ID VarName C_STRING Variable Name VarElement C_LONGINT Variable Element gt ResultCode C_LONGINT Result Code SR Get Virtual Variable returns the variable name and variable element associated to an alias variable name created by SR Variables This routine is used internally by the SuperReport Pro dialogs and may be used when creat
68. Modified v2 9 SR Register registrationKey S gt resultCode L Parameter Data Type Description registrationKey C_STRING 80 Registration Code gt resultCode C_LONGINT Result Code SR Register is used to register the SuperReport Pro plug in for standalone or server use You must call SR Register with a valid registration key otherwise SuperReport Pro will operate in demonstration mode Without a valid registration key SuperReport Pro will operate in demonstration mode during 20 minutes SuperReport Pro Welcome to the demonstration version of SuperReport Pro The plugin will be fully functional for 20 minutes www e node net SRP Your 4D serial number is 448562807 Grok Figure 45 SuperReport Pro Demonstration mode Box Like all e Node plug ins SuperReport Pro offers six different license types There ate no such things as MacOS vs Windows or Development vs Deployment Single user license This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Standalone or Runtime Since the registration key is linked to a specific 4D license you need to provide the number returned by the 4D command GET SERIAL INFORMATION first parameter A new license will be supplied for free at any time if you change your 4D version and or get a new 4D registration key provided that your previous licenses match the current public version at the exchange time Small server This license allows dev
69. Name gt wi Page Breaking Options a Keep Whole Section On Same Page Place This Section On The Current Page Start 4 New Page Before Starting This Section Start 4 New Page After Comp eting This Section Start 4 New Page If Available Space E Less Than 0 000 Inch f Cancel i f OK i Tou Figure 28 SuperReport Pro Subheader Dialog Step 7 The next step to making our making our break processing report work correctly is to establish a selection of records and define a sort order If you don t sort your selection SuperReport Pro will not be able to correctly calculate the break thus your report will not appear as you would expect SuperReport Pro Page 56 of 226 Step 8 Select Start Script from the Scripts submenu located in the Database menu The SuperReport Pro Script Editor will be displayed Well be providing more detail about SuperReport Pro scripts in the next section Enter the following code ALL RECORDS Invoice print the selection of invoice records ORDER BY Invoice Invoice Number gt SRPro Script Editor H Report Start Script ALL RECORDS Invoice ORDER BYC Invoice Invoice Number gt Select Table or Field Select Custom Variable gt E invoice gt Arrays gt E tem gt BLOB gt Boolean gt Clipboard gt Communications Figure 29 SuperReport Start Script Dialog SuperReport Pro Page 57 of 226 Step
70. Object Properties SuperReport Pro Page 194 of 226 SR Set Object Data SR Set Object Data reportArea L objectID L staticPICT P staticText T gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Object ID C_LONGINT Report section ID StaticPICT C_PICTURE Object Static PICT StaticText C_TEXT Object Static TEXT gt ResultCode C_LONGINT Result Code SR Set Object Data will set the static object information SR Object Type PICT or SR Object Type Text When used with SR Set Object Properties SR Set Object Format and SR Set Object Scripts you can obtain all information about a given object ReportArea The desired SuperReport Pro area Object ID Desired ObjectID You can use the object support routines SR Get Object IDs SR Get Object Properties etc to obtain detailed information about each report object Static PICT A valid 4t Dimension variable containing the PICT information you wish to assign to a static PICT object SR Object Type PICT Static Text Desired text you wish to assignt to a static text object SR Object Type Text or HTML data you wish to assign to a PICT object SR Object Type PICT gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below See Also S
71. Pro Page 126 of 226 SR Get Indexed String SR Get Indexed String resID L resIndex L gt indexedString S Parameter Data Type ResID C_LONGINT ResIndex C_LONGINT gt ResultCode C_STRING Description STR ResourceID STR ResourceIndex Indexed String SR Get Indexed String is identical to the 4 Dimension command Get Indexed String except that it will always use the SuperReport Pro resource file when querying the STR list ResID Desired STR resID must exist in SuperReport Pro resource file ResIndex Desired STR resIndex must exist in SuperReport Pro resource file gt IndexedString Returns the associated value contained in the STR resource resID resIndex Example The following example will return the translation text contained in STR resID 15003 index 32 ret SR Get Indexed String 15003 32 returns At Left Hand Side of Page SuperReport Pro Page 127 of 226 SR Is Modified SR Is Modified reportArea L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area gt ResultCode C_LONGINT Result Code SR Is Modified will return the modified status for the defined SuperReport Pro area If you wish to procedurally set the modified state for a given SuperReport Pro area execute the SR Set Modify routine ReportArea The desired SuperReport Pro area gt Result Code Modified flag for defined SuperReport Pro area 0 Report ar
72. R PowerMenu menulD parameter SR PowerMenu menulD parameter SR PowerMenu menulD parameter SR PowerMenu menulD parameter SR PowerMenu menulD parameter SR PowerMenu menulD parameter SR PowerMenu menulD parameter SR PowerMenu menulD parameter SR PowerMenu menulD parameter SR PowerMenu menulD parameter Page 222 of 226 SuperReport Pro SR Position At End SR Position Forward SR Position Backward SR All Objects SR Selected Objects Page 223 of 226 8 Hints amp Tips While SuperReport Pro has been designed to be an easy to use tool the use of 4th Dimension library objects and plug in routines can sometimes lead to questions that even the most seasoned 4D programmer can run into a wall This chapter lists some of the most commonly asked questions when using SuperReport Pro SuperReport Pro Page 224 of 226 Troubleshooting This chapter lists commonly asked questions when using SuperReport Pro Q A Can I use SuperReport Pro in the User Environment Yes SuperReport Pro can be used on any valid input form either in the User Environment or a custom method which calls MODIFY SELECTION However SuperReport Pro does not work with the Plug In menu item system 4D users to display various plug in editors How do I set the main table for a new or existing report that is displayed in the Report Editor You can use the SR Main Table2 routine which will work with a report area SR Main Table works on t
73. R Set Object Scripts SR Get Object Data SR Set Object Format SR Set Object Properties SuperReport Pro Page 195 of 226 SR Get Guides SR Get Guides reportArea L horCoordinates X vertCoordinates X gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Horz Coordinates ARRAY INTEGER or LONGINT Array of horizontal coordinates Vert Coordinates ARRAY INTEGER or LONGINT Array of vertical coordinates gt ResultCode C_LONGINT Result Code SR Get Guides builds a 4t Dimension array containing the horizontal and vertical coordinates for all report guides ReportArea The desired SuperReport Pro area Horizontal Coordinates A valid 4 Dimension array which will receive a list of vertical positions for all horizontal guides Vertical Coordinates A valid 4 Dimension array which will receive a list of horizontal positions for all vertical guides gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will build arrays of horizontal and vertical coordinates for the report guides ARRAY INTEGER aiSR_HGuides 0 ARRAY INTEGER aiSR_VGuides 0 SR_Err SR Get Guides SR_AREA aiSR_HGuides aiSR_VGuides See Also SR Set Guides SuperReport Pro Page 196 of 226 SR S
74. R_ HTMLEnd See Also SR Get Sections SR Set Section Properties SR Set Section Scripts SuperReport Pro Page 208 of 226 SR Set Section Scripts SR Set Section Scripts reportArea L sectionID L sectionScript T htmlPre T htmlPost T gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Section ID C_LONGINT Report section ID Section Script C_TEXT Section Script Section HTML Start C_TEXT HTML Start Block Section HTML End C_TEXT HTML End Block gt ResultCode C_LONGINT Result Code SR Set Section Scripts will set the section script and HTML information for the defined section ReportArea The desired SuperReport Pro area Section ID A valid SuperReport Pro section i e SR Section Body or SR Section Header For a complete list of sections please refer to Chapter 7 SuperReport Pro Codes Section Codes Section Script Desired section script for the defined section Section HTML Start Desired HTML start block for the defined section Section HTML End Desired HTML end block for the defined section gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will set the section script and HTML data C_TEXT tSR_Script tSR_HTMLStart tSR_ HTMLEnd
75. Report Pro area ShowReportMenu A valid 4 Dimension variable which will receive the setting of the Database menu 0 SR Generic Option Set Off Don t display Database menu bar 1 SR Generic Option Set On Display Database menu bar default value EnableScriptAccess A valid 4 Dimension variable which will receive the Script access status Script access controls all places where script access is available 0 SR Generic Option Set Off Disable access to report scripts 1 SR Generic Option Set On enable access to report scripts Miscellaneous Options A valid 4 Dimension variable which will receive the bitwise value of the miscellaneous options 0 SR Generic Option Set Off No miscellaneous options default value 1 SR Options Hide Zoom Hide Zoom box and disable Zoom Window menu item 2 SR Options Basic Interface Use basic Select Main table dialog 4 SR Options Hide HTML Disable HTML access HTML button will be removed from appropriate dialogs 8 SR Options Use Std Guides Use standard guides when draw report area red blue etc 32 SR Options Hide Menubar Hide Menubar 64 SR Options Hide Toolbar Hide Toolbar 128 SR Options Hide Hor Scrollbar Hide Horizontal Scrollbar 256 SR Options Hide Vert Scrollbar Hide Vertical Scrollbar Zoomed Title A valid 4 Dimension variable which will receive the custom
76. ReportArea area overwriting any existing report information Case of Form event On Load iSR_Err SR Set Area eReportArea ReportMgr ReportData If iSR_Err 0 ALERT An error occurred loading report data End if End case See Also SR Get Area SuperReport Pro Page 79 of 226 SR Doc 2 Report SR Doc 2 Report teportDiskFile S resultBlobObject P gt resultCode L Parameter Data Type Description ReportDiskFile C_STRING 255 Report Disk Filename resultBlobObject C_BLOB Result BLOB object gt ResultCode C_LONGINT Result Code SR Doc 2 Report will load a document saved on disk and copy it to a 4 Dimension BLOB variable You must use either a process or inter process variable using a 4 Dimension field will not return the information correctly This command can be used to load a report without using the SuperReport Pro plug in area ReportDiskFile The full pathname to a valid SuperReport Pro report document previously saved to disk using either the SuperReport Pro Editor or via the SR Save Report routine BlobObyect A valid 4 Dimension variable which will receive the desired report information gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will load a SuperReport Pro do
77. SR Print HTML command or by selecting Print To Disk from the File menu selecting the Output As HTML option in the Output Options section When printing to disk using HTML output remember to select the Static Text items and all sections otherwise your HTML data will be incomplete SRPro Print To Disk Options Print Report To Disk Options m Sections To Be Printed All Sections Print Static Text Items Q Body Section Only m Output Options Output as HTML File Output as Standard Text Field amp Record Section Delimiters Between Fields 3 ASCII Value End Of Record 13 ASCII Value C a Figure 37 SuperReport Pro HTML Print SuperReport Pro Page 66 of 226 Printing Arrays While SuperReport Pro provides an extensive feature set for printing 4 Dimension database fields we didn t stop there SuperReport Pro can also print 4 Dimension arrays whether it be a full array all elements in the array or a specific array element SuperReport Pro can handle it The following tutorial will teach you how to create a SuperReport Pro report for printing a group of arrays In addition we ll discuss how to configure the Report Table Iterations dialog to use the array size instead of the number of records in a selection as we have in previous examples Using the Customer Listing report we created in the first example as a template perform the following tasks
78. Set Tool SR_AREA SR Tool Arrow End if See Also SR Set Tool SuperReport Pro Page 210 of 226 SR Set Tool SR Set Tool reportArea L currentTool L gt result L Parameter Data Type ReportArea C_LONGINT Current Tool C_LONGINT gt ResultCode C_LONGINT SR Get Tool will return the current editor tool ReportArea The desired SuperReport Pro area Description Report plug in area Report tool Result Code Tool Desired tool you wish to set as current tool in SuperReport Pro editor 0 SR Tool Arrow 1 SR Tool Text 2 SR Tool Field 3 SR Tool Variable 4 SR Tool Line 5 SR Tool Rectangle 6 SR Tool Circle gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example See example outlined in SR Get Tool See Also SR Get Tool SuperReport Pro Page 211 of 226 7 SuperReport Pro Codes The following chapter outlines all the SuperReport Pro Return Error and Menu Codes Each SuperReport Pro command will return a result typically an error code For more information about the various result codes please refer to the individual commands outlined in the Command Reference SuperReport Pro Page 212 of 226 File Manager Error Codes One of the following error codes
79. SuperReport Pro User Manual France http www e node net Copyright and Trademarks All trade names referenced in this document are the trademark or registered trademark of their respective holder SuperReport Pro is copyright Automated Solutions Group 4th Dimension 4D Compiler 4D 4D Server 4D Client and 4D Insider are trademarks of 4D SAS Windows is a trademark of Microsoft Corporation Macintosh MacOS and MacOS X are trademarks of Apple Inc SuperReport Pro Page 2 of 226 Table of Contents Chapter 1 Chapter 2 SuperReport Pro Copyright GNA TrACEMAIKS ccceessccesssceceecseecececsseececeeseeeeeeseseeeeeeeaes 2 TAbISOFC ONTENTS 12562 dict trie Races a E stint 3 Preface ninae e a ted i aes ea elise aa A doed agi dod te 8 ABOUT this MANUA aereas ir a debe aa a nia coded 8 Acknowledgments eesssssssesrsererenessssesercoeseeesssrerressceessesestetceeessrsiseeeeret 8 Introduction AbDOUT SUPEFREPOTT PIO aaea i a E Aa A E E Eaa 9 SuperReport Pro Features sesssesereereerereeeerererererererersesesesesesesesessseseseseseo 9 What s New in SuperReport Pro 2 9 e eesesssssssessserssssssseserrerssssesserererses 10 What s New in SuperReport Pro 2 8 esssssssseesserssssssseserererssssesserererses 11 System Requirements ssssessseesereesssserrrerressssseserereeesesseserrerereesssseseee 12 Ai DIMNENSION ts scores teere AR EE EEan EE ERE RETES 12 System SORWOPLC ae a E Bue Bu as ee 12 Technical SUpport
80. SuperReport Pro documents created using SR Save Report iSR_Err SR File Types 1 1 SRPD change the default Creator code to SRPD The following routine will get the current Creator code C_STRING 4 sSR_Creator iSR_Err SR File Types 1 1 sSR_Creator get the creator code SuperReport Pro Page 112 of 226 SR Get Format Number SR Get Format Number formatString S fieldType L gt resultCode L Parameter Data Type Description FPormatString C_STRING Format String FieldType C_LONGINT Field Type gt ResultCode C_LONGINT Format Number SR Get Format Number converts a format string to the internal format number This routine is used internally by the SuperReport Pro dialogs and may be used when creating customized report interface For more information on creating customized report interface please refer to Chapter 6 Command Reference Object Properties Format String Desired format string you wish to convert to the internal format number if it exists FieldType Desired 4D field type of the associated field which contains the format string For a complete list of fieldTypes please refer to the 4t Dimension Language Reference Type or GET FIELD PROPERTIES commands You may choose from one of the following values 4 Is Date 11 Is Time 3 Is Picture gt Result Code If the format filter was found it s associated format number will be returned otherwise a value of zero 0 will be returned If
81. TML Document PrintOption C_LONGINT Print Options SectionFlag C_LONGINT Print Section Flags Object Order C_LONGINT Print Object Order gt ResultCode C_LONGINT Result Code SR Print HTML allows you to print the defined SuperReport Pro report in HTML format All HTML tags defined using HTML dialog for the various report objects will be used All font attribute settings will be used based on their definition in the report unless a lt FONT gt tag has been supplied Report Object A valid SuperReport Pro Object This is not the actual SuperReport Pro area but rather the report object as it would be stored in a 4t Dimension BLOB field or variable Document Name Full pathname or local pathname of the HTML document you wish to create If you pass a null string the standard Save File dialog will be displayed If you want to specify a default value and allow the user to determine where the file will be saved pass a value as the Document Name and use pass a value of one to the Print Options parameter Print Options Print options flags You can pass the sum of the values you wish to execute using the following table 0 Default options don t do anything special 1 SR PrintToDisk File Dialog Display Save File dialog regardless of Document Name 2 SR PrintToDisk Body Only Print Body section only regardless of sectionFlag 4 SR PrintToDisk Static Text Print Static text items Section Flag The secti
82. Table gt Item asTableName 1 Table name gt Customer asTableName 2 Table name gt Invoice asTableName 3 Table name gt Item SET TABLE TITLES asTableName aiTableNo SRPro Main Table Iterations sekcted Report Tabk E Customer E hwice E tem Fixed Number Of terations Yale a Use Vane In Variable Name Use Size OF Array Name AA tt ARR AD f Cancel OK k i EAIC S 5 Figure 2 SuperReport Pro Table Selection Dialog SRPro Field Object Properties a x Options Li crpt V H Mot Sekot Tab k Sekot Feld E Customer Active E hwice Address E Item Code Fax Loge Name Telephone 2 Tumover Display Format g Cancel X f OK gt vaniassocenemane O Figure 3 SuperReport Pro Field Selection Dialog SuperReport Pro Page 20 of 226 Using SR Structure Another option of display a customized structure is to use the SuperReport Pro command SR Structure This routine has existed since the first release of SuperReport Pro and is left for backwards compatibility with applications which already have SuperReport Pro installed If you don t call SR Structure with the custom file structure SuperReport Pro will display the default file selection typically all visible tables and fields For more details on using SR Structure please refer to Chapter 6 Command Reference In your report forms On Load event add the following code
83. Virtual are checked 4 SR Structure Get Invisible Include invisible tables 8 SR Structure Get Empty Tables Include empty tables not fields or indexed fields 16 SR Structure Sort By Name Sort result array by name 256 SR Structure Mark Indexed Returns marked indexed attribute 512 SR Structure Mark Invisible Returns marked invisible attribute gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 115 of 226 Example The following example will fill four 4D arrays with the field information for the defined report area ARRAY STRING 32 asSR_Fieldnames 0 ARRAY LONGINT aiSR_Fieldnumbers 0 ARRAY LONGINT aiSR_FieldTypes 0 ARRAY LONGINT aiSR_FieldAttributes 0 SR_Err SR Get Field List eReport 3 asSR_ Fieldnames aiSR_Fieldnumbers aiSR_FieldTypes aiSR_FieldAttributes SR Structure Area Structure See Also SR Get Table List SR Get Fields As List BLOB SR Get Tables As List BLOB SR Get Structure As List BLOB SR Structure SuperReport Pro Page 116 of 226 SR Get Commands As List BLOB SR Get Commands As List BLOB reportArea L options L resultData O excludeThemeList X excludeCommandList X gt resultCode L Parameter Data Type Description ReportArea
84. a SuperReport Pro plug in area the script of this button will execute whenever a SuperReport Pro event occurs The postKey parameter is an integer value corresponding to the ASCII character value of the key to be posted SuperReport Pro automatically posts the key event as a Command Key on Macintosh or Control Key on Windows To switch off this capability pass a value of 0 as the postKey parameter The postKey event is posted after your callback procedure is executed This allows you to determine the event type in your callback procedure set up process or interprocess variables and then take action in the button script as a result of the posted command key event gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 132 of 226 Callback Event Codes 11 SR Zoom Area Area zoomed Parameter 3 contains area reference for zoomed window 12 SR UnZoom Area Zoomed window collapsed un zoomed 13 SR Zoom Area to Back Content of the zoomed window was copied back to form area 14 SR Orig Area to Back Content of form area was copied to zoomed window 15 SR Area Closing Editor window has been closed either report area on form or external window 20 SR Editor Mode Switched from Editor mode t
85. ader3 Mask 16 SR Section SubHeader4 Mask 32 SR Section SubHeader5 Mask 64 SR Section SubHeader6 Mask 128 SR Section Body Mask 256 SR Section SubTotal6 Mask 512 SR Section SubTotal5 Mask 1024 SR Section SubTotal4 Mask 2048 SR Section SubTotal3 Mask 4096 SR Section SubTotal2 Mask 8192 SR Section SubTotall Mask 16384 SR Section Total Mask 32768 SR Section Footer Mask gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example SuperReport Pro Page 156 of 226 The following example will print the report stored in the users database printing only the body section C_LONGINT iSR_Result options section ARRAY PICTURE apSR_Report 0 options 1 2 valid Page Setup show Job Setup dialog section 128 body section only iSR_Result SR Print Report ReportMgr ReportData options section See Also SR Page Setup SR Preview SR Print Disk SR Print HTML SR Print To BLOB SR Print PICT SuperReport Pro Page 157 of 226 SR Print HTML SR Print HTML reportObject P documentName S options L sectionFlag L objectOrder L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area DocumentName C_STRING 32 Name of H
86. age 190 of 226 Action Desired property you wish to set If you are setting multiple attributes you should pass the accumulative total of all action codes You may choose one or mote of the following selectors If you are setting all attributes you can use the SR Property All selector Property Name 1 SR Property All 1 SR Attribute Font Name 2 SR Attribute Fore Color 4 SR Attribute Back Color 8 SR Attribute Font Size 16 SR Attribute Font Style 32 SR Attribute Fore Pattern 64 SR Attribute Back Pattern 128 SR Attribute Justification 256 SR Attribute Line Thickness 512 SR Attribute Format 1024 SR Attribute 4D Fore Color 2048 SR Attribute 4D Back Color 4096 SR Attribute No Adjust Font Name Desired object font name Description Set all object properties Set the font name Set the foreground color using ForeRed ForeGreen ForeBlue Set the background color using BackRed BackGreen BackBlue Set the font size Set the font style Set the foreground pattern Set the background pattern Set the justification Set the line thickness Set the object format string Set foreground color using ForeColor Set background color using BackColor Don t adjust bounding boxes for fields variables etc Font Size Desired objects font size 1 144 Font Style Object font style Uses Macintosh style of style attributes Use 4D constants see
87. alues bold italic items are on by default 0 SR Structure Physical Original SuperReport Pro 2 0 x method 1 SR Structure Virtual Use 4Ds Virtual Structure settings otherwise structure values will be used 4 SR Structure Get Invisible Allow use of invisible tables and fields 16 SR Structure Get Indexed Only Only use indexed tables fields 32 SR Structure Get Empty Tables Include tables which contain zero fields in list otherwise omitted 64 SR Structure Sort By Name Sort the tables and fields in alphabetical order 128 SR Structure No MenulD Used when creating a custom structure for Table list SRP ignores menuID 256 SR Structure Mark Indexed When structure is displayed indexed columns will be bold 512 SR Structure Mark Invisible When structure is displayed invisible fields will be talc gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Examples This following example will produce a hierarchical menu with 2 sub menus one for the Supplier table and the second with two fields from the Customer table C_BLOB pReportData Case of Form event On Load ARRAY STRING 64 aSR_Structure 5 aSR_Structure 1 1 1 0 Suppliers name menu 1 Suppliers t
88. and field access using SR Structure e Customize the variable list using SR Variables e Customize the command list using SR Commands Customize the SR Pro standard variable using SR Std Vars e Customize the appearance of the Report Editor using SR Options Customize the menu system using SR Menu Item Customizing File Structure Perhaps one of the most commonly used routines in SuperReport Pro is the SR Structure command Using this routine you can customize the file structure so that only those tables and fields you wish to provide your users access will be display In addition you can also provide a table or field alias to better signify what the field contains without having to modify the actual 4th Dimension file structure Using 4Ds Virtual Structure SuperReport Pro supports customized structures which were created using 4t Dimension routines SET TABLE TITLES and or SET FIELD TITLES Unlike the SuperReport Pro routine SR Structure which must be called each time the report form is opened 4Ds Virtual Structure will remain active until another call to SET TABLE TITLES and or SET FIELD TITLES SuperReport Pro Page 19 of 226 The following example which customize the structure to only show the Customer Invoice and Item tables see similar example for SR Structure interface ARRAY LONGINT aiTableNo 3 ARRRAY STRING 32 asTableName 3 aiTableNo 1 Table gt Customer aiTableNo 2 Table gt Invoice aiTableNo 3
89. and will be an unsorted list Case of Form event On Load result SR Commands eReportArea SR Commands By Theme End case The following example will create the command list based on 4D commands sorting the list by Theme name and excluding compiler directives Case of Form event On Load ARRAY LONGINT aiSR_Theme 1 aiSR_Theme 1 7 Compiler opts SR Commands By Theme SR Sort First Level SR Sort Second Level result SR Commands eReportArea options aiSR_ Theme End case SuperReport Pro Page 99 of 226 The following example will build on the previous example and include a list of individual routines which should be omitted any delete record action from the command list The result list will be sorted by Theme name and each routine will be in alphabetical order within it respective theme Case of Form event On Load ARRAY LONGINT aiSR_Theme 1 aiSR_Theme 1 7 Compiler ARRAY LONGINT aiSR_Command 3 aiSR_Command 1 58 aiSR_Command 2 66 aiSR_Command 3 96 result SR Commands eReportArea SR Commands By Theme SR Commands By First Char aiSR_Theme aiSR_Command End case See Also SR Variables SR Structure SuperReport Pro Page 100 of 226 SR Pro Menus Each of the following routines provide the ability to customize the text and associated actions for each of the SuperReport Pro editor menus as well as the ability to procedurally execute any of the
90. area ArreaFormat The desired area format you wish to set for the defined report area You may use one of the following values 1 SR AreaFormat Physical Page 2 SR AreaFormat Printable Area AddjustOptions When changing the area format you may choose to perform automatic adjustments of the report objects You may choose one or more of the following values 1 SR SetAreaFormat Adjust Objects 2 SR SetAreaFormat Adjust Sects 4 SR SetAreaFormat Adjust Guides gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will return the report area format for a SuperReport Pro area adjustOpts SR SetAreaFormat Adjust Objects SR SetAreaFormat Adjust Sects SR SetAreaFormat Adjust Guides SR_Err SR Set Area Format SR_AREA SR AreaFormat Physical Page adjustOpts See Also SR Get Area Format SuperReport Pro Page 88 of 226 SR Options SR Options reportArea L showReportMenu L enableScriptAccess L miscReportOpts L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area ShowReportMenu C_LONGINT Show Database menu EnableScriptAccess C_LONGINT Enable access to Scripts button Miscellaneous Opts C_LONGINT Additional configurat
91. ariables In addition to entering static HTML tags in the HTML Dialog you can also imbed custom HTML tag variables which are actually 4 Dimension variables which may contain any valid HTML tag or group of tags For example if you have a set of HTML tags which you insert at the beginning of all your HTML files you could place all the HTML data into a 4 Dimension variable then reference the variable from with SuperReport Pro by using the custom variable tags To use a 4 Dimension variable within your HTML tags enclose the variable with lt and gt markers When the report is printed SuperReport Pro will take the data between these markers retrieve the data from the actual variable and insert it into the HTML stream as the file is created The following is an example 4t Dimension variable that is inserted using the variable tags tBegTagHTML lt html gt lt body bgcolor ffffff gt sample start file tag tEndTagHTML lt body gt lt html gt sample end file tag Understanding the SuperReport Pro Execution Cycle When creating HTML reports it is important that you understand the 4 Dimension execution cycle as this is how you will determine when specific tags should be include so that you can correctly create your HTML file For more information on the SuperReport Pro Execution Cycle please refer to the Understanding the SuperReport Pro Event Cycle earlier in this chapter SuperReport Pro Page 31 of 226 Printi
92. ase A SS SACS oor eee Header Figure 13 SuperReport Pro Default Sections e Header The header section is printed once for each page Typically you will display report tiles field titles etc in the Header section e Body The body section is the primary section used by SuperReport Pro This is where you will place the actual field or variable objects which you wish to have appear on your reports If you are creating a break processing report we cover this in a bit you can also place field or variable objects in the additional break sections e Total The total section is where you will place report totals If you are creating break processing reports you can also use the SubTotal sections to provide total information Footer The footer section is printed once for each page Typically you will display report date and time information or page numbers SuperReport Pro Page 40 of 226 Menu Overview SuperReport Pro provides a variety of menus and menu items which can be used to further customize your reports For the sake of the Tutorial section we ll introduce you to a few of the most commonly used menu items e Edit Modify Object also displayed when you double click on a report object This item will display the various object definition dialogs Depending on the type of object you have selected the corresponding dialog will be displayed Field Object Properties B Hoora Bove
93. at for isolating what tables and fields user can access e Developer API for customizing end user functionality e Enhanced Editor Customization SuperReport Pro Page 9 of 226 What s New in SuperReport Pro 2 9 e The storage of SuperReport Pro reports changes from picture to blob In 4D v11 and v12 it is no longer possible to use picture fields to store SuperReport Pro reports All SuperReport Pro calls accepting picture parameters are changed to blob parameters However it is not possible to just change the field type in 4D from picture to blob report stored in picture fields must be converted to blob fields with the new SuperReport Pro method SR Report To BLOB This command accepts a SuperReport Pro report in picture parameter and returns a blob SR Report To BLOB picture gt blob The older call SR SWAP HANDLES is deprecated and should not be used in 4D v11 and v12 It is recommended to use SR Report To BLOB in 4D 2004 before data conversion to convert SuperReport Pro reports from picture field to blob field However if the data file is already converted it is still possible to use the call to convert the reports and their scripts The recommended sequence is as follows 1 if there are SuperReport Pro reports stored in picture fields in 4D 2004 database create a blob field for each picture field 2 use call SR Report To BLOB to move reports from picture fields to blob fields in 4D 2004 3 convert the data to 4D v11 v12 4 in v11 v12
94. aticText C_TEXT Object Static TEXT gt ResultCode C_LONGINT Result Code SR Get Object Data will retrieve the static object information SR Object Type PICT or SR Object Type Text When used with SR Get Object Properties SR Get Object Format and SR Set Object Scripts you can obtain all information about a given object ReportArea The desired SuperReport Pro area Object ID Desired ObjectID You can use the object support routines SR Get Object IDs SR Get Object Properties etc to obtain detailed information about each report object Static PICT A valid 4 Dimension variable which will receive the static PICT data for a SR Object Type PICT Static Text A valid 4 Dimension variable which will receive the static TEXT data for a SR Object Type Text In addition if you have assigned HTML text to a PICT object the HTML information will be returned in this parameter as well gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will retrieve the static text or pict information C_TEXT tSR_TextData C_PICT pSR_PICTData SR_Err SR Get Object Data SR_AREA SR_ObjectID pSR_PICTData tSR_TextData See Also SR Get Object Scripts SR Set Object Data SR Get Object Format SR Get
95. ation as configured at the structure level SuperReport Pro Page 26 of 226 Understanding the SuperReport Pro Event Cycle Due the extensive reporting features offered by SuperReport Pro there is certainly some level of potential confusion for even the seasoned 4 Dimension programmer The following information outlines the standard SuperReport Pro Event Cycle SuperReport Pro generates reports in the following sequence in pseudo code Execute StartProcedure Determine how many iterations are required While Current Iteration lt Maximum Iterations do Execute BodyProcedure If Break Values have changed Process appropriate SubHeader sections Process appropriate SubTotal sections End if Process Body section End while Process Total section Execute EndProcedure Section Processing In processing any section the following sequence of events takes place Execute section script For i 1 to number of objects in this section do Execute object script Get object field variable array value End for SuperReport Pro Page 27 of 226 Dealing with multi platform Issues Fortunately SuperReport Pro does a good job of conditionally handling most multi platform issues However there ate some cases when some additional developer control is necessary to support multi platform issues e Dealing with platform pathnames Dealing with Print Drivers Dealing with platform pathnames All Macintosh files use a directory delimiter
96. available menu items as if the actual menu item was selected Routines included in this section are SR Do Command SR Menu Info SR Menu Item SuperReport Pro Page 101 of 226 SR Do Command SR Do Command reportArea L menultem L option L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area SRProMenu C_LONGINT Desired Menu Item Option C_LONGINT Menu execution option gt ResultCode C_LONGINT Result Code SR Do Command allows you procedurally execute any of the available menu items as if the user selected the menu item for the desired SuperReport Pro menu If the menu item is disabled this command will have no affect If a custom 4 Dimension method has been defined using SR Menu Item this method will be executed unless you pass a value of 1 using the Option parameter ReportArea The desired SuperReport Pro area SRProMenu The internal SuperReport Pro menu number which you wish to work with For a complete list of menu codes please refer to Chapter 7 SuperReport Pro Codes Menu Numbers Option Menu execution option 0 default action executes 4 Dimension method if it has been supplied using SR Menu Item otherwise default action will be executed 1 Execute SuperReport Pro default action regardless of override method assigned using SR Menu Item 0 SR DoCommand Use Custom Proc 1 SR DoCommand Ignore Custom Proc gt Result Code If the ro
97. bj Flag Grow Vertical 256 SR Obj Flag Variable Width 512 SR Obj Flag Variable Height 1024 SR Obj Flag Replace If Empty 2048 SR Obj Flag Use Calc Value 4096 SR Obj Flag Show Calc Value 8192 SR Obj Flag Repeating Object 16384 SR Obj Flag Repeat Vertically 32768 SR Obj Flag Repeat Horizontally 65536 SR Obj Flag Replace Row If Empty Order This is the value users seen when Show Object Order is selected when using the report editor It can be used to determine current object order starting at one Selected Determines if the object is current selected within the report area 0 Object is not selected 1 Object is selected TableNo Object table number This parameter is only used when the ObjType is SR Object Type Field FieldNo Object field number This parameter is only used when the ObjType is SR Object Type Field SuperReport Pro Page 182 of 226 Varlype Object variable type This parameter is only used when the ObjType is SR Object Type Variable You may choose one of the following variable types 1 SR Variable Type Variable 2 SR Variable Type Array Auto 3 SR Variable Type Array Element ArrayElem Desired array element when the ObjType is SR Object Type Variable and the VarType is SR Variable Type Array Element CalcType Desired calculation option This parameter is only used when the Ob
98. bject Script Desired object script Object HTML Start Desired object HTML start block Object HTML End Desired object HTML end block gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will set the object script and HTML data C_TEXT tSR_Script tSR_HTMLStart tSR_ HTMLEnd tSR_Script sPhone FormatPhone Customer Phone tSR_HTMLStart lt td gt tSR_HTMLEnd lt td gt SR_Err SR Set Object Scripts SR_AREA SR_ObjectID tSR_Script tSR_HTMLStart tSR_HTMLEnd See Also SR Get Object Scripts SR Set Object Data SR Set Object Format SR Set Object Properties SuperReport Pro Page 180 of 226 SR Get Object Properties SR Get Object Properties reportArea L objectID L objName S rectTop L rectLeft L rectBottom L rectRight L objType L options L order L selected L tableNo L fieldNo L varType L arrayElem L calcType L calcName S rows L cols L repeatHOffset L repeatVOffset L gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Object ID C_LONGINT Report section ID ObjName C_STRING or C_TEXT Object Name RectTop C_LONGINT Object Position Top RectLeft C_LONGINT Object Position Left RectBottom C_LONGINT Object Posi
99. bject bold SuperReport Pro Page 225 of 226 SR_SetFont objectID L fontName S fontSize L fontStyle L justification PM SR_SetFont objectiD L fontName S fontSize L fontStyle L justifcation L LM 05 22 02 mse 1 objectID 2 font name 3 font size 4 font style 5 font justification C_LONGINT 1 SR_OBJ C_TEXT 2 SR_FONTNAME C_LONGINT 3 SR_FONTSIZE C_LONGINT 4 SR_FONTSTYLE C_LONGINT 5 SR_FONTJUSTIFY C_LONGINT SR_RET C_LONGINT params SR_AREA SRArea SR_OBJ 0 SR_FONTNAME SR_FONTSIZE 1 SR_FONTSTYLE 1 SR_FONTJUSTIFY 1 params Count parameters If params gt 1 SR_OBJ 1 If params gt 2 SR_FONTNAME 2 End if If params gt 3 SR_FONTSIZE 3 End if If params gt 4 SR_FONTSTYLE 4 End if If params gt 5 SR_FONTJUSTIFY 5 End if If SR_OBJ 0 SR_OBJ SRObjectID End if SR_ATTRIBS SR Attribute Font Name SR Attribute Font Size SR Attribute Font Style SR Attribute Justification SR_RET SR Set Object Format SR_AREA SR_OBJ SR_ATTRIBS SR_FONTNAME SR_FONTSIZE SR_FONTSTYLE SR_FONTJUSTIFY End if SuperReport Pro Page 226 of 226
100. csersnaeseeeceeceeeessnssseeaeeeeeeess 199 SREGOPSSCTOMIS a a EE E E 200 SR Set SECTIONS cecssescccssseaecocesssccecesssacdeessuaadeccsauecceeessundcgcosaced deewades 202 SR Get SOCOM IAS srren EN E 203 SR Get SECTION Properties ccc ccccccccceecsesssseceeececceeeessrssseeeeeeeeees 204 SR Set SECTION Properties cece ccccccceecsessssececececceesessnseaeeeeeeeeees 206 SR Get SECTION SCTIDTS cceecsscccccecceessssnsccceccececsensesacceeesceeees 208 SR Set SECTION SCHIPTS ooo eeeeeessscscccececcecsessnsecececceceesensnseaeeeeseeeecs 209 SR GOT LOOM A E 210 SR Set TO Ol oetra E E EEEE EE 211 SuperReport Pro Codes File Manager Error COCES csssssccessssseccesssssecessseceeceesseseceessnsseeeenes 215 SECTION COGS siisscdssisvacsssacsaccvessvvelessdoveistaevevwaduderscodsiansadaveesantiesisie ees 216 Eror COG OS iis fas vvcccccidectecsin E E E 217 Event COGS 00 ceeccessssssssssssssesssessssssesesesesesenscseseseseeeeeeeeeeeeeeeeeeeeeeeeeeeess 218 Page 6 of 226 Chapter 8 SuperReport Pro Menu NUMB ClSiiscctecttecsciccbssccctevieds cede icate cbs dxcotee ed e niaaa ieia 219 Editor Codes ACTION TYPES serisini niai 222 Editor Codes Object Types oe eeceesseceesssscecessseeeceeesneeeeeesseeeeeeesaaes 222 SuperReport Pro COnStHANIS sssesereeeeeecereeererererererersesesesesesssesssssessses 223 Hints amp Tips TORIES OONN Ganni a r E A A AR Aa 227 SuperReport Pro Wrapper ROUHINES s
101. ct Line Tool Select this tool whenever you wish to create a line object Box Tool Select this tool whenever you wish to create a box object Circle Tool Select this tool whenever you wish to create a circle object Alignment Tool Popup When you have two or mote object selected you can align them using this tool Text Alignment Tool You can align text field or variable objects using this tool Foreground Pattern Popup Tool Assigns a pattern foreground to the selected object s Foreground Color Popup Tool Assigns a color foreground to the selected object s SuperReport Pro Page 38 of 226 Second Row Hell NEE wE Figure 12 Secondary Toolbar Font Popup Tool Assigns the selected font to the selected object s Font Size Popup Tool Assigns the selected font size to the selected object s Font Style Group Tools Assigns the selected font style to the selected object s Foreground Pattern Popup Tool Assigns a pattern foreground to the selected object s Foreground Color Popup Tool Assigns a color foreground to the selected object s SuperReport Pro Page 39 of 226 Section Marker Overview SuperReport Pro provides the ability to create a variety of report types When creating reports you will need to adjust the Section markers Figure 13 to support the style of reports you wish to create There are four different section markers available when creating reports Options Datab
102. ction ID List ARRAY LONGINT Array of section IDs gt ResultCode C_LONGINT Result Code SR Get Section IDs will retrieve all the information about a given section object While not all properties are related to one another this single routine enables you to easily retrieve all information for a given section ReportArea The desired SuperReport Pro area Section ID A valid SuperReport Pro section i e SR Section Body or SR Section Header For a complete list of sections please refer to Chapter 7 SuperReport Pro Codes Section Codes Section ID List A valid 4 Dimension array which will contain the Object ID s for all the objects in the defined section Example The following example will return an array of all the objects in the body section ARRAY LONGINT aiSR_SectionID 0 iSR_Err SR Get Section IDs vSRArea SR Section Body aiSR_SectionlD See Also SR Get Sections SR Set Section Properties SR Set Section Scripts SuperReport Pro Page 203 of 226 SR Get Section Properties SR Get Section Properties reportArea L sectionID L useSection L print L position L options L throwPage L minSpace L breakType L breakTable L breakField L breakVarName S gt result L Parameter Data Type ReportArea C_LONGINT Section ID C_LONGINT Use Section C_LONGINT Print Section C_LONGINT Position C_LONGINT Options C_LONGINT Throw Page C_LONGINT Min Space C_LONGINT Break Type C_LONGINT Break Table C_LONGINT Break Fi
103. cument from disk and print it using the SR Print Report routine C_BLOB pReportData C_TEXT tReportDoc tReportDoc Hard disk myReport srp iSR_Err SR Doc 2 Report tReportDoc pReportData If iSR_Err 0 iSR_Err SR Print Report pReportData 0 0 print the report End if SuperReport Pro Page 80 of 226 SR Load Report SR Load Report reportArea L reportDiskFile S gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area ReportDiskFile C_STRING 255 Report Disk File gt ResultCode C_LONGINT Result Code SR Load Report will load a document saved on disk and place it in the supplied SuperReport Pro area This command is equivalent to selecting Open from Disk menu item from the File menu in the SuperReport Pro report area ReportArea The desired SuperReport Pro area ReportDiskFile The full pathname to a valid SuperReport Pro report document previously saved to disk using either the SuperReport Pro Editor or via the SR Save Report routine If the ReportDiskFil parameter is a null string the standard Open File dialog will be display allowing the user to locate the file manually gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will load a Sup
104. d A valid 4 Dimension variable which will receive the objects end HTML block gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will retrieve the object script and HTML data C_TEXT tSR_Script tSR_HTMLStart tSR_ HTMLEnd SR_Err SR Get Object Scripts SR_AREA SR_ObjectID tSR_Script tSR_HTMLStart tSR_HTMLEnd See Also SR Set Object Scripts SR Get Object Data SR Get Object Format SR Get Object Properties SuperReport Pro Page 179 of 226 SR Set Object Scripts SR Set Object Scripts reportArea L objectID L objectScript T htmlPre T htmlPost T gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Object ID C_LONGINT Report section ID Object Script C_TEXT Object Script Object HTML Start C_TEXT HTML Start Block Object HTML End C_TEXT HTML End Block gt ResultCode C_LONGINT Result Code SR Set Object Scripts will set the object script and HTML information for the defined object ReportArea The desired SuperReport Pro area Object ID Desired ObjectID you wish to set the object script and HTML data You can use the object support routines SR Get Object IDs SR Get Object Properties etc to obtain detailed information about each report object O
105. d 4 Dimension variable which will receive the vertical position of the section marker Options A valid 4 Dimension variable which will receive the print options One of the following values may be returned 1 SR Section Keep On One Page 2 SR Section Adjust At Print Time SuperReport Pro Page 204 of 226 Throw Page A valid 4 Dimension variable which will receive the sections Start New Page setting One of the following values may be returned 1 SR Section Throw Page None 2 SR Section Throw Page Before 3 SR Section Throw Page After 4 SR Section Throw Page Min Space Minimum Space A valid 4 Dimension variable which will receive the minimum space value Break Type A valid 4 Dimension variable which will receive the section break setting should one be set This attribute will only be applicable when using a Subheader or Subtotal section all other sections will return a value of zero One of the following values may be returned 1 SR Section Break On Field 2 SR Section Break On Variable 3 SR Section Break On Array Break Table Number A valid 4 Dimension variable which will receive sections break fields table number This parameter is only applicable if the BreakType has returned a value of SR Section Break On Field 1 Break Field Number A valid 4 Dimension variable which will receive sections break field number This parameter is only applicabl
106. der6 Mask 128 SR Section Body Mask 256 SR Section SubTotal6 Mask 512 SR Section SubTotal5 Mask 1024 SR Section SubTotal4 Mask 2048 SR Section SubTotal3 Mask 4096 SR Section SubTotal2 Mask 8192 SR Section SubTotall Mask 16384 SR Section Total Mask 32768 SR Section Footer Mask SuperReport Pro Page 160 of 226 65535 SR All Sections Field Delimiter The ASCII field delimiter that will be used to separate report objects in the exported file Generally this value will be a TAB character ASCII value 9 If you are outputting in HTML format SR PrintTOBLOB Output HTML the field delimiter will not be used Record Delimiter The ASCII record delimiter that will be used to separate report records in the exported file Generally this value will be a CR ASCII 13 If you are outputting in HTML format SR PrintTOBLOB Output HTML the field delimiter will not be used Object Order When printing to disk you may determine the order in which objects are printed You may choose one of the following values 0 SR Generic Option Set Off Use print order see SR Reorder Objects for more information 1 SR Generic Option Set On Use object order top left coordinate gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return co
107. des please refer to the SuperReport Pro Error Codes section below Example The following example will print the report ASCII format to a 4 Dimension BLOB variable utilizing the SuperReport Pro HTML processor C_BLOB oSR_Data C_BLOB report C_TEXT text C_LONGINT options section SET BLOB SIZE oSR_Data 0 clear the blob options SR PrintToBLOB Output HTML SR PrintToBLOB Static Text SR PrintToBLOB TopLeft Order section SR All Sections iSR_Result SR Get Area vSRArea report iSR_Result SR Print To BLOB report oSR_Data options section 9 13 text BLOB to text oSR_Data Text without length hDoc Create document customerList html If OK 1 SEND PACKET hDoc text CLOSE DOCUMENT hDoc End if See Also SR Page Setup SR Preview SR Print Report SR Print Disk SR Print HTML SR Print PICT SuperReport Pro Page 161 of 226 SR Validate SR Page Setup reportObject P gt resultCode L Parameter Data Type Description ReportObject C_BLOB Report Object gt ResultCode C_LONGINT Result Code SR Validate will check whether the page setup for the specified report matches the currently selected printer If not then the page setup will me modified to match the chosen printer Report Object A valid SuperReport Pro Object This is not the actual SuperReport Pro area but rather the report object as it would be stored in a 4 Dimension BLOB field or variable gt Result Code The validation ro
108. display the SuperReport Pro report editor in a 4 Dimension external window using the Open external window routine C_LONGINT iSRWindow don t use SRWindow iSRWindow Open external window 50 50 Screen width 50 Screen height 50 8 New Report SuperReport SuperReport Pro Page 77 of 226 SR Get Area SR Get Area reportArea L blobObject P gt resultCode L Parameter Data Type ReportArea C_LONGINT BlobObject C_BLOB gt ResultCode C_LONGINT Description Report plug in area Result BLOB object Result Code SR Get Area will copy the information in the supplied reportArea and copy it to a 4 Dimension BLOB variable You must use either a process or inter process variable using a 4 Dimension field will not return the information correctly ReportArea The desired SuperReport Pro area BlobObject A valid 4 Dimension variable which will receive the desired report information gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will extract the report in eReportArea and place it into a 4t DIMENSION process variable then copy the information to a 4 Dimension BLOB field where the report is actually save C_BLOB pReportData iSR_Err SR Get Area eReportData pR
109. does not display the report area grid etc you must call SR New Report to properly create the new area Example The following example creates a new report then place it in the supplied SuperReport Pro area using the SR Set Area routine C_BLOB pReportData Case of Form event On Load iSR_Err SR New Report pReportData iSR_Err SR Set Area eReportArea pReportData If iSR_Err 0 ALERT An error occurred creating the report End if End case SuperReport Pro Page 83 of 226 SR New Offscreen Area SR New Offscreen Area gt reportObject L Parameter Data Type Description None gt ReportObject C_LONGINT SuperReport Pro Object Reference SR New Offscreen Area will create a new report object in memory which can be used to in conjunction with other SuperReport Pro routines for procedurally creating reports When you have finished using the offscreen area you must destroy the object using SR DELETE OFFSCREEN AREA gt Report Object If the routine completed successfully a valid SuperReport Pro object will be created If the report was not created a valid SuperReport Pro error code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example is the basic construct for procedurally creating reports For more information please refer to Chapter 5 Tutorial Procedurally Creating Reports or Chapter 6 Command Reference Deve
110. e SR_Rows SR_Cols SR_HRepeat SR_VRepeat After we have a column in the body section we are ready to get some data SuperReport Pro will use the current record selection for all reporting requests unless you define a different selection of records Typically SuperReport Pro developers will use the Database scripts to define the record selection In this case we ll use the Start script to define the record selection In this case we are going to display all records from the Customer table sorted by Customer Name set the selection SR_StartScript ALL RECORDS Customer Char 13 SR_StartScript SR_StartScript ORDER BY Customer Customer Name gt SR_Err SR Set Scripts SR_AREA SR_StartScript The final step before we save our report is to define the table which will be used to generate the report selection The following routine will set the main table which is equivalent to selecting Database Main Table Iterations when using the SuperReport Pro Editor set the main table for which the selection of records will be used SR_Err SR Main Table2 SR_AREA SR MainTable Choose Table Table gt Customer At this point our report creation is complete and all that remains is to save the report to disk and destroy the offscreen area to release the memory occupied by the report object save the report to disk SR_Err SR Save Report SR_AREA test srp 0 delete the offscreen area SR
111. e Section On Second Page Print Section Determines in the desired section will be used when the report is printed Position Determines the vertical position where the section is located on the report Options Determines the alternate printing options available when this section is used on a printed report 0 No options 1 SR Section Keep On One Page SuperReport Pro Page 206 of 226 Throw Page Determines when a new page should be started if at all for this section 1 SR Section Throw Page None 2 SR Section Throw Page Before 3 SR Section Throw Page After 4 SR Section Throw Page Min Space Minimum Space The minimum space value in points if the Throw Page attribute is set to SR Section Throw Page Min Space Break Type Determines what type of break process shall be used when this section is printed Break processing attributes are only applicable when using a Subheader or Subtotal section 1 SR Section Break On Field 2 SR Section Break On Variable 3 SR Section Break On Array Break Table Number Determines the 4 Dimension table number of the field which is used to determine when the page break should occur This attribute is only required when using a BreakType of SR Section Break On Field 1 Break Field Number Determines the 4 Dimension field number of the field which is used to determine when the page break should occur This attribu
112. e Sections C_LONGINT Active Sections Value Print Sections C_LONGINT Print Sections Value gt ResultCode C_LONGINT Result Code SR Get Sections will return the active and print sections which have been set for the desired report area The value returned to the section variables is a bitwise representation of the accumulative sections You can use the SuperReport Pro Section Constants to determine if a selected section is active by using the SR Section Mask attributes e SR Section Header Mask e SR Section SubHeader1 Mask e SR Section SubHeader2 Mask e SR Section SubHeader3 Mask e SR Section SubHeader4 Mask e SR Section SubHeader5 Mask e SR Section SubHeader6 Mask e SR Section Body Mask e SR Section SubTotal6 Mask e SR Section SubTotal5 Mask e SR Section SubTotal4 Mask e SR Section SubTotal3 Mask e SR Section SubTotal2 Mask e SR Section SubTotall Mask e SR Section Total Mask e SR Section Footer Mask For complete details on valid section codes please refer to Chapter 7 SuperReport Pro Codes Section Codes ReportArea The desired SuperReport Pro area Active Sections A valid 4 Dimension variable which will receive the bitwise value of current active sections Print Sections A valid 4 Dimension variable which will receive the bitwise value of current print sections gt Result Code If the routine completed successfully a value of ze
113. e if the BreakType has returned a value of SR Section Break On Field 1 Break Var Name A valid 4 Dimension variable which will receive sections break variable name This parameter is only applicable if the BreakType has returned a value of SR Section Break On Variable 2 or SR Section Break On Array 3 gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will return all the properties for the SR Section Body section iSR_Section SR Section Body iSR_UseSection 0 iSR_PrintSection 0 iSR_Position O iSR_Options 0 iSR_ThrowPage 0 iSR_MinSpace 0 iSR_BreakType 0 iSR_BreakTableNo 0 iSR_BreakFieldNo 0 sSR_BreakVarName 0 iSR_Err SR Get Section Properties vSRArea iSR_Section iSR_UseSection iSR_PrintSection iSR_Position iSR_Options iSR_ThrowPage iSR_MinSpace iSR BreakType iSR_BreakTableNo iSR_BreakFieldNo sSR_BreakVarName See Also SR Get Sections SR Set Section Properties SR Set Section Scripts SuperReport Pro Page 205 of 226 SR Set Section Properties SR Set Section Properties reportArea L sectionID L useSection L print L position L options L throwPage L minSpace L breakType L breakTable L breakField L break VarName S gt result L Parameter Data Type
114. e if the default method is current assigned iSR_Err SR Menu Item eReportArea 2 8 iSRProMenu 1 0 MyDoNew End if End if End if GP MyDoNew DC Example override method for SuperReport Pro iSR_Err SR New Report eReportArea See Also SR Do Command SR Menu Info SuperReport Pro Page 106 of 226 SR Pro Miscellaneous Each of the following routines provides miscellaneous actions when interacting with the SuperReport Pro report editor Routines included in this section are e SR ABOUT e SR Register e SR Document SR File Types e SR Get Format Number e SR Get Table List e SR Get Field List e SR Get Commands As List BLOB e SR Get Tables As List BLOB e SR Get Fields As List BLOB e SR Get Structure As List BLOB e SR Get Variables As List BLOB SR Get Variable Type e SR Get Virtual Variable SR Get Indexed String e SR Info e SR Is Modified SR Set Modify SR Main Table SR Main Table2 SR On Event e SR Power Menu e SR RELATIONS e SR Get Tips Enabled e SR SET TIPS ENABLED e SR SWAP HANDLES deprecated SR Report To BLOB SuperReport Pro Page 107 of 226 SR ABOUT SR ABOUT SR ABOUT Displays the SuperReport Pro about dialog e Node SA 30 rue de 33150 Ceni France http www e node net Node SuperReport Pro Version 2 9 Published by e Node Figure 44 SuperReport Pro About Box SuperReport Pro Page 108 of 226 SR Register
115. ea has not been modified 1 Report area has been modified 2 Report area has been modified by report loaded from disk 8008 Invalid area Example The following example will determine if the current SuperReport Pro area has been modified If it has been modified it will update the current 4t Dimension report BLOB variable then set the modified flag to zero C_BLOB pSR_Report C_LONGINT iSR_Err iSR_Result iSR_Result SR s Modified eReportArea If iSR_Result 0 the report has been modified ISR_Err SR Get Area eReportData pSR_Report update the report variable ISR_Err SR Set Modify eReportDat 0 End if See Also SR Set Modified SuperReport Pro Page 128 of 226 SR Main Table formerly SR Main File SR Main Table reportObject P action L iterations L varName S gt resultCode L Parameter Data Type Description Report Object C_BLOB SuperReport Pro Report Object Action C_LONGINT Main File Action Iterations C_LONGINT Report Iterations Variable Name C_STRING 32 4D Variable Name gt ResultCode C_LONGINT Result Code SR Main Table will set the number of iterations for a SuperReport Pro report You can specify the iterations based on the current selection of a 4D table the size of a 4D array or a value in a 4D variable Report Object A valid SuperReport Pro Object This is not the actual SuperReport Pro area but rather the report object as it would be stored in a 4t Dimension BLOB field or variable
116. ections e SR Pro Access e SR Pro Consulting SR Pro Menus e SR Pro Miscellaneous e SR Pro Printing SR Pro Developer Interface API SuperReport Pro Page 73 of 226 Routine Overview SuperReport Pro contains over 30 routines for creating and managing reports Each of these routines falls into one of 5 categories for easy identification SuperReport Pro uses the following categories e SR Pro Access Outlines the routines used to create and configure a SuperReport Pro report using the SuperReport Pro plug in area e SR Pro Customizing Outlines the routines used customize the file structure and variables used by the SuperReport Pro plug in area e SR Pro Menus Outlines the routines used to procedurally control the menus used by the SuperReport Pro plug in area e SR Pro Miscellaneous Outlines the routines which provide miscellaneous information and configuration options when using SuperReport Pro e SR Pro Printing Outlines the routines used to use one of the many different printing options provided by SuperReport Pro e SR Pro Developer Application Interface API Outlines the routines used to provide developer customization to the SuperReport Pro editor interface SuperReport Pro Page 74 of 226 SR Pro Access Routines Each of the following routines provide the ability to load and save reports using the SuperReport Pro plug in area or outline the SuperReport plu
117. ed to retrieve your 4D serial information is available from the following link http www e node net ftp GetSeriallnfo NOTE The registration system has been modified in version 2 9 Only one registration key is now required registrationKey Pass the registration key to register your copy of SuperReport Pro Only one registration key is required The key is either linked to the 4D or 4D Server serial number individual licenses or to the name of the company developer unlimited annual licenses gt resultCode This will return a value of 1 if the registration key is valid and a value of 0 if the registration key is invalid You should verify the correctness of the registration key by tracing over the call to SR Register and examining resw tCode NOTE Multiple calls to SP Register are allowed The plug in will be activated if at least one valid key is used The first successful call will return 0 and all subsequent SR Register calls will be ignored and return 0 Example C_LONGINT result result SR Register Place your registration key here If result 1 error ALERT SuperReport Pro could not be registered String result End if Example with multiple calls C_LONGINT result ignored in this case result SR Register Registration key one result SR Register Registration key two result SR Register Registration key three ete SuperReport Pro Page 110 of 226 SR Document SR
118. eld C_LONGINT Break VarName C_STRING or C_TEXT gt ResultCode C_LONGINT Description Report plug in area Report Section ID to obtain properties Use section flag Print section flag Section vertical position Miscellaneous Options Start New Page Setting Minimum Space Section break type Break Table Number when break on field Break Field Number when break on field Break Variable Name when break on var Result Code SR Get Section Properties will retrieve all the information about a given section object While not all properties are related to one another this single routine enables you to easily retrieve all information for a given section ReportArea The desired SuperReport Pro area Section ID A valid SuperReport Pro section i e SR Section Body or SR Section Header For a complete list of sections please refer to Chapter 7 SuperReport Pro Codes Section Codes Use Section A valid 4 Dimension variable which will receive the section usage setting One of the following values may be returned 1 SR Use Section Always 2 SR Use Section On Break 3 SR Use Section On First Page 4 SR Use Section On Second Page Print Section A valid 4 Dimension variable which will determine if the section is configured to be printed or not A value of one 1 indicates the section will be printed a value of zero 0 indicates the section will not be printed Position A vali
119. elopment interpreted mode or deployment interpreted or compiled mode on 4D Server up to 10 users The registration key is linked to your 4D Server license just as above Medium server This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Server up with 11 to 20 users The registration key is linked to your 4D Server license just as above Large server This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Server over 20 users The registration key is linked to your 4D Server license just as above Unlimited Single User This license allows development interpreted mode or deployment interpreted or compiled mode on as many 4D Standalone Runtime or Engine copies that run your 4D application s This is a yearly license which expires after the date when it is to be renewed The expiration only affects interpreted mode Compiled applications using an obsolete license will never expire Unlimited OEM This license allows development interpreted mode or deployment interpreted or compiled mode on as many 4D Server of any umber of users 4D Standalone Runtime or Engine copies that run your 4D application s This is a yearly license which expires after the date when it is to be renewed The expiration only affects interpreted mode Compiled applications using an obsolete license will never expire SuperReport Pro Page 109 of 226 A 4D database us
120. encouraged to use the online web reporting form as it will be correctly routed to the appropriate support personnel http www e node net SuperReport Pro Page 12 of 226 Registration SuperReport Pro requires a registration key to unlock the product making it a full working version Call the SR Register command in the On Startup method Without the registration key SuperReport Pro will operate in demonstration mode during 20 minutes Version 2 9 introduced a new license design Previous licenses will not work with this release In order to activate SuperReport Pro 2 9 and above you need to requite a new license key from e Node License types Like all e Node plug ins SuperReport Pro offers six different license types There ate no such things as MacOS vs Windows or Development vs Deployment Single user license This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Standalone or Runtime Since the registration key is linked to a specific 4D license you need to provide the number returned by the 4D command GET SERIAL INFORMATION first parameter A new license will be supplied for free at any time if you change your 4D version and or get a new 4D registration key provided that your previous licenses match the curtent public version at the exchange time Small server This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Serve
121. enhanced font formatting attributes such as Bold Italic Underline etc While most print drivers can handle multiple styles for a single object some print drivers have problems dealing with multiple styles 4 Test test test Try to test your reports on as many different printers as possible you would be surprised at the differences between drivers If you have a tip that would be useful to other SuperReport Pro users please let us know so that we can post this information in future documentation and release notes as well as our web site Send tips to srp e node net SuperReport Pro Page 29 of 226 HTML Support SuperReport Pro provides the ability to create standard HTML reports Each SuperReport Pro object may contain custom HTML tags which are inserted before and after the corresponding data object is sent to the HTML file when printing the report in HTML format SRPro Text Object Properties H HTML Data Insert HTML Before lt center gt cha Insert HTML After lt center gt lt h3 gt Figure 6 SuperReport Pro HTML Dialog Using the HTML Tag Dialog you can supply the following items e Begin Tag The begin tag information is sent to the HTML file before the corresponding data is sent to the file e End Tag The end tag information is sent to the HTML file after the corresponding data is sent to the file SuperReport Pro Page 30 of 226 Using Custom Tag V
122. enu Variable Type Displays a popup menu of the variable types see Section dialog DBHOAWON KR 7 SR PowerMenu Format Displays a popup menu of the format filters types see Field Variable Dialog 11 SR PowerMenu Color Display the color popup palette only works on MacOS 12 SR PowerMenu Pattern Displays the pattern popup palette only works on MacOS 13 SR PowerMenu Line Displays the line thickness popup menu WhereH Horizontal coordinate where popup menu should be displayed If this value and WhereV are zero the popup menu will be positioned at the mouse pointer WhereV Vertical coordinate where popup menu should be displayed If this value and WhereH are zero the popup menu will be positioned at the mouse pointer SelectedItem A valid 4 Dimension variable which will receive the menultem position relative to the selected menu If you are selecting the 34 item within a submenu this parameter will contain a value of 3 SelectedValue A valid 4 Dimension variable which will receive the selected menultem text SelectedltemAlias A valid 4 Dimension variable which will receive the selected menultem alias value when using SR PowerMenu Tables SR PowerMenu Fields or SR PowerMenu Variables SuperReport Pro Page 136 of 226 on return the fields contain menuID Type Selected Item Selected Value Alias menuID SR PowerMenu Tables tableID SR PowerMenu Fie
123. eportData If iSR_Err 0 ReportMgr ReportData pReportData End if See Also SR Set Area SuperReport Pro Page 78 of 226 SR Set Area SR Set Area reportArea L reportData P gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area ReportData C_BLOB Source BLOB object gt ResultCode C_LONGINT Result Code SR Set Area will take the reportData and place it in the defined SuperReport Pro area This command will overwrite any existing data contained in the defined area This routine is typically called in the forms On Load event before the form is displayed If you would like to determine if the current SuperReport area has been modified before overwriting the existing report use the SR Is Modified routine ReportArea The desired SuperReport Pro area ReportData A valid 4 Dimension variable or field which contains the reportData we wish to place in the defined SuperReport Pro area gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below WARNING If you have customized the supporting file structure using the SR Structure routine it must be called before calling SR Set Area Example The following example will place the report loaded from the Report Manager table and place it in e
124. er the following HTML tags Start Tag lt tr gt End Tag lt tr gt SRPro Section Properties HTML Data Body HTML Begin Tag lt tr gt Body HTML End Tag Cancel Figure 33 SuperReport Pro Body Section HTML Data SuperReport Pro Page 62 of 226 Step 5 Now that we have successfully created our tables it is now time to add some data cells Using the HTML lt td gt and lt td gt tags we can create table cells for the current row For each field in the body section double click on the field object click on the HTML button and add the following tags Start Tag lt td gt End Tag lt td gt As each object in the body section is printed a new cell will be created SRPro Field Object Properties H HTML Data Customers Name HTML Begin Tag lt td gt Customers Name HTML End Tag lt td gt Figure 34 SuperReport Pro Object HTML Data SuperReport Pro Page 63 of 226 Step 6 The last piece of the body data will be to create a row for the data blocks in the header section Since the scripts of these objects are executed after the header marker we can create the first row of column data before the corresponding body section is executed For each object in the header section which is a column title double click on the object select the HTML button and add the following tags Start Tag lt td gt l
125. erReport Pro document from disk and place in the eReportArea C_TEXT tReportDoc tReportDoc Hard disk myReport srp iSR_Err SR Load Report eReportArea tReportDoc use the tReportDoc report iSR_Err SR Load Report eReportArea display the Open File dialog See Also SR Load Report SuperReport Pro Page 81 of 226 SR Save Report SR Save Report teportArea L reportDiskFile S options L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area ReportDiskFile C_STRING 255 Report Disk File Options C_LONGINT Report Options gt ResultCode C_LONGINT Result Code SR Save Report will save the contents of the defined SuperReport Pro report area to a standard disk file This command is equivelant to selecting Save to Disk menu item from the File menu in the SuperReport Pro report area ReportArea The desired SuperReport Pro area ReportDiskFile The full pathname to a valid SuperReport Pro report document If the ReportDiskFile parameter is a null string the standard Save File dialog will be display allowing the user to define the location of the file manually Options Controls the display of the Save File dialog 0 No custom action performed 1 Display the Save File dialog regardless of the supplied pathname gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For
126. ernal SuperReport Pro menu number which you wish to work with See SuperReport Codes for a complete list of available SuperReport Pro Menu Numbers MenuID The desired SuperReport Pro menuID The menu numbers are numbered from 0 Apple menu to 4 Database menu ItemID The desired SuperReport Pro menu item The menu item numbers begin with 1 first item and you should account for any separator or disabled items when using this parameter gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 103 of 226 Examples The following example will return the SRProMenu for the desired menuID and itemID in this we ate returning the menuID and menultem for the Print Preview menu item C_LONGINT iSRProMenu iMenulD iltemID iSRProMenu 1 iMenulD 2 edit menu ittemID 3 cut command iSR_Err SR Menu Info eReportArea iSRProMenu iMenulD iltemID The following example will return the menuID and itemID for SRProMenu iSRProMenu 107 iMenulD 1 iltemID 1 iSR_Err SR Menu Info eReportArea iSRProMenu iMenulD iltemID See Also SR Do Command SR Menultem SuperReport Pro returns iSRProMenu returns iMenulD and iltemID Page 104 of 226 SR Menu Item SR Menu Item reportArea L action L menuID
127. es for the new header object When assigning optional object attributes you will use the objectID returned by SR Create Object in Step 2 SR_HdrText Field name gt Customer Code SR_Err SR Set Object Data SR_AREA SR_ItemID pSR_PICT SR_HdrText Now that we have an object on the report we ll add a little formatting The following routine will apply a bold attribute to the header object to make it stand out a bit when our report is printed SR_Err SR Set Object Format SR_AREA SR_ItemID SR Attribute Font Style 1 Bold 1 1 1 1 1 1 1 1 1 1 1 1 SuperReport Pro Page 70 of 226 Step 5 Step 6 Step 7 Step 8 Step 8 The next step to creating our report will be to add a column located in the body area which will display actual database information The first section of code will define the beginning coordinates for the detail object Remember we have 25 pixels between sections thus we need to move it down to compensate for the various section markers set the base coordinates for the fields we are adding top 60 bottom top 12 SR_ObjType SR Object Type Field create the first column left 50 right left objWidth tableNo Table gt Customer Code fieldNo Field gt Customer Code SR_ItemID SR Create Object SR_AREA SR_ObjName top left bottom right SR_ObjType SR_Opts SR_Selected tableNo fieldNo SR_VarType SR_ArrayElement SR_CalcType SR_CalcNam
128. et Guides SR Set Guides reportArea L horCoordinates X vertCoordinates X gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Horz Coordinates ARRAY INTEGER or LONGINT Array of horizontal coordinates Vert Coordinates ARRAY INTEGER or LONGINT Array of vertical coordinates gt ResultCode C_LONGINT Result Code SR Set Guides will create report guides using the supplied horizontal and vertical coordinate arrays ReportArea The desired SuperReport Pro area Horizontal Coordinates A valid 4 Dimension array which contains the horizontal coordinates for the report guides you wish to create Vertical Coordinates A valid 4 Dimension array which contains the vertical coordinates for the report guides you wish to create gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will create two report guides using the horizontal and vertical coordinates ARRAY INTEGER aiSR_HGuides 1 ARRAY INTEGER aiSR_VGuides 3 aiSR_HGuides 1 10 aiSR_VGuides 1 50 aiSR_VGuides 2 15 aiSR_VGuides 3 25 SR_Err SR Set Guides SR_AREA aiSR_HGuides aiSR_V Guides See Also SR Get Guides SuperReport Pro Page 197 of 226 SR Get Scripts SR Get Scripts rep
129. ffset Object Name Desired object name If you are referencing an object which provides static information i e a static text object ot variable parameter will contain the static information RectT op Object Position Top The object position is relative to the upper left corner of the report area RectLeft Object Position Left The object position is relative to the upper left corner of the report area RectBottom Object Position Bottom The object position is relative to the upper left corner of the report area RectRight Object Position Right The object position is relative to the upper left corner of the report area Object Type Desired object type One of the following values will be returned 1 SR Object Type Text 2 SR Object Type Field 3 SR Object Type Variable 4 SR Object Type Line 5 SR Object Type Rectangle 6 SR Object Type Circle 8 SR Object Type Picture SuperReport Pro Page 185 of 226 Options Object Options The value returned by this parameter will be the sum of the object options You can use 4Ds standard bitwise operators to extract individual item options 1 SR Obj Flag Left Line 2 SR Obj Flag Top Line 4 SR Obj Flag Right Line 8 SR Obj Flag Bottom Line 15 SR Obj Flag All Lines 16 SR Obj Flag Fixed Horizontal 32 SR Obj Flag Fixed Vertical 64 SR Obj Flag Grow Horizontal 128 SR Obj Flag Grow Vertical
130. g in area Routines included in this section are SuperReport e SR Get Area e SR Doc 2 Report e SR Load Report SR Save Report e SR Set Area e SR New Report e SR New Offscreen Area e SR DELETE OFFSCREEN SuperReport Pro Page 75 of 226 SuperReport oSuperReport Parameter Data Type Description No Parameters SuperReport is the actual plug in area object which is placed on the 4 Dimension form in which you wish to display the SuperReport Pro area In addition you use the SuperReport routine when using the 4 Dimension Open external window routine which provides the ability to display the SuperReport Pro editor in a standard 4D external window NOTE For more information regarding the Open external window command please refer to the 4 Dimension Language Reference Documentation Plug in Area Plug in Area SuperReport Plug in Routine SuperReport Object List Var iable2 Figure 42 4D Object Properties Palette using YSuperReport area SuperReport Pro Page 76 of 226 F File Edit Options Database PRA Holo eagat SaL fEGeneva mor Pep roBa tn L SuperReport Pro 25 Variable vSRArea could automatically save data in the picture or blob field vSRArea_ if it existed Wx H 527 x 263 Copyright 1998 2001 Automated Solutions Group All Rights Reserved Figure 43 SuperReport Pro Area on Form Example The following example will
131. gin creating your first report This example will guide you through the steps in creating a basic listing report Step 1 Step 2 Step 3 Step 4 Step 5 First let s assign some information to the Report_Mer fields Name name of our report Customer Listing Description brief description of report Basic listing report For File popup menu Customer Now add a new field to the report area Each of the items should be placed in the Body section above the Body marker Select the Field Tool then draw a box in the location where you would like the field located Field Object Properties SS H HTML Data Select Field Name Address Turnover H Invoice E Item Telephone Fax Active A c A 03 A A Logo Display Format A E Figure 20 SuperReport Pro Field Selector Dialog The Field Definition dialog will be displayed From the Field popup menu select the field that you would like to place on the report select Name for the new object Repeat Step 2 to add a couple more fields add Address and Telephone Your report should look something like the following Now we ll add the corresponding field titles Using the Text Tool create field titles for each of the fields we have added in Steps 2 and 3 While you are here go ahead and apply some addition font formatting such as making the titles bold After you have completed adding the titles your
132. gr Is new record if this is not a new record result SR Set Area eReportArea Report_Mgr ReportData Else result SR New Report pSR_Report create a new report result SR Set Area eReportArea pSR_Report End if End case At this point we are ready to begin using the SuperReport Pro editor However before we proceed let s add the code necessary for saving your report information to our report data field so that we can access it again The last step we need to complete is saving our reports to the SuperReport Pro data field Add the following code to your form s accept button iSR_Err SR Get Area eReportArea pSR_Report copy data from plug in are to variable If iSR_Err 0 if the command completed successfully Report_Mgr ReportData pSR_Report End if When you ate retrieving information from a SuperReport Pro plug in area you must use a 4t Dimension BLOB variable passing a BLOB field will not work correctly Once the SR Get Area routine has completed successfully you can copy the variable to your storage field as we have above SuperReport Pro Page 36 of 226 Step 7 Now you are ready to begin using the SuperReport Pro editor Enter the User Mode or however you have configured access to the Report_Mer table and create a new record You should see something similar to the following input form this is the input form from the SuperReport Pro demo e000 Report Definitions 16 of 16 s32 Developer API 120f
133. he BLOB representation of the report Can I use the Repeating Objects feature for multi level relationships For example if I have a Customer Invoice and Line Item table can I use repeating objects to show all the related Invoices and show their related Line Items No the Repeating Objects feature is designed to work with a single related many table In order to create this type of report you are going to have to create it based on the Line Item s table and using Subheader data you can show the related one and its associated related on information SuperReport Pro Wrapper Routines As an extension to the SuperReport Pro Developer API you can create custom wrapper routines that provide users and developers with simplied access to the underlying plug in API routines outlined above The SuperReport Pro demo includes a number of custom wrappers which provide you with an example of the extensive configuration capabilies offered by the SuperReport Pro Developer API Example Routine The following is a sample routine which enables the user to customize the appearance of a given object during printing This routine could be called as follows SR_SetFont SRObjectID 1 1 SRObjectID is a reserved SuperReport Pro variable which contains the internal ID of the current object tells SRP to use the same font as defined in the editor 1 tells SRP to use the same size as defined in the editor tells SRP to make the current o
134. he Page Setup for the specified report You must pass the report parameter as a global variable since the user may modify the Page Setup and you will need to get the new changes back ReportArea The desired SuperReport Pro area gt Result Code If the command returns a value of 1 then the page setup was changed and saved by the user and you should save the modified report Example C_BLOB pSR_ReportData C_LONGINT iSR_Result pSR_ReportData ReportMgr ReportData iSR_Result SR Page Setup pSR_ReportData If SR_Result 1 ReportMgr ReportData pSR_ReportData End If See Also SR Validate SR Preview SR Print Report SR Print Disk SR Print HTML SR Print To BLOB SR Print PICT SuperReport Pro Page 148 of 226 SR Preview SR Preview reportObject P left L top L right L bottom L windowType L windowTitle S modalFlag L gt resultCode L Parameter Data Type Description ReportObject C_BLOB Report Object Left C_LONGINT Window Position Left Top C_LONGINT Window Position Top Right C_LONGINT Window Position Right Bottom C_LONGINT Window Position Bottom Window Type C_LONGINT Window Type Window Title C_STRING 255 Window Title Options C_LONGINT Operation Options gt ResultCode C_LONGINT Result Code SR Preview is used to display a report in an external window in preview mode When the user hits the X Done button the window is automatically closed You must ensure that the wi
135. his could be an alias aSR_Structure 2 1 1 0 add all fields for table 1 aSR_Structure 3 2 5 0 Customers name menu 2 Customers aSR_Structure 4 2 5 1 Customer Code aSR_Structure 5 2 5 3 Customer Name iSR_Err SR Structure eReportArea aSR_Structure iSR_Err SR New Report pReportData iSR_Err SR Set Area eReportArea pReportData iSR_Err SR Options eReportArea 1 1 1 End case See Also SR Commands SR Variables SuperReport Pro Page 95 of 226 SR Variables SR Variables reportArea L variableArrayName S gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area VariableArrayName C_STRING 255 Name of array containing variables gt ResultCode C_LONGINT Result Code SR Variables allows you customize the list of available variables in the Variable dialog for the defined SuperReport Pro area Using this command you can provide users access to any variable within your application When using custom variables you must properly declare the variables before they are used in the SuperReport Pro editor If you wish to clear the variables pop up menu then either pass an empty string as the array name or size the atray to zero elements and execute the command again When removing custom variables the variable list will only contain the default SuperReport Pro variables Note There is a limit of limit of 31 parent menus when creating custom variable submenus
136. ht left 50 SR_ItemID SR Create Object SR_AREA SR_ObjName top left bottom right SR_ObjType SR_Opts SR_Selected Table gt Customer Address Field gt Customer Address SR_VarType SR_ArrayElement SR_CalcType SR_CalcName SR_Rows SR_Cols SR_HRepeat SR_VRepeat left right offset right left 50 SR_ItemID SR Create Object SR_AREA SR_ObjName top left bottom right SR_ObjType SR_Opts SR_Selected Table gt Customer Name Field gt Customer Name SR_VarType SR_ArrayElement SR_CalcType SR_CalcName SR_Rows SR_Cols SR_HRepeat SR_VRepeat SR_Err SR Save Report SR_AREA test srp 0 SR DELETE OFFSCREEN AREA SR_AREA End if See Also SR Set Object Data SR Object Format SR Delete Object SuperReport Pro Page 177 of 226 SR Delete Object SR Delete Object reportArea L objectID L gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area ObjectID C_LONGINT Report Object ID gt ResultCode C_LONGINT Result Code SR Delete Object provides the ability to procedurally delete an object from a report After the object is deleted the internal object list is updated automatically ReportArea The desired SuperReport Pro area Object ID Desired ObjectID you wish to delete You can use the object support routines SR Get Object IDs SR Get Object Properties etc to obtain detailed information about each report object gt Result Code If the
137. iable name and varElement would could the direct element should we reference an array C_LONGINT menulD C_LONGINT selValue C_TEXT selText selAlias C_TEXT varName C_LONGINT varElement GET MOUSE mousexX mouseY mouseButton menulD SR PowerMenu Variables ret SR Power Menu vSRArea menulD mousex mouseY selValue selText selAlias ret SR Get Virtual Variable vSRArea menulD varName varElement See Also SR Get Virtual Variable SuperReport Pro Page 138 of 226 SR RELATIONS SR RELATIONS relateOne L relateMany L Parameter Data Type Description Relate One C_LONGINT Execute Relate One Relate Many C_LONGINT Execute Relate Many SR RELATIONS is used to control whether SuperReport Pro generates RELATE MANY and RELATE ONE calls as a report is generated and whether SuperReport Pro makes use of automatic relations or not The relateOne and relateMany parameters may take one of the following values 1 Return current setting 0 Switch off automatic relations and Relate One Many calls 1 Switch on automatic relations but do not make Relate One Many calls 2 Switch on automatic relations and make Relate One Many calls By default SuperReport Pro makes use of automatic relations and issues a RELATE ONE and RELATE MANY command as each record of the main file is processed This ensures that related information is always available to the report In order to improve speed you can switch off
138. imension method SR_EditorCallback which will be executed whenever a SuperReport Pro editor event is sent Case of Form event On Load SR_Err SR Set Editor Callback eReport SR_EditorCallback End case Sample Callback Method The following is a sample callback method which could be used when installing an editor callback method PM SR_EditorCallback area L actionType L itemRef L objType L LM 12 3 00 v2 8 1 SR Pro area reference 2 action type 3 object item reference 4 object type C_LONGINT 0 callback result C_LONGINT 1 report area C_LONGINT 2 action type C_LONGINT 3 object item reference C_LONGINT 4 object type SR_AREA 1 SR_ACTION 2 SR_ITEM 3 SR_OBJTYPE 4 Case of SR_ACTION SR Editor Create Object 1 SR_ACTION SR Editor Modify Object 2 SR_ACTION SR Editor Modify Section 3 SR_ACTION SR Editor Modify Object Script 4 SR_ACTION SR Editor Modify Report Script 5 SR_ACTION SR Editor Control Click Object 6 SR_ACTION SR Editor Click Object 7 SR_ACTION SR Editor Selection Changed 8 End case 0 1 SuperReport Pro Page 166 of 226 SR Set Script Callback SR Set Script Callback reportArea L callbackMethod S gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Callback Method C_STRING Report Editor Callback Method gt ResultC
139. in Table2 SuperReport Pro Page 130 of 226 SR Main Table2 formerly SR Main File2 SR Main Table2 reportArea L action L iterations L varName S gt resultCode L Parameter Data Type Description Report Area C_LONGINT SuperReport Pro Object Action C_LONGINT Main File Action Iterations C_LONGINT Report Iterations Variable Name C_STRING 32 4D Variable Name gt ResultCode C_LONGINT Result Code SR Main Table2 will set the number of iterations for a SuperReport Pro report You can specify the iterations based on the current selection of a 4D table the size of a 4D array or a value in a 4D variable This routine is identical to SR Main Table except the first parameter is a SuperReport Pro object instead of the stored object contained in a BLOB variable or field Report Object A valid SuperReport Pro Object This is the actual SuperReport Pro area not the stored version If you wish to use the stored version contained in a BLOB object use SR Main Table Action Desired configuration action If you pass a value of zero 0 as the action you must pass a valid 4 Dimension variable to Iterations parameter so that the current value can be returned You may choose one of the following values 1 SR MainTable Show Dialog 0 SR MainTable Query 1 SR MainTable Choose Table 2 SR MainTable Fixed Iteration 4 SR MainTable Variable 8 SR MainTable Array 1 Show Main File Iterations Dialog Th
140. ing customized report interface For more information on creating customized report interface please refer to Chapter 6 Command Reference Object Properties ReportArea The desired SuperReport Pro area VarlD value from menulD variable returned by call to SR Power Menu or refNum from leaf list item from SR Get Variables As List BLOB VarName Variable Name as set by SR Variables VarElement Variable Element as set by SR Variables gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will obtain the variable name and variable element where applicable as configured by SR Variables after selecting item with SR Power Menu Upon completion varName will contain the actual 4D variable name and varElement would could the direct element should we reference an array C_LONGINT menulD C_LONGINT selValue C_TEXT selText selAlias C_TEXT varName C_LONGINT varElement GET MOUSE mousexX mouseY mouseButton menulD SR PowerMenu Variables ret SR Power Menu vSRArea menulD mousex mouseY selValue selText selAlias ret SR Get Virtual Variable vSRArea menulD varName varElement See Also SR Variables SR Get Variables As List BLOB SR Power Menu SuperReport
141. ion options gt ResultCode C_LONGINT Result Code SR Options allows you to customize the display and configuration of a SuperReport Pro area This routine is identical to the SR Set Options routine and remains for backwards compatibility with older versions of SuperReport Pro If you are using routine for the first time we recommend you use the SR Set Options routine ReportArea The desired SuperReport Pro area ShowReportMenu Configures the display of the Database menu last menu in the report editor s menu bar The default value is 1 0 SR Generic Option Set Off Don t display Database menu bar 1 SR Generic Option Set On Display Database menu bar default value EnableScriptAccess Configures access the various Script buttons and menu items Script access controls all places where script access is available 0 SR Generic Option Set Off Disable access to report scripts 1 SR Generic Option Set On enable access to report scripts Miscellaneous Options Configures additional miscellaneous options This parameter is a standard bitwise value you simply add the options together and pass it as single to value to activate one ot more options 0 SR Generic Option Set Off No miscellaneous options default value 1 SR Options Hide Zoom Hide Zoom box and disable Zoom Window menu item 2 SR Options Basic Interface Use basic Select Main table dialog 4 SR Options
142. is should only be called when SuperReport Pro Editor is displayed 0 Query current setting for report 1 Set the iterations based on the table number specified in the iterations parameter 2 Set the iterations based on the literal value of the iterations parameter 4 Set the iterations based value stored in the variable specified in the varName parameter 8 Set the iterations based on the size of the array specified in the varName parameter Iterations Depending on the value passed in the Action parameter the Iterations parameter will may be either a literal value when using an Action value of 1 or 2 or a valid 4 Dimension variable which will receive the current iteration value when using an Action value of 0 VarName The name of the variable which contains the iteration value when passing a value of 4 or 8 as the Action value gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below See Also SR Main Table SuperReport Pro Page 131 of 226 SR On Event SR On Event reportArea L filter L callbackProcName S postKey S gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Event Filter C_LONGINT Report Event Filter Callback Procedure C_STRING 32 4D Callback Procedu
143. ized window title which may have been set using SR Set Options gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below See Also SR Set Options SuperReport Pro Page 90 of 226 SR Set Options SR Set Options reportArea L showReportMenu L enableScriptAccess L miscReportOpts L zoomedWindowTitle S gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area ShowReportMenu C_LONGINT Show Database menu EnableScriptAccess C_LONGINT Enable access to Scripts button Miscellaneous Opts C_LONGINT Additional configuration options Zoomed Win Title C_STRING Zoomed window title gt ResultCode C_LONGINT Result Code SR Set Options allows you to customize the display and configuration of a SuperReport Pro area ReportArea The desired SuperReport Pro area ShowReportMenu Configures the display of the Database menu last menu in the report editor s menu bar The default value is 1 0 SR Generic Option Set Off Don t display Database menu bar 1 SR Generic Option Set On Display Database menu bar default value EnableScriptAccess Configures access the various Script buttons and menu items Script access controls all places where script access is avai
144. jType is SR Object Type Field or SR Object Type Variable You may choose one of the following values 0 SR Calculation Type None 1 SR Calculation Type Total 2 SR Calculation Type Min 3 SR Calculation Type Average 4 SR Calculation Type Max Cal Name Name of the variable to store calculation This parameter is only used when the Opzions is SR Obj Flag Use Calc Value Rows Number of rows in a rectangle grid This parameter is only used when the ObjType is SR Object Type Rectangle Cols Number of columns in a rectangle grid This parameter is only used when the ObjType is SR Object Type Rectangle Repeat Horizontal Offset Desired horizontal offset for repeating object This parameter is only used when the Options is SR Obj Flag Repeat Horizontally Repeat Vertical Offset Desired vertical offset for repeating object This parameter is only used when the Options is SR Obj Flag Repeat Vertically gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below See Also SR Get Object Scripts SR Get Object Data SR Get Object Format SuperReport Pro Page 183 of 226 SR Set Object Properties SR Set Object Properties reportArea L objectID L action L objName S rectTop L rectLeft L rec
145. lable 0 SR Generic Option Set Off Disable access to report scripts 1 SR Generic Option Set On enable access to report scripts Miscellaneous Options Configures additional miscellaneous options This parameter is a standard bitwise value you simply add the options together and pass it as single to value to activate one ot more options 0 SR Generic Option Set Off No miscellaneous options default value 1 SR Options Hide Zoom Hide Zoom box and disable Zoom Window menu item 2 SR Options Basic Interface Use basic Select Main table dialog 4 SR Options Hide HTML Disable HTML access HTML button will be removed from appropriate dialogs 8 SR Options Use Std Guides Use standard guides when draw report area red blue etc 32 SR Options Hide Menubar Hide Menubar 64 SR Options Hide Toolbar Hide Toolbar 128 SR Options Hide Hor Scrollbar Hide Horizontal Scrollbar 256 SR Options Hide Vert Scrollbar Hide Vertical Scrollbar Zoom Window Title Configures the window title of a zoomed area from editor gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below NOTE Passing a value of 1 on any of the option parameters will use the current settings See
146. lds virtual field name tableID lt lt 16 fieldID field alias SR PowerMenu Variables variable name variable Type variable alias value from PopUpMenuSelect menuID in high word and itemNumber in low word SR PowerMenu Commands menu item string value from PopUpMenuSelect menuID SR PowerMenu Break menu item string menu item number see SR Object Type Section Break On in high word and itemNumber in low word SR PowerMenu Variable menu item string menu item number see SR Type Variable Type SR PowerMenu Format menu item string internal format number counted from zero for picture formats it is uses the standard 4D PICT formats except On Background which is not applicable SR PowerMenu Color index of the color 0 RGB color usable in 4D 255 Note This is a string representation of value e g 116 32 SR PowerMenu Line menu item string menu item number 1 9 where 1 Hair 2 1 Pt 3 2 Pt gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 137 of 226 Example The following example will obtain the variable name and variable element where applicable as configured by SR Variables after selecting item with SR Power Menu Upon completion varName will contain the actual 4D var
147. lias C_STRING or C_TEXT Selected menu item alias gt ResultCode C_LONGINT Result Code SR Power Menu provides the ability to display a hierarchical popup menu using a variety of structure objects When display the popup menu you can obtain the associated menulD selectedValue selectedItem and selectedItemAlias This routine is used internally by the SuperReport Pro dialogs and may be used when creating customized report interface For more information on creating customized report interface please refer to Chapter 6 Command Reference Object Properties ReportArea The desired SuperReport Pro area MenuID When calling the routine you supply the desired menu structure you wish to display using this parameter After the routine has completed this parameter will receive the selected menultem reference which can be used by other SuperReport Pro commands such as SR Get Virtual Variable When calling the routine you may use one of the following values SR PowerMenu Tables Displays a popup menu of the table structure see SR Structure SR PowerMenu Fields Displays a popup menu of the table field structure see SR Structure SR PowerMenu Variables Displays a popup menu of the variable structure see SR Variables SR PowerMenu Commands Displays a popup menu of the command structure see SR Commands SR PowerMenu Break Object Type Displays a popup menu of the break objects see Variable dialog SR PowerM
148. lid 4 Dimension BLOB variable which will receive the formatted field hierarchical list You may use this BLOB as a 4 Dimension list object where ever hLists are supported gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 122 of 226 Examples The following will create the complete structure list based on the structure configured using SR Structure If the routine was not called the default structure SR Structure Virtual or SR Structure Physical C_BLOB oSR_Data C_LONGINT tableNo SET BLOB SIZE oSR_Data 0 result SR Get Structure As List BLOB eReportArea SR Structure Area Structure oSR_Data hList BLOB To List oSR_Data create a 4D hList object See Also SR Get Field List SR Get Table List SR Get Fields As List BLOB SR Get Tables As List BLOB SR Structure SuperReport Pro Page 123 of 226 SR Get Variables As List BLOB SR Get Variables As List BLOB reportArea L options L resultData O gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report Area Options C_LONGINT Options Result Data C_BLOB Command List BLOB gt ResultCode C_LONGINT Format Number SR Get Variables As List BLOB builds a 4t Dimension hierarchical list BLOB using the reports variable lis
149. llnfo SuperReport Pro Page 13 of 226 2 Installation This chapter outlines the steps necessary for installing SuperReport Pro into your existing applications When installing SuperReport Pro you must have access to the source code version 4t Dimension plugins cannot be installed into compiled applications Plug In Objects Overview SuperReport Pro Plug In The SuperReport Pro plug in contains the plug in area which is placed on the desired 4t Dimension form in which you wish to provide user access as well as all the supporting routines which interact with the SuperReport Pro plug in area Installation Plug In bundle MacOS amp Windows SuperReport Pro is provided as a plug in bundle for 4D 2004 4D v11 SQL 4D v12 or higher This single version will work with MacOS and Windows deployments you don t need separate MacOS and Windows versions 1 Locate the folder where SuperReport Pro has been installed on your computer 2 Locate the 4th Dimension structure where you wish to install the SuperReport Pro plug in 3 If you don t already have a directory labeled Plugins create one now 4 Copy the following plug in to your applications Plugins folder SuperReport Pro bundle SuperReport Pro Page 14 of 226 3 Configuring SuperReport Pro This chapter outlines the steps necessary for configuring SuperReport Pro in your custom applications Since SuperReport Pro is a combination of 4th Dime
150. loper Interface API C_LONGINT SR_AREA SR_AREA SR New Offscreen Area If SR_AREA gt 0 create objects save or print report SR DELETE OFFSCREEN AREA SR_AREA End if See Also SR DELETE OFFSCREEN AREA SuperReport Pro Page 84 of 226 SR DELETE OFFSCREEN AREA SR DELETE OFFSCREEN AREA ReportObjectRef L Parameter Data Type Description ReportObjectRef C_LONGINT Valid offscreen area SR DELETE OFFSCREEN AREA will destroy the report object reference created using SR New Offscreen Area Report Object Reference A valid offscreen report reference created using SR New Offscreen Area Example See SR New Offscreen Area for example of using this routine See Also SR New Offscreen Area SuperReport Pro Page 85 of 226 SR Pro Customizing Each of the following routines provides the ability to customize the SuperReport Pro user access variables or file structure as well as report editor and dialog customization routines Routines included in this section are e SR Get Area Format e SR Set Area Format SR Options e SR Get Options e SR Set Options SR Std Vars SR Structure e SR Variables SR Commands SuperReport Pro Page 86 of 226 SR Get Area Format SR Get Area Format reportArea L areaFormat L gt resultCode L Parameter Data Type ReportArea C_LONGINT AreaFormat C_LONGINT gt ResultCode C_LONGINT Description Report plug in area Report area format Result
151. ltem Line 7 5009 SR Menultem Line 8 Font Size Popup Menu on Report Editor 6001 SR Menultem Font Size 6 6002 SR Menultem Font Size 7 6003 SR Menultem Font Size 8 6004 SR Menultem Font Size 9 6005 SR Menultem Font Size 10 6006 SR Menultem Font Size 11 6007 SR Menultem Font Size 12 6008 SR Menultem Font Size 14 6009 SR Menultem Font Size 18 6010 SR Menultem Font Size 24 6011 SR Menultem Font Size 36 6012 SR Menultem Font Size Smaller 6013 SR Menultem Font Size Larger 6014 SR Menultem Font Size Other Script Database Submenu 7001 SR Menultem Start Script 7002 SR Menultem Body Script 7003 SR Menultem End Script SuperReport Pro Points Mm Inch Font List 2001 number of fonts Color Popup for Pen Color Popup for Fill Pattern Popup for Pen Pattern Popup for Fill Hairline o Ny Aaa FW NY 36 Smaller Larger Other Start Script Submenu Body Script Submenu End Script Submenu Page 219 of 226 Editor Codes Action Types When using the SuperReport Pro Editor Callback interface the callback method will receive one of the following action types parameter 2 Event Code Constant Name Description 1 SR Editor Create Object Activated when a new object is created 2 SR Editor Modify Object Activated when an existing object is modified 3 SR Editor Modify Section Activated when an section is modified 4 SR Editor Modify Object Script Activated when an existing object script is modified 5 SR Edi
152. m lt U applies the underline attribute to the list item Note With the release of SuperReport Pro v2 8 command lists and other related lists are displayed using 4D style hierarchical lists thus the use of other meta characters are not supported and will ignored SuperReport Pro Page 98 of 226 ExeludeThemeArray The name string parameter of a 4 Dimension integer or longint array containing the STR 4 index theme items you wish to exclude from the command list ExeludeCommandArray The name string parameter of a 4 Dimension integer or longint array containing the STR 8 index command items you wish to exclude from the command list gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Examples The following example will create a custom array of commands names using meta characters for custom functions and plug in routines Case of Form event On Load ARRAY STRING 63 aSR_Commands 5 aSR_Commands 1 ALL RECORDS aSR_Commands 2 FIRST RECORD aSR_Commands 3 myFunction lt l aSR_Commands 4 MT ALERT lt B lt l aSR_Commands 5 Z Command result SR Commands eReportArea aSR_Commands End case The following will create the command list based on the 4D commands grouped by theme names
153. may be returned when using routines which interact with disk files such as SR Load Report and SR Save Report Error Code Description 33 Directory full 34 Volume full 35 No such volume or volume not found 36 I O Error occurred 37 Bad Filename 38 File not open 39 End of file no additional data 40 Read Write Error tried to read before beginning of file 41 Memory Full Error file can t be opened 42 too many files open 43 File not found 44 Diskette is write protected volume is locked 46 Volume locked 47 File is busy already open when trying to delete 48 Duplicate Filename 49 File already open with write permissions 51 File reference number invalid SuperReport Pro Page 213 of 226 Section Codes When executing a routine which requires a section code such as SR Print Report or SR Set Sections you can use any of the following codes If you wish to use two or more items in this list add the numbers together to reference each item To include all sections you may pass either a value of 0 or 65535 To include all sections except for specific sections subtract the unwanted section s from 65535 Value Constant Name Description 65535 SR All Sections All Sections 1 SR Section Header Mask Header 2 SR Section SubHeader1 Mask SubHeader1 4 SR Section SubHeader2 Mask SubHeader2 8 SR Section SubHeader3 Mask SubHeader3 16 SR Section SubHeader4 Mask SubHeader4 32 SR Section SubHeader5 Mask SubHeader
154. mit access to only those fields which you wish the user to have access you can also provide a field alias which will be displayed when the user selects the Field selection popup menu WARNING If you have customized the supporting file structure using the SR Structure routine it must be called before calling SR Set Area ReportArea The desired SuperReport Pro area Structure Array Name The name this is a string parameter not the actual array of the array which contains the new structure view using the SuperReport Pro structure format lt menu number gt lt table number gt lt field number gt lt virtual name gt menu number allows you to build a hierarchical menu table number the desired 4 Dimension table number you wish to use field number the corresponding 4 Dimension field number you wish to use Passing a value of 0 will include all fields for the defined table virtual name the alias name for the desired table or fieldname Failure to supply the table name parent menu name will result in the creation of a menu that contains a blank parent menu and SuperReport Pro will not be able to correctly create the table list used by Main Table Iterations in the SuperReport Pro Editor therefore you need to make sure the table name is supplied when creating the parent menu entry SuperReport Pro Page 94 of 226 Options Structure definition options You may use one or more of the following v
155. mpty tables not fields or indexed fields 16 SR Structure Sort By Name Sort result array by name 256 SR Structure Mark Indexed Returns marked indexed attribute 512 SR Structure Mark Invisible Returns marked invisible attribute gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will fill two 4D arrays with the table name and table number list for the defined report area ARRAY STRING 32 asSR_Tablenames 0 ARRAY LONGINT aiSR_Tablenumbers 0 SR_Err SR Get Table List eReport asSR_Tablenames aiSR_Tablenumbers SR Structure Area Structure See Also SR Get Field List SR Get Fields As List BLOB SR Get Tables As List BLOB SR Get Structure As List BLOB SR Structure SuperReport Pro Page 114 of 226 SR Get Field List SR Get Field List reportArea L menuID L tableNameList X tableNoList X options L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report Area MenuID C_LONGINT MenuID FieldnameList ARRAY STRING Fieldname Array FieldnumberList ARRAY INTEGER or ARRAY LONGINT Field number Array FieldTypeList ARRAY INTEGER or ARRAY LONGINT Field Type Array FieldAttribList ARRAY INTEGER or ARRAY LONGINT Field Attributes Array Options C_LON
156. n Object foreground pattern 0 32 BackPattern Object background pattern 0 32 Line Thickness Object line thickness when SR Object Type Line or SR Object Type Rectangle Valid range of 1 9 1 equals hairline ForeColor Object foreground color using 4Ds style of expressing RGB colors 0xOORRGGBB BackColor Object background color using 4Ds style of expressing RGB colors 0xOORRGGBB SuperReport Pro Page 192 of 226 Varlype Object variable type This parameter is only used when the ObjType is SR Object Type Variable You may choose one of the following variable types 1 SR Variable Type Variable 2 SR Variable Type Array Auto 3 SR Variable Type Array Element ArrayElem Desired array element when the ObjType is SR Object Type Variable and the VarType is SR Variable Type Array Element CalcType Desired calculation option This parameter is only used when the ObjType is SR Object Type Field or SR Object Type Variable You may choose one of the following values 0 SR Calculation Type None 1 SR Calculation Type Total 2 SR Calculation Type Min 3 SR Calculation Type Average 4 SR Calculation Type Max CalcName Name of the variable to store calculation This parameter is only used when the Options is SR Obj Flag Use Calc Value Rows Number of rows in a rectangle grid This parameter is only used when the ObjType is SR Object Type Rectangle
157. n alphabetical order within it respective theme ARRAY LONGINT aiSR_Theme 1 aiSR_Theme 1 7 Compiler ARRAY LONGINT aiSR_Command 3 aiSR_Command 1 58 aiSR_Command 2 66 aiSR_Command 3 96 opts SR Commands By Theme SR Commands Sort First Level SR Commands Sort Second Level result SR Get Commands As List BLOB eReportArea opts oSR_Data aiSR_Theme aiSR_Command hList BLOB To List oSR_Data create a 4D hList object See Also SR Commands SuperReport Pro Page 118 of 226 SR Get Tables As List BLOB SR Get Tables As List BLOB reportArea L options L resultData O gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report Area Options C_LONGINT Options Result Data C_BLOB Command List BLOB gt ResultCode C_LONGINT Format Number SR Get Commands As List BLOB builds a 4 Dimension hierarchical list BLOB using the table list see SR Structure Item Reference for each item is as follows e itemRef in each list item is the table number This routine is used internally by the SuperReport Pro dialogs and may be used when creating customized report interface For more information on creating customized report interface please refer to Chapter 6 Command Reference Object Properties ReportArea The desired SuperReport Pro area Options Options for building table lists You may choose one of the following values 0 SR Structure Physical Use physical structu
158. n TIDE 5355 cyseccst tec cdec tet tencedeett cc belsaeesausvensatoden tessavs Mined tes oe 129 SR Main TADIE 2 cece ecccececccececcccccccecececececceccsccescecececesesesesenananananas 13 SROM EV CU voc sa genttssnttvienvtens A E 132 SR Power MON siicostdscscncesdeensactoaccinbssiccdenacavesssaateaccbeedcaadewncbehianaacds 136 SRRRELA TIONS sicisaristetictsasacessaesianess ceieossesaeeieal a E 139 SRISSTMOCIEY ssd sstesisveced tvicstssritesvedebisesaisaivendv iets Ueessineteoesvagavtencesdes tess 140 Page 5 of 226 Chapter 7 SuperReport Pro SR Get Tips Enabled 00 0 ceeecesesssccccceccecsessnsecececcececsessnsnseeeeeeeeeees 141 SR SET TIRS ENABLED iu cixnes dorearen senere riirii PAn n i eOr AEE ENA E S 142 SR SWAP HANDLES deprecated sssssersseresesssseesssreessssseesssse 143 SR ROHOM TO BLOB i esacseees iets ashi davsnioss actis tenders tented weeks 144 SuperReport Pro PANINO secccceesscecsssssececeessececcesseeecessteeeeeeeaees 145 SR Get Number Of PAJOS ccesscccsssssseceesssecessssnsecsssenssecsssenes 146 SR PAJE SSI ieie arire e aaa EE A ERREA EEE EAAS 148 SIR PIG VIGW giaren aane en ae Sea E cuasenieboessiia ENEAS 149 SR Print DISK asemiaan neiiinas e RRD EE EI EEIN 151 SRA in eyo e E AR EOS 154 SR Print REPOrt ssseessssseesssserssesseesssseessesecosssseessnsetessrseesseseessssseessene 156 SR Pia lie FNAL oe sah tceea unt ae A EE EE 158 SR Print T BLOB lt cecccisasscsseeezsecterdewssastactuaaccva
159. n integer or longint array containing the STR 4 index theme items you wish to exclude from the command list ExeludeCommandArray A 4 Dimension integer or longint array containing the STR 8 index command items you wish to exclude from the command list gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 117 of 226 Examples The following will create the command list based on the 4D commands sorting the list by Theme name C_BLOB oSR_Data SET BLOB SIZE oSR_Data 0 result SR Get Commands As List BLOB eReportArea SR Commands By Theme oSR_Data hList BLOB To List oSR_Data create a 4D hList object The following example will create the command list based on 4D commands sorting the list by Theme name and excluding compiler directives ARRAY LONGINT aiSR_Theme 1 aiSR_Theme 1 7 Compiler result SR Get Commands As List BLOB eReportArea SR Commands By Theme oSR_Data aiSR_Theme hList BLOB To List oSR_Data create a 4D hList object The following example will build on the previous example and include a list of individual routines which should be omitted any delete record action from the command list The result list will be sorted by Theme name and each routine will be i
160. nd on next page to convert SRP objects from picture format to Blobs SuperReport Pro Page 143 of 226 SR Report To BLOB New v2 9 SR Report To BLOB picture P gt blob O Parameter Data Type Description picture C_PICTURE Source PICT object gt blob C_BLOB Resulting blob SR Report To BLOB converts SRP objects stored in pictures with previous SuperReport Pro versions to the Blob format Versions 2 9 and above store SRP report templates into Blob fields Picture objects are no longer used The UpdateStract_Pict2blob project method in the SRP demonstration database preforms this conversion Example The following example converts all reports stored in the RM_Reports RM_PictureField picture field into the RM_Reports RM_BlobField blob field for further use with SRP 2 9 and above READ WRITE RM_Reports ALL RECORDS RM_Reports While Not End selection RM_Reports RM_Reports RM_BlobField SR Report To BLOB RM_Reports RM_PictureField SAVE RECORD RM_Reports NEXT RECORD RM_Reports End while SuperReport Pro Page 144 of 226 SR Pro Printing Each of the following routines provides the ability to procedurally configure and print reports created by SuperReport Pro Routines included in this section are e SR Get Number Of Pages SR Page Setup e SR Preview SR Print Disk SR Print PICT SR Print Report e SR Print HTML e SR Print BLOB e SR Validate SuperReport Pro Page 145 of 226
161. nd make sure you have completed the related steps Step 9 Select Print or Print Preview from the File menu to print your report If you don t see any data you will need to perform Step 6 again to establish a selection SuperReport Pro does not maintain the selection you will need to perform this task yourself before you print your reports SuperReport Pro Page 47 of 226 Creating a basic form report Congratulations you have successfully created your first report Now we ll create a little more complex report a form report Like the listing report we just created you ll make use of the SuperReport Pro section markers In addition we ll introduce a new dialog the Section Definition dialog Using the Section Definition dialog you can customize the way SuperReport Pro prints your report In the case of a form report we don t want the records to print one after another as they were in the listing report Instead we want to have each record appear on it s own page The following steps will outline how to create a form report so that each record is printed on a separate page Since you have already learned how to place objects on a report we ate going to skip that portion and concentrate on the specific of creating a form report Step 1 Using the SuperReport Pro demo modify the Customer Details record This contains a basic form report In addition you are welcome to create your own report moving the body section down a
162. ndow type you specify has a close box for this feature to work SuperReport Pro posts a mouse down event in the window s close box when the X button is pressed Report Object A valid SuperReport Pro Object This is not the actual SuperReport Pro area but rather the report object as it would be stored in a 4t Dimension BLOB field or variable Left Left coordinate for preview window Top Top coordinate for preview window Right Right coordinate for preview window Bottom Bottom coordinate for preview window Window Type Window type for preview window The window type parameter is the same as that used by the 4 Dimension Open window or Open external window routine For more information on window types please refer to the 4 Dimension Language Reference Window Title Window title for preview window Options Bitwise operator to customize the functionality of the preview operation 0 No options default 1 Perform preview in modal state user must close window before continuing 2 Open window in zoomed state Passing a value of zero or omitting the parameter will display the preview window and then continue code execution Passing a value of one will display the preview window and halt code execution until the preview window is closed gt Result Code If the ModalFiag is set to 1 the result value will be zero when the window is closed If the Moda F ag is set to 0 the routine will return a
163. ng HTML Reports There are three different ways in which you can print your reports in HTML format The first method uses the SuperReport Pro Editor Step 1 Select Print To Disk for the File menu Step 2 Select Output As HTML for the Output Options section SRPro Print To Disk Options Print Report To Disk Options Sections To Be Printed All Sections Print Static Text Items QO Body Section Only Output Options Output as HTML File QO Output as Standard Text Field amp Record Section Delimiters Between Fields 9 ASCII Value End Of Record 13 ASCII Value LCa Figure 7 SuperReport Pro Print To Disk Dialog The second method is to use the SR Print HTML command For more information on the options available when call SR Print HTML please refer to Chapter 6 Command Reference err SR Print HTML pSR_Report report html 0 SR All Sections The third method is to use the SR Print BLOB command For more information on the options available when call SR Print BLOB please refer to Chapter 6 Command Reference C_BLOB oSR_Report SET BLOB SIZE oSR_Report 0 err SR Print To BLOB pSR_Report oSR_Report SR PrintToBLOB Output HTML SR All Sections 9 13 SuperReport Pro Page 32 of 226 5 Tutorial Well now that you have completed the installation and configuration process it is time to begin using SuperReport Pro This section provides various examples of
164. no rea Ere EE E EEES sess 74 SR Pro ACCESS ROUTINES sssessseeseseesssssseeseeeeresseserereeesssssserreeereesessesene 75 FSUPEIREPOMT ccececccccccccecsesssssssececececsessesssseseeeceeceesessstsseseceeeeesenenes 76 SR GELATO 0 Deena Pee en oe Pe a oe er eee ee 78 SR SOT ACO A Gasveeeddicdsdecsiansrccccadenssctes 79 SR DOG RED OM nisin raen E EE 80 SR Load RED OMT sssvisiscccssdsscvccasssesseedssdevaysv ches sies Ccdsaveaeecasseebioacsascdensiae 81 SR SOV ES REDON wisasovvnsvvcsssn0veedervsovsedsvesehssivvectentspendeherscocsdeioiventgceieesy 82 SR New REDON wesscscecctacasccvcssnsdeavadespedesass senadeacenccescoeveantdaesnavecedoovecees 83 SR New Offscreen AL cccceccccccccecsessessssececececcecsesssneseeeceeeeesenenes 84 SR DELETE OFFSCREEN AREA isic isi ckiiiiaedd Badivelieidinelebvadon ieeaseens 85 SuperReport Pro CUSTOMIZING seseesssseeesseseessssesesseseesssseesssoseessesees 86 SR Gef Area FOPMOL ssisssccssssseedvsscevvecssesevseedeacessevacccasccvscsesccevecesaecses 87 SR SET Area FOMA onrera ieii a A R ET EEE 88 SR OPtONS eececsesssceccccececsessssecsececececeessessaeeeeececcecsenessseseceeeeesenenes 89 SR Get OPTIONS ccccecsssseesscccecccecsenssssseccessceccecssseseeeescescecsenseee 90 SR Set OPTIONS seinere aariaa aa aii 91 SR STA VOIS aee E N A E 93 SRS MUCIUS iioii aiia O ELAN REE NEA T EEEN E 94 SR VANADES aeeoe tnae E EEEREN orani 96 SR COMMANA S siener E EEEN ER 98 SuperReport Pro MENUS es
165. nsion procedures layouts and external routines it is important that these steps be completed before using SuperReport Pro For additional information on using SuperReport Pro please refer to the Chapter 5 Tutorial as it provides a variety of examples on using SuperReport Pro Declaring SuperReport Pro Variables In addition to the various plug in routines SuperReport Pro contains a set of variables which are provided as a method for communicating with your code Each of these variables must be properly declared and initialized in process in which you are using SuperReport Pro Step 1 Add the following code segment to each routine that is started via the New Process command in which you wish to use SuperReport Pro If you are not using the New Process command to display the forms which contain the SuperReport Pro plug in area you should declare these variables in your applications On Startup method C_DATE SRDate contains the current date C_TIME SRTime contains the current time C_LONGINT SRPage contains the current page number C_LONGINT SRRecord contains the current record number or iteration SuperReport Pro Variables There are a number of internal variables used by SuperReport Pro The following is a description of each variable and their usage during reporting operations If you wish to replace the default SuperReport Pro variables providing a more descriptive representation for users as it relates to your ap
166. nultem Preview Menultem Page Setup Menultem Print Menultem Zoom MenulItem Undo Menultem Cut Menultem Copy Menultem Paste Menultem Clear Menultem Select All Menultem Duplicate Menultem Modify Object Menultem Change Object Menultem Position Object Menultem Modify Section Menultem Position Sections Menultem Activate Section Menultem Bring To Front Menultem Bring Forward Menultem Send To Back Menultem Send Backwards Description not displayed when valid registration number entered About SuperReport Pro New Report Open from Disk Close Save to Disk Save to Disk As Print To Disk Print Preview Page Setup Print Zoom Window Undo Cut Copy Paste Clear Select All Duplicate Modify Object Change Object Position Object Modify Section Position Selections Add Delete Sections Bring To Front Bring Forward Send To Back Send Backwards Page 217 of 226 Options Menu 301 SR Menultem Use Physical Page 302 SR Menultem Use Printable Area 303 SR Menultem Rulers 304 SR Menultem Ruler Units 305 SR Menultem Grid 306 SR Menultem Guides 307 SR Menultem Lock Guides 308 SR Menultem Sections 309 SR Menultem Lock Sections 310 SR Menultem Margins 311 SR Menultem Object Borders 312 SR Menultem Show Object Border 313 SR Menultem Show Object Alias Database Menu 401 SR Menultem Main Table 402 SR Menultem Select Records 403 SR Menultem Order Records 404 SR Menultem P
167. o Preview mode 21 SR Preview Mode Switched from Preview mode to Editor mode 30 SR Preview First Page In preview First page option selected 31 SR Preview Previous Page In preview Previous page option selected 32 SR Preview Next Page In preview Next page option selected 33 SR Preview Last Page In preview Last page option selected 34 SR Preview Print Page In preview Print one page option selected 35 SR Close Preview In preview Close preview selected event 21 can be generated instead 40 SR Menu Item Selected Before Menu Item Selected Before 41 SR Menu Item Selected After Menu Item Selected After Warning Be careful when dealing with zoomed areas since a zoomed window and original areas have different references even if one is a zoomed window of the other When you receive the Area Zoomed event value of 11 make a note of the zoomed window s reference number by taking it from the Additional Information 34 item parameter SuperReport Pro Page 133 of 226 Example The following example is a sample callback method executing an ALERT call for each event raised by a given SuperReport Pro atea After the callback method is executed a Command or Control on Window event will be executed triggering an invisible button with the same keyboard equivelant iSR_Err SR On Event eReportArea 0 SR_ON_EVENT Ascii PM SR_ON_EVENT
168. ode C_LONGINT Result Code SR Set Script Callback installs a callback method that will be used in place of the default script editor for processing of report scripts This interface provides application developers with an interface for processing scripts which are not possible using standard EXECUTE style interface For example if you are using an enhanced scripting control system such as FootRunner you create more complex scripts including complete conditional support and pass that script along to FootRunner at print time for processing ReportArea The desired SuperReport Pro area Passing a value of zero 0 will install the callback method for all report processing Callback Method A valid 4 Dimension method which will be executed whenever an area script is executed gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below gt Result Code The return value will determine how SuperReport Pro will respond after your custom editor code has been executed 0 Return a value of zero if you have handled the editor event 1 Return a value of one if you wish to have SuperReport Pro handle the event the same action as if the callback method was not installed SuperReport Pro Page 167 of 226 Example The following exam
169. of ASCII 58 while Windows directories are delimited with a character One approach to dealing with these differences is to use a 4t Dimension variable which contains the delimiter delim Char 58 default Macintosh delimiter If sWindows delim Char 92 End if Then you could use the 4 Dimension function Application file or Structure file to return the pathname to either the application or structure file as starting point to determine the pathname to a Reports directory For some useful routines for obtaining the parent pathname for an application or structure file refer to the 4 Dimension Language Reference C_TEXT tStructPath tReportPath tStructPath 7C_HFSParentName Structure file TC_HFSParentName is from Toolchest from ASG tReportPath tStructPath Reports delim myReport srp iSR_Err SR Save Report pSR_Report tReportPath SuperReport Pro Page 28 of 226 Dealing with Print Drivers Due the large number of print drivers available for Windows unlike the standard LaserWriter driver available for Macintosh configuring reports for most printers can be a very difficult task The following is a list of some tips which can make designing your reports a manageable job 1 Try to leave at least 1 4 margin on the edges of your reports to account for wide variety of print drivers Stick with common fonts most Windows applications have fonts such as Arial or Times Roman 3 Be careful of using
170. of the accumulative sections When activating sections the Header Body Footer and Total sections will always be active regardless of any settings you make to the contrary as they are required sections which can t be removed For complete details on valid section codes please refer to Chapter 7 SuperReport Pro Codes Section Codes ReportArea The desired SuperReport Pro area Active Sections The desired sections you would like available on the report area Print Sections The desired sections you would like available on the report area gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will enable Subheader 1 and SubTotal 1 C_LONGINT iSR_Sections iSR_PrintSections iSR_Sections SR Section SubHeader1 Mask SR Section SubTotal1 Mask iSR_PrintSections O use all available print sections SR_Err SR Set Sections SR_AREA iSR_Sections iSR_PrintSections See Also SR Get Sections SR Set Section Properties SuperReport Pro Page 202 of 226 SR Get Section IDs SR Get Section IDs reportArea L sectionID L sectionID X gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Section ID C_LONGINT Report Section ID to obtain properties Se
171. ons parameter is used to control which sections of the report ate printed assuming that you have not specified the Body section only using the options parameter To print specific sections pass the sum of the section numbers that you require which are listed in the Chapter 7 SuperReport Pro Codes Section Codes You may choose one or more of the following 0 SR All Sections 1 SR Section Header Mask 2 SR Section SubHeader1 Mask 4 SR Section SubHeader2 Mask 8 SR Section SubHeader3 Mask 16 SR Section SubHeader4 Mask 32 SR Section SubHeader5 Mask 64 SR Section SubHeader6 Mask 128 SR Section Body Mask 256 SR Section SubTotal6 Mask 512 SR Section SubTotal5 Mask 1024 SR Section SubTotal4 Mask 2048 SR Section SubTotal3 Mask 4096 SR Section SubTotal2 Mask 8192 SR Section SubTotall Mask 16384 SR Section Total Mask 32768 SR Section Footer Mask SuperReport Pro Page 158 of 226 Object Order When printing to disk you may determine the order in which objects are printed You may choose one of the following values 0 SR Generic Option Set Off Use print order see SR Reorder Objects for more information 1 SR Generic Option Set On Use object order top left coordinate gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list
172. ortArea L sectionID L sectionScript T htmlPre T htmlPost T gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Section ID C_LONGINT Report section ID Section Script C_TEXT Section Script Section HTML Start C_TEXT HTML Start Block Section HTML End C_TEXT HTML End Block gt ResultCode C_LONGINT Result Code SR Get Section Scripts will retrieve the section script and HTML information for the defined section ReportArea The desired SuperReport Pro area Section ID A valid SuperReport Pro section i e SR Section Body or SR Section Header For a complete list of sections please refer to Chapter 7 SuperReport Pro Codes Section Codes Section Script A valid 4 Dimension variable which will receive the section script Section HTML Start A valid 4 Dimension variable which will receive the sections start HTML block Section HTML End A valid 4 Dimension variable which will receive the sections end HTML block gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will retrieve the section script and HTML data C_TEXT tSR_Script tSR_HTMLStart tSR_ HTMLEnd SR_Err SR Get Section Scripts SR_AREA SR Section Body tSR_ Script tSR_ HTMLStart tS
173. ortArea L startScript T bodyScript T endScript T gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Start Script C_TEXT Report Start Script Body Script C_TEXT Report Body Script End Script C_TEXT Report End Script gt ResultCode C_LONGINT Result Code SR Get Scripts will return each of the scripts associated to the report area configured in database menu ReportArea The desired SuperReport Pro area Start Script A valid 4 Dimension variable which will receive the script associated to the Start script Body Script A valid 4 Dimension variable which will receive the script associated to the Body script End Script A valid 4 Dimension variable which will receive the script associated to the End script gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will return the database scripts Start Body and End for the desired report area C_TEXT tSR_StartScript tSR_BodyScript tSR_EndScript SR_Err SR Get Scripts SR_AREA tSR_StartScript tSR_BodyScript tSR_EndScript See Also SR Set Scripts SuperReport Pro Page 198 of 226 SR Set Scripts SR Set Scripts reportArea L startScript T bodyScript T endScript T gt result L Parame
174. ou still have control over the way in which SuperReport Pro builds the command list When using an empty string as the arrayName parameter you may choose to use one or more of the additional formatting options NOTE You can use standard Macintosh meta characters in the command array to better distinguish the routines See the example below for more information ReportArea The desired SuperReport Pro area Command Array Name The name this is a string parameter not the actual array of the string array which contains the list of commands Passing a null string will cause SuperReport Pro to build the command list use the current list of 4D Commands Options When passing an empty string as the array name SuperReport Pro will build the command list based on one of the following conditions using the entire 4D Command List You may choose one or more of the following values 0 SR Commands By First Char Group commands by first character of routine name 1 SR Commands By Theme Group commands by theme name 4 SR Commands Sort Second Level Sort commands by second level 8 SR Commands Sort First Level Sort first level when grouping by first char first level is always sorted When building the command list you can conditionally format the list items by using one of the following meta characters lt B applies the bold attribute to the list item lt I applies the italic attribute to the list ite
175. owing steps will convert an existing report the Basic Listing Report created in the first example to be suitable for HTML output Step 1 Select Database Scripts Start Script and enter the following code This will establish some variables which are used within the HTML report as well as establish a record selection to print tBegTagHTML lt html gt lt body bgcolor ffffff gt tEndTagHTML lt body gt lt html gt ALL RECORDS Customer ORDER BY Customer Customer Code gt SuperReport Pro Page 59 of 226 Step 2 The next step will be to configure the Header section which is where you assign the standard HTML header information In addition to standard HTML tags we ll introduce the feature of using 4 Dimension variables as HTML token variables Double click on the Header object select the HTML Data button and enter the following text lt tBegTagHTML gt lt table border 1 width 100 gt SRPro Section Properties HTML Data Section Head Header HTML Begin Tag lt tBegTagHTML gt lt table border 1 width 100 gt Header HTML End Tag Figure 31 SuperReport Pro Header Section HTML Data The lt 3tBegTagHTML amp gt section tells SuperReport Pro to insert the contents of the variable tBegTagHTML when this report is printed in HTML format The next line will create a standard HTML table to display our data Since we are creating a listing st
176. perReport Pro Section Dialog SuperReport Pro Page 53 of 226 Step 3 Now well place the fields and labels in the respective sections Header Section Invoice Sales Report Report Date SubHeader 1 Section field headers Invoice No Date Total Body Section Invoice Number Invoice CreateDate Invoice Total Invoice PayDays SubTotal 1 Section Subtotals Total Line vTotalTxt Invoice Total Total Section Report Totals Grand Total Invoice Total Double Lines Footer Section Page Number Static Text Item Variable Static Text Item Static Text Item Static Text Item Field Object Field Object Field Object Field Object Line Object Variable Object Field Object Static Text Object Field Object Line Objects two separate lines Variable Object uses SRPage variable Once you have completed adding all the objects you report should look something like this The shading on the Body section marker signifies that a script has been attached to this object we ll add this script next Invoice Sales Report inus Header fares CreateDate SubHeader 1 vody SubTotal 1 Total SuperReport Pro Footer Total EE Pa as Pat Page 54 of 226 Step 4 Step 5 The next step will be to configure the Body section script to set the vTotalTxt variable located in the SubTotal 1 section Double click on the Body section marker to display the Section
177. ple will install the 4t Dimension method SR_ScriptCallback which will be executed whenever a SuperReport Pro script is called SR_Err SR Set Editor Callback 0 SR_EditorCallback install the script globally Sample Callback Method The following is a sample callback method which could be used when installing an editor callback method PM SR_EXECUTE scriptData T LM 06 17 02 mse Invoked ret SR Set Script Callback eSRArea SR_EXECUTE C_TEXT 1 SR_SCRIPT SR_SCRIPT 1 SR_CMD bUseFoot True set to false if you don t want to process code with FootRunner If bUseFoot ret FRAppendChecksum SR_SCRIPT ret FRRunText SR_SCRIPT Else if you are going to simply pass to 4Ds EXECUTE command you must parse the script into separate lines as the EXECUTE command requires a single command ARRAY TEXT atSR_ScriptCmd 0 TC_Parse SR_SCRIPT Char 13 gt atSR_ScriptCmd For i 1 Size of array atSR_ScriptCmd SR_CMD atSR_ScriptCmd i EXECUTE SR_CMD End for End if SuperReport Pro Page 168 of 226 Sample Enhanced Script When using a custom script executor such as above your reports can include complex scripts such as the following In this script we are conditionally setting the appears of the Invoice Total object based on the current value In addition you will notice that we are calling some customized routines which are written in 4D to provide simple wrapper routines for
178. plication you can use the SR Std Vars routine In addition each of these variables can be used in any callback procedure which is executed by SuperReport Pro during a printing operation Variable Name Data Type Description SRArea C_LONGINT Current report area reference can be used in callback scripts SRDate C_DATE Cosntains the current date SRTime C_LONGINT Contains the current time SRObjectID C_LONIGNT Contains the current object for which you have a script attached SRPage C_LONGINT Contains the current page SRRecord C_LONGINT Contains the current record number or iteration value SuperReport Pro Page 15 of 226 4 SuperReport Pro Fundamentals This chapter outlines the fundamentals of using SuperReport Pro including e An overview of creating SuperReport Pro areas e Customizing the SuperReport Pro area Extending SuperReport Pro with object scripts e Understanding the SuperReport Pro Event Cycle Dealing with multi platform issues e HTML Support For detailed information on using the SuperReport Pro commands please refer to Chapter 6 Command Reference SuperReport Pro Page 16 of 226 Creating SuperReport Pro Areas There are two different ways in which a SuperReport Pro area can be presented to your users e Using the 4t Dimension Open external window command e Displaying a 4 Dimension form either via a dialog or input form Using as External Window If you wish to use SuperReport Pro in an exte
179. port Pro Codes Menu Numbers Text The desired menu item text for the defined SuperReport Pro menu number Enable Flag Enable flag for the defined SuperReport Pro menu number 0 Disable menu item 1 Enable menu item SuperReport Pro Page 105 of 226 Mark The desired menu item mark for the defined SuperReport Pro menu number 0 No mark 18 Check mark 19 Diamond mark NOTE When using this routine on Windows to set the Mark parameter only the checkmark value will be used all other characters area ignored Override Method The desired 4t Dimension method which will be executed when the menu item is selected If you wish to clear as the Override Method parameter 6699 the override method pass a null string gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Examples The following example will replace the default action of the New command on the File menu to execute the MyDoNew method C_LONGINT iSRProMenu iEnabled C_STRING 255 sltemText sMark sProcName iSRProMenu 101 FilelNew sltemText sMark sProcName iSR_Err SR Menu Item eReportArea 0 iSRProMenu sitemT ext iEnabled sMark sProcName If SR_Err 0 make sure no error occurred If sProcName se
180. r up to 10 users The registration key is linked to your 4D Server license just as above Medium server This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Server up with 11 to 20 users The registration key is linked to your 4D Server license just as above Large server This license allows development interpreted mode or deployment interpreted or compiled mode on 4D Server over 20 users The registration key is linked to your 4D Server license just as above Unlimited Single User This license allows development interpreted mode or deployment interpreted or compiled mode on as many 4D Standalone Runtime or Engine copies that run your 4D application s This is a yearly license which expires after the date when it is to be renewed The expiration only affects interpreted mode Compiled applications using an obsolete license will never expire Unlimited OEM This license allows development interpreted mode or deployment interpreted or compiled mode on as many 4D Server of any umber of users 4D Standalone Runtime or Engine copies that run your 4D application s This is a yearly license which expires after the date when it is to be renewed The expiration only affects interpreted mode Compiled applications using an obsolete license will never expire A 4D database used to retrieve your 4D serial information is available from the following link http www e node net ftp GetSeria
181. rReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 129 of 226 Examples The following example will set the iterations based on the current selection of the Customers table C_BLOB pSR_Report C_LONGINT iSR_Err iSR_Result iSR_Err SR Main Table pSR_Report 1 Table gt Customers The following example will set the iterations based on the size of the aReportData array C_BLOB pSR_Report C_LONGINT iSR_Err iSR_Result ARRAY TEXT aReportData 3 aReportData 1 item1 aReportData 2 item2 aReportData 3 item3 iSR_Err SR Main Table pSR_Report 8 0 aReportData The following example will return the current iteration value C_BLOB pSR_Report C_LONGINT iSR_Err iSR_Result iSR_Iterations iSR_Err SR Main Table pSR_Report 0 iSR_Iterations The following example will create a new report set the main file to current selection of the Customer table and place the new report in the defined SuperReport Pro area C_BLOB pSR_Report C_LONGINT iSR_Err iSR_Result C_LONGINT iSR_MainFile Case of Form event On Load iSR_MainFile T able gt Customers iSR_Err SR New Report pSR_Report iSR_Err SR Main Table pSR_Report 1 iSR_MainFile aReportData iSR_Err SR Set Area eReportArea pSR_Report copy the new report to the SR Pro area End case See Also SR Ma
182. rds menu item is selected you could supply a replacement 4 Dimension method that will be executed instead of the default action when the menu item is selected The following code will configure SuperReport Pro to display a custom 4 Dimension method myQuery when the Select Records menu item is selected C_LONGINT iSRProMenu iSRProMenu 402 Select Records menu number iSR_Err SR Menu Item eReportArea 1 iSRProMenu 0 0 myQuery SuperReport Pro Page 23 of 226 Customizing Report Editor The last item of customization we ll cover is the SuperReport Pro Editor Using the SR Set Options command you can customize a variety of items which affect the way the SuperReport Pro Editor is displayed In this example we ll only cover a few of the customization options available using the SR Options command For more details on using SR Set Options please refer to Chapter 6 Command Reference In your forms On Load event call the SR Set Options routine supplying the SuperReport Pro area reference and the desired customization options The following example will disable access to scripts C_BLOB pReportData Case of Form event On Load iSR_Err SR New Report pReportData iSR_Err SR Set Area eReportArea pReportData iSR_Err SR Options eReportArea 1 1 1 End case The following example will disable the zoom window and disable access to HTML buttons C_BLOB pReportData Case of Form event On Load
183. re area is ignored 1 SR Structure Virtual Use virtual structure area is ignored 2 SR Structure Area Structure Use structure set by SR Structure If not set SR Structure Physical SR Structure Virtual are checked 4 SR Structure Get Invisible Include invisible tables 8 SR Structure Get Empty Tables Include empty tables not fields or indexed fields 16 SR Structure Sort By Name Sort result array by name Result Data A valid 4 Dimension BLOB variable which will receive the formatted table hierarchical list You may use this BLOB as a 4 Dimension list object where ever hLists are supported gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Examples The following will create the table list based on the structure configured using SR Structure If the routine was not called the default structure SR Structure Virtual or SR Structure Physical C_BLOB oSR_Data SET BLOB SIZE oSR_Data 0 result SR Get Tables As List BLOB eReportArea SR Structure Area Structure oSR_Data hList BLOB To List oSR_Data create a 4D hList object See Also SR Get Field List SR Get Fields As List BLOB SR Get Structure As List BLOB SR Structure SuperReport Pro Page 119 of 226 SR Get
184. re Name PostKey C_LONGINT Postkey Modifier gt ResultCode C_LONGINT Result Code SR On Event allows you to install a custom callback procedure which will be executed each time an event occurs while using the SuperReport Pro area Warning You must not destroy the area close the form or external window or modify the area in any way otherwise you may provoke a system crash ReportArea The desired SuperReport Pro area You must pass a valid SuperReport Pro area as the callback routine is installed for the defined SuperReport Pro area only it is not a global callback for all SuperReport Pro areas Filter This parameter is reserved for future use You should pass a value of zero 0 to this parameter Callback Method A valid 4 Dimension method which will be executed when events occur within the defined SuperReport Pro area The callback method must contain the following header Parameter 1 1 C_LONGINT Area Reference the SuperReport Pro area which raised the event Parameter 2 2 C_LONGINT Event Type see list below for a listing of possible events Parameter 3 3 C_LONGINT Additional Information see list below for a list of possible values Postkey The postkey parameter allows you to specify which Command Key on Macintosh or Control Key on Windows sequence should be generated when a SuperReport Pro event occurs By placing an invisible button with the same Command key equivalent on layout containing
185. ri May 1 1998 429 84 Within 30 Days Figure 24 SuperReport Pro Repeating Example Preview If you would like to review this report use the SuperReport Pro Demo and open the Customer Details With Inventory History sample record SuperReport Pro Page 51 of 226 Creating a break processing report SuperReport Pro provides a very powerful break processing reporting system providing up to six 6 break levels Using a break processing you could create a report that allows you to print a list of invoices sorted by customer Step 1 The first step will be to define the Main File for our report Select Report File Iterations from the Database menu and select Invoice Main Table Iterations E Invoice E item QO Fixed Number Of Iterations Value C g Q Use Value In Variable Name ja Q Use Size Of Array Name ae Ce a Figure 25 SuperReport Pro Main Table Iterations Dialog SuperReport Pro Page 52 of 226 Step 2 The next step will be to setup the sections so that we are going to be using on this report Select Add Delete Section from the Edit menu When the Section Definition dialog is displayed double click the SubHeader 1 and SubTotal 1 items Note Sections with bold attributes cannot be deactivated and will always be active RPro Activate Sections Active Report Sections Y Subheader 1 Y Subheader 2 Y Subheader 3 y Subheader 4 y Subheader 5 Y Subheader 6 Figure 26 Su
186. rint Sections 405 SR Menultem Scripts Modify Selection Submenu 1001 SR Menultem Header 1002 SR Menultem SubHeader1 1003 SR Menultem SubHeader2 1004 SR Menultem SubHeader3 1005 SR Menultem SubHeader4 1006 SR Menultem SubHeader5 1007 SR Menultem SubHeader6 1008 SR Menultem Body 1009 SR Menultem SubTotal6 1010 SR Menultem SubTotal5 1011 SR Menultem SubTotal4 1012 SR Menultem SubTotal3 1013 SR Menultem SubTotal2 1014 SR Menultem SubTotal1 1015 SR Menultem Total 1016 SR Menultem Footer SuperReport Pro Use Physical Page Use Printable Page Show Rulers Ruler Units Show Grid Show Guides Lock Guides Show Sections Lock Sections Show Margins Show Object Borders Show Object Order Show Object Alias Report File Iterations or Select File Select Records Sort Selection Select Printing Sections Scripts Header SubHeader1 SubHeader2 SubHeader3 SubHeader4 SubHeader5 SubHeader6 Body SubTotal6 SubTotal5 SubTotal4 SubTotal3 SubTotal2 SubTotal1 Total Footer Page 218 of 226 Ruler Units Submenu 1101 SR Menultem Ruler Points 1102 SR Menultem Ruler Millimeter 1103 SR Menultem Inches 2001 n 3001 3256 3001 3256 4001 4016 4001 4016 Line Thickness Popup Menu on Report Editor 5001 SR Menultem Line Hair 5002 SR Menultem Line 1 5003 SR Menultem Line 2 5004 SR Menultem Line 3 5005 SR Menultem Line 4 5006 SR Menultem Line 5 5007 SR Menultem Line 6 5008 SR Menu
187. rnal window you simply need to call the 4 Dimension Open external window routine C_LONGINT iSR_Win iSR_Win Open external window 50 50 400 400 8 SuperReport Pro SuperReport SuperReport Pro Page 17 of 226 Using on 4th Dimension Form The most common way of using SuperReport Pro is to place a plug in object on your input form or dialog Simply create a plug in object on your input form select the SuperReport item from the Routine popup menu and you are ready to start using SuperReport Pro LE Property Li Report_i lt None gt Detail Form Inherited from All Groups Plug in Area L kee 8 4D Chan Acti A SuperReport e SuperReport Pro z i a TC CursorArea Pha ype ey an f Figure la SuperReport Pro plug in area in Object Properties Palette File Edit Options Database ST BOMAGECY a SuperReport Pro 29 a Variable vSRarea could automatically save data in the blob field vSRArea_ if it existed WxH 610x 321 Copyright 1998 2011 Automated Solutions Group hd oO Published by e Node Figure 1b SuperReport Pro as plug in area on a 4D form For more detailed information on using SuperReport Pro on an input form please refer to the Chapter 5 Tutorial SuperReport Pro Page 18 of 226 Customizing the SuperReport Pro Area There are a variety of ways you can customize the SuperReport Pro area to suit your applications needs e Customize the table
188. ro will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 200 of 226 Example The following example will retrieve the current active and print sections for the desited report area C_LONGINT iSR_Sections iSR_PrintSections iSR_Sections 0 iSR_PrintSections 0 SR_Err SR Get Sections SR_AREA iSR_Sections iSR_PrintSections Using the SR Section mask values you can easily determine if a given section has been activated using the following syntax If iSR_Sections amp SR Section SubTotal1 Mask SubHeader1 is active End if If iSR_PrintSections amp SR Section Body Mask Body section will be used when printing End if If the supplied section was active a value of one will be returned otherwise a value of zero will be returned See Also SR Set Sections SR Get Section Properties SuperReport Pro Page 201 of 226 SR Set Sections SR Set Sections reportArea L activeSections L printSections L gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Active Sections C_LONGINT Active Sections Value Print Sections C_LONGINT Print Sections Value gt ResultCode C_LONGINT Result Code SR Set Sections will set the active and print sections for the desired report area The values passed to each section parameter are bitwise representation
189. round Red ForeGreen C_LONGINT Foreground Green ForeBlue C_LONGINT Foreground Blue BackRed C_LONGINT Background Red BackGreen C_LONGINT Background Green BackBlue C_LONGINT Background Blue ForePattern C_LONGINT Foreground Pattern BackPattern C_LONGINT Background Pattern Line Thickness C_LONGINT Line Thickness ForeColor C_LONGINT Fore Color BackColor C_LONGINT Back Color ForeColor and BackColor are 4D s style of expressing RGB colors OxOORRGGBB gt ResultCode C_LONGINT Result Code SR Set Object Format provides the ability to procedurally set object formatting properties When used with SR Set Object Properties SR Set Object Data and SR Set Object Scripts you can obtain all information about a given object In addition to using this routine in you own object interface you may also use this routine during printing to procedurally override the default appear of objects while printing For example if you wanted to set the appearance of a given object based on the current value you could use SR Set Object Format to perform this action ReportArea The desired SuperReport Pro area ObjectID Desired objectID you wish to obtain object properties You can use the object support routines SR Get Object IDs SR Get Object Properties etc to obtain detailed information about each report object In addition passing a value of 1 will retrieve the default report attributes SuperReport Pro P
190. rt By Name Sort result array by name 256 SR Structure Mark Indexed Returns marked indexed attribute 512 SR Structure Mark Invisible Returns marked invisible attribute Result Data A valid 4 Dimension BLOB variable which will receive the formatted field hierarchical list You may use this BLOB as a 4 Dimension list object where ever hLists are supported gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below SuperReport Pro Page 120 of 226 Examples The following will create the field list based on the structure configured using SR Structure If the routine was not called the default structure SR Structure Virtual or SR Structure Physical C_BLOB oSR_Data C_LONGINT tableNo SET BLOB SIZE oSR_Data 0 tableNo Table gt Customer result SR Get Fields As List BLOB eReportArea tableNo SR Structure Area Structure oSR_Data hList BLOB To List oSR_Data create a 4D hList object See Also SR Get Field List SR Get Tables As List BLOB SR Get Structure As List BLOB SR Structure SuperReport Pro Page 121 of 226 SR Get Structure As List BLOB SR Get Structure As List BLOB reportArea L options L resultData O gt resultCode L Parameter Data Type Description ReportArea
191. rties You can use the object support routines SR Get Object IDs SR Get Object Properties etc to obtain detailed information about each report object In addition passing a value of 1 will retrieve the default report attributes Font Name Desired object font name Font Size Desired objects font size 1 144 Font Style Object font style Uses Macintosh style of style attributes Use 4D constants see FONT STYLE Font Justification Object font justification You may use one of the following values 1 Left 2 Center 3 Right Format String Object format string This format string is used when printing as the display format SuperReport Pro Page 188 of 226 ForeRed Object foreground color Red You can also use the ForeCo or parameter which returns the foreground color in 4Ds style of expressing RGB colors ForeGreen Object foreground color Green You can also use the ForeColor parameter which returns the foreground color in 4Ds style of expressing RGB colors ForeBlue Object foreground color Blue You can also use the ForeCo or parameter which returns the foreground color in 4Ds style of expressing RGB colors BackRed Object background color Red You can also use the BackColor parameter which returns the foreground color in 4Ds style of expressing RGB colors BackGreen Object background color Green You can also use the BackColor parameter which returns the
192. rward or backwards one position gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example which is executed in a callback method will move the object to the end of the object list SR_Err SR Change Object SR_AREA SR_ITEM SR Position At End See Also SR Count Objects SR Get Object Properties SR Get Object IDs SR Set Object Properties SR Reorder Objects SuperReport Pro Page 172 of 226 SR Reorder Objects SR Reorder Objects reportArea L option L objectListArray X gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Move To Front C_LONGINT Move to beginning of list Object List ARRAY INTEGER or LONGINT Array of object IDs gt ResultCode C_LONGINT Result Code SR Reorder Objects provides the ability to procedurally reorder the printing position all objects Unlike the SR Change Object Order routine which works on a single object this routine enables you to provide an ordered list of where you wish to have objects ordered Note When moving an object it does not physically move the object on the report unless you move forward backward it only moves it within the internal list of objects This routine is useful when you wish to customize the order in
193. s e Ifyou have activated an object the value returned is the internal ObjectID e Ifyou have activated a section the value returned is one of the valid Section Objects e Ifyou have activated a database script the value returned is one of SR Start Report Script SR Body Report Script or SR End Report Script Report Area SuperReport Pro area which raised the event Action Type SuperReport Pro action that was performed For a complete list of Editor Callback Actions please refer to Chapter 7 SuperReport Pro Codes Editor Callback Action Type Item Reference Desired editor item which raised the event This value will contain a random unique number when a new object is created If you are editing an existing object this value will contain the internal object item ID Object Type SuperReport Pro object type For a complete list of Editor Callback Object Types please refer to Chapter 7 SuperReport Pro Codes Editor Callback Object Codes SuperReport Pro Page 164 of 226 gt Result Code The return value will determine how SuperReport Pro will respond after your custom editor code has been executed 0 Return a value of zero if you have handled the editor event 1 Return a value of one if you wish to have SuperReport Pro handle the event the same action as if the callback method was not installed SuperReport Pro Page 165 of 226 Example The following example will install the 4 D
194. s SR Object Type Field or SR Object Type Variable You may choose one of the following values 0 SR Calculation Type None 1 SR Calculation Type Total 2 SR Calculation Type Min 3 SR Calculation Type Average 4 SR Calculation Type Max Cal Name Name of the variable to store calculation This parameter is only used when the Options is SR Obj Flag Record Calc Value Rows Number of rows in a rectangle grid This parameter is only used when the ObjType is SR Object Type Rectangle Cols Number of columns in a rectangle grid This parameter is only used when the ObjType is SR Object Type Rectangle Repeat Horizontal Offset Desired horizontal offset for repeating object This parameter is only used when the Options is SR Obj Flag Repeat Horizontally Repeat Vertical Offset Desired vertical offset for repeating object This parameter is only used when the Options is SR Obj Flag Repeat Vertically gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below See Also SR Set Object Scripts SR Set Object Data SR Set Object Format SuperReport Pro Page 187 of 226 SR Get Object Format SR Get Object Format reportArea L objectID L fontName s fontSize L fontStyle L justification L forma
195. s displayed all places where a variable selection popup menu is displayed the following menu structure will be used Variable Object Properties 5 Display Filter Variable Type Yariable Array Element C g mDisplay Format Display Filter Example No Example Available Figure 4 SuperReport Pro Variable Selection Dialog SuperReport Pro Page 22 of 226 Customizing Standard SuperReport Pro Variables The standard SuperReport Pro variables SRDate SRTime SRRecord and SRPage can be overridden using your own variable names providing further report editor customization For more information on customizing the standard SuperReport Pro variables please refer to Chapter 6 Command Reference The following example changes the SRDate variable to use a custom date variable labeled dMyDateVat C_DATE dMyDateVar make sure you declare the variable to the correct data type iSR_Err SR Std Vars 1 dMyDateVar Customizing SuperReport Pro Menu System The final portion of the SuperReport Pro Editor which can be customized is the standard menu system You can perform a vatiety of menu item modifications including Set the enabled disabled attribute for a given menu item e Set the mark character for a given menu item Provide an override method for a given menu item For example if you want to present your own Query Editor such as QueryPack when the Select Reco
196. s necessary to create a form report TIP You can hold down the shift key while moving a SuperReport Pro section marker all section markers under the selected marker will move accordingly Step 2 Double Click on the Body section marker display the Section Definition dialog SRPro Section Properties aA General HTML Data Section Body Section Options Object r Page Breaking Options fal Keep Whole Section On Same Page Place This Section On The Current Page Start 4 New Page Before Starting This Section Start 4 New Page After Completing This Section Start 4 New Page If Available Space Is Less Than Figure 22 SuperReport Pro Section Dialog Body Step 3 Select the Start A New Page Before Starting This Section radio button in the Page Breaking Options section Step 4 Now select the Print Report or Print Preview menu item from the File menu to see your new form report As you can see each record is printed on a separate page SuperReport Pro Page 48 of 226 Using Repeating Objects One of SuperReport Pro s unique features is it s ability to printed related many records as repeating objects Using repeating objects you create your reports in the same fashion as you normally would place parent table information in the body section With most reporting tools such as the 4t Dimension form editor if you want to print related many records
197. seeeseerererererererererereresessesssesesesssesssssessses 101 SR DO COMMING aissis rerien inin R aA NEEE TE E E 102 SR Menu MiO saanen ereina ire e aio EE Ee 103 SR Ment TO Mcssassovcscs seus cevsaaavedevecesGadaadeaa AER 105 SuperReport Pro MISCEIIANEGOUS 0 0 cece eecceceesscececeeceeecsensrseeaeeeeeeess 107 SRABOUT me oti sae cu cneces etc A A A E eteesussis 108 SR REGISKSE EE E E ONE S 109 SR DOCUMEN esn r R E N ON ai 111 SR FIG TYDES visas eistsevacessscsvesdovonstdnuees Saseesbanks ctte vesssneteessuviavtencedeseesas 112 SR Get Format NUMDELM cee eececcccccceceseececceeeeeeseseeceseeseueeseeeeeees 113 SR Get Table MISE sce cretcstchveess fatewtusa besstts a N E 114 SR Get Field listonosa ienaat ra eT ENEAN ETATS 115 SR Get Commands As List BLOB ccccesessececeeceeeessnsseeeeeeeeeees 117 SR Get Tables As List BLOB c cc cccccecesesssseceeececceeeessrssseeeeeeeeeess 119 SR Get Fields As List BLOB cccccccccccccccceccscecssesesesesssseaeanananes 120 SR Get Structure As List BLOB ccccccecssssecececeeceeeessnsseeeeeeeeeees 122 SR Get Variables As List BLOB ssssssseseserererereesererererererereeeeseeree 124 SR Get Variable TY Pe uu cceeeecsssscccececcecsesssseseeeceeceeeessnssseeseeeeeess 125 SR Get Virtual Variable wo ccccccccccccccceecseseseseseseseeauaeananes 126 SR Get INAEXE SING eceesssecesssssecesesssseceessssecesesenseceesseseeceesenss 127 SRS MOGIGSG ys ssc3 scsi 2s Sagas NE E 128 SR Mai
198. so SR SET TIPS ENABLED SuperReport Pro Page 141 of 226 SR SET TIPS ENABLED SR SET TIPS ENABLED toolTipState L Parameter Data Type Description toolTipState C_LONGINT SR Pro Tool Tip State SR SET TIPS ENABLED will enable or disable SuperReport Pro s tool tips Note This routine works in the same fashion as 4Ds built in tool tips Enabling or disabling tool tips with this routine will affect all application tool tips including those used by 4D State Tool tip state 0 Disable tool tips 1 Enable tool tips 2 Toggle current state if off tips will be turned on if on tips will be turned off Example See SR Get Tips Enabled example for an example of using SR SET TIPS ENABLED See Also SR Get Tips Enabled SuperReport Pro Page 142 of 226 SR SWAP HANDLES Deprecated v2 9 SR SWAP HANDLES blob O picture P Parameter Data Type Description BLOB Object C_BLOB SRP Area in blob object Picture Object C_PICTURE Destination PICT object This command is obsolete and should no longer be used SR SWAP HANDLES provided an interface for converting an SRP report template which had been stored in a 4t Dimension blob field typically used by autosave interface into a valid SRP picture object which could be used by other SuperReport Pro routines requiring a picture variable Versions 2 9 and above store SRP report templates into Blob fields Picture objects are no longer used Use the SR Report To BLOB comma
199. ssntuaetenaamcnsterea ee 160 SR V GIG CG E E E E E E E E EE ia eed needs 162 SuperReport Pro Developer Interface API cececeessseeeeeeeees 163 SR Set Editor Callb OC isevcdsstereeccistecccctevssqeetetvvacecaesventeaesuvandeeisiees 164 SR Set Script CAMO ACK 2 0 eceecsessccccceccecsessssnceeeceeceeeensnssseeaeeeeeeess 167 SR COUNT ODIE orren a Meese sieves dean heenivedeseeeees 170 SR GOP ODJESCT IDS ccicessesccsessscdecessssseessaaccecssseccecessuecddesseneadddeeeaacs 171 SR Change Object Ode r cesscccssssssecesssssecessssnsecssssnssecsesenes 172 SR Reorder Objects cecessessssaccecececcecsessnsececececceesensnseseeeeseeeencs 173 SR Credle ODOC aee a Pests obi vist inne EEEREN 174 SR Delete OD EC eeose E E E EE 178 SR Get Object SCHIDTS 0 0 eeesecessssseceessssseceessnseccsesseseceesseseeseesenss 179 SR Set Object SCHIPTS sereni r EE 180 SR Get Object Propernies ssseesssseressssersssseessssseessnseessssseessese 181 SR Set Object Properties seesseseesssseresssseesssseessseseesssseesssesressse 184 SR Get Object Formal eescsccesssssecesesssseceessnseccsssenseceessnseeseesenes 188 SR Set OD eci Foma oresar ANNE RE 190 SR Get Object DOT esssssesssesseesssseessessecsssseesseseeesssseesseseessssseessene 194 SR Ser Object DOIG aescerernseri n r r E E 195 ALEEN a E OE E OE O S 196 SR Ser GUTES sirr E dens 197 TEIR E11 DIT E E AA EAA 198 SR Set SCWIDTS ccceessecscccccecsessesssseceeececee
200. sssesssessersssssssrrsrrssrsrsserere 212 Page 7 of 226 Preface SuperReport Pro has been developed to provide an enhanced reporting creation and printing tool for developers and end users Using the SuperReport Pro Editor and plug in routines developers can create sophisticated reports that support a variety of data formats including 4 Dimension fields variables and arrays In addition SuperReport Pro can be integrated into any 4 Dimension application s user interface providing your users with the ability to create reports using a number of advanced features not available using the standard reporting tool built into 4 Dimension About this Manual Throughout this manual you will see various formatting options to better distinguish the use of plugin calls 4th Dimension commands and 4th Dimension methods functions Listed below is a sample of each reference used All examples in this documentation are based on 4 Dimension v6 If you are using 4 Dimension v3 the examples in this documentation will vary 4D Commands and Functions ALERT 4D Methods SuperReport 4D Plugin calls SR Print Report 4D Variable SRDate Code Examples SuperReport gt Customers Acknowledgments Original Design and Programming by John Sidney Woollett and Michael S Erickson Contributions by Stewart Buskirk Miloslav Bystricky and Aparajita Fishman Documentation by Michael S Erickson amp Philippe Ganter Published and distributed by e
201. t see SR Variables This routine is used internally by the SuperReport Pro dialogs and may be used when creating customized report interface For more information on creating customized report interface please refer to Chapter 6 Command Reference Object Properties ReportArea The desired SuperReport Pro area Options You may choose one of the following values 0 Use alias variable name 1 Use real variable name Result Data A valid 4 Dimension BLOB variable which will receive the formatted variable hierarchical list You may use this BLOB as a 4 Dimension list object where ever hLists are supported The ztemRef contained in all list objects is a valid SuperReport Pro variableID and may be used in routines such as SR Get Virtual Variable gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Examples The following will create the variable list based on the variables configured using SR Variables C_BLOB oSR_Data SET BLOB SIZE oSR_Data 0 result SR Get Variables As List BLOB eReportArea 0 oSR_Data hList BLOB To List oSR_Data create a 4D hList object See Also SR Variables SR Get Virtual Variable SuperReport Pro Page 124 of 226 SR Get Variable Type SR Get Variable Type reportArea
202. t Object A valid SuperReport Pro report BLOB format This is not the actual SuperReport Pro area but rather the report object as it would be stored in a 4 Dimension BLOB field or variable Array Name Name of a valid 4 Dimension PICT array which will receive the pages of the printed report Print Options Print options flags You can pass the sum of the values you wish to execute using the following table 0 Default options don t do anything special 1 SR PrintToPict Validate Validate Page Setup 2 SR PrintToPict Job Dialog Show Job Setup 4 SR PrintToPict No Progress Don t display progress bar If the Page Setup is not correct for your chosen printer and you specify to check the Page Setup using the option parameter then the Page Setup dialog will be displayed If the user cancels either the Page Setup or Job Setup dialogs then the report will not be printed Section Flag The sections parameter is used to control which sections of the report ate printed assuming that you have not specified the Body section only using the options parameter To print specific sections pass the sum of the section numbers that you require which are listed in the Chapter 7 SuperReport Pro Codes Section Codes You may choose one or more of the following 0 SR All Sections 1 SR Section Header Mask 2 SR Section SubHeader1 Mask 4 SR Section SubHeader2 Mask 8 SR Section SubHeader3 Mask 16 SR Sec
203. t b gt End Tag lt b gt lt td gt SRPro Text Object Properties HTML Data Insert HTML Before lt td gt lt b Insert HTML After lt fb gt lt td gt C3 Figure 35 SuperReport Pro Header Object HTML Data These tags will create a single row containing the column headings applying the bold HTML tag You will notice that End Tag section has the lt b gt tag before the lt td gt tag As outlined in the first Step the Start Tag is sent to the HTML file before the data is sent the data is sent and then the end tag is sent If you were to place the lt b gt tag after the lt td gt tag the generated HTML file would be incorrect SuperReport Pro Page 64 of 226 Step 7 The final configuration item will be to close hour HTML file Since we placed the beginning HTML tags in the reports Header section marker the logical place to place the closing HTML tags is in the Footer section Double click on the Footer section marker click on the HTML button and enter the following code lt tEndTagHTML gt Like the HTML header the end tag is using a custom 4 Dimension variable to hold the standard end tag data SRPro Section Properties B HTML Data Footer HTML Begin Tag lt tEndTaghHTMLS Footer HTML End Tag Cancel Figure 36 SuperReport Pro Footer HTML Data SuperReport Pro Page 65 of 226 Step 8 Now we ate ready to create our HTML file using the
204. t is an ASCII interpretation of the report Thus SuperReport Pro can be used to create export documents NOTE The Header and Footer sections are only printed once as the report is generated since the concept of pages don t existing when writing the report to a document Report Object A valid SuperReport Pro Object This is not the actual SuperReport Pro area but rather the report object as it would be stored in a 4t Dimension BLOB field or variable Document Name A valid document pathname If the Document Name parameter is a null string the standard Save File dialog will be displayed If you want to specify a default value and allow the user to determine where the file will be saved pass a value as the Document Name and use pass a value of one to the Print Options parameter Print Options Print options flags You can pass the sum of the values you wish to execute using the following table 0 Default options don t do anything special 1 SR PrintToDisk File Dialog Display Save File dialog regardless of Document Name 2 SR PrintToDisk Body Only Print Body section only regardless of sectionFlag 4 SR PrintToDisk Static Text Print Static text items SuperReport Pro Page 151 of 226 Section Flag The sections parameter is used to control which sections of the report ate printed assuming that you have not specified the Body section only using the options parameter To print specific sections pass
205. tBottom L rectRight L objType L options L order L selected L tableNo L fieldNo L varType L arrayElem L calcType L calcName S rows L cols L repeatHOffset L repeatVOffset L gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Object ID C_LONGINT Report section ID Action C_LONGINT Action ObjName C_STRING or C_TEXT Object Name RectTop C_LONGINT Object Position Top RectLeft C_LONGINT Object Position Left RectBottom C_LONGINT Object Position Bottom RectRight C_LONGINT Object Position Right ObjType C_LONGINT Object Type Options C_LONGINT Object Options Order C_LONGINT Object Order Selected C_LONGINT Object Selected TableNo C_LONGINT Object Table Number FieldNo C_LONGINT Object Field Number VarType C_LONGINT Object Variable Type ArrayElem C_LONGINT Array Element CalcType C_LONGINT Object Calc Type CalcName C_STRING or C_TEXT Object Calc Name Rows C_LONGINT Object Rows Cols C_LONGINT Object Cols RepeatHOffset C_LONGINT Object Horizontal Repeat Offset RepeatV Offset C_LONGINT Object Vertical Repeat Offset gt ResultCode C_LONGINT Result Code SR Set Object Properties provides the ability to procedurally set individual object properties When used with SR Set Object Format SR Set Object Data and SR Set Object Scripts you can set all information about a given object If you are setting the properties for a static text object SR Object Type Text or picture object
206. tSR_Script RELATE MANY Customer tSR_HTMLStart lt td gt tSR_HTMLEnd lt td gt SR_Err SR Set Section Scripts SR_AREA SR Section Body tSR_Script tSR_HTMLStart tSR_HTMLEnd See Also SR Set Sections SR Set Section Properties SR Get Section Scripts SuperReport Pro Page 209 of 226 SR Get Tool SR Get Tool reportArea L currentTool L gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Current Tool C_LONGINT Report tool gt ResultCode C_LONGINT Result Code SR Get Tool will return the current editor tool ReportArea The desired SuperReport Pro area Tool A valid 4 Dimension variable which will contain the currently selected tool in the SuperReport Pro editor 0 SR Tool Arrow 1 SR Tool Text 2 SR Tool Field 3 SR Tool Variable 4 SR Tool Line 5 SR Tool Rectangle 6 SR Tool Circle gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will get the currently selected tool in the SuperReport Pro editor If the current tool is not the arrow tool it will be set using the SR Set Tool routine C_LONGINT iSR_Tool err SR Get Tool SR_AREA iSR_Tool if iSR_Tool SR Tool Arrow err SR
207. tString S foreRed L foreGreen L foreBlue L backRed L backGreen L backBlue L forePattern L backPattern L lineThickness L foreColor L backColor L gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Object ID C_LONGINT Report section ID FontName C_STRING or C_TEXT Font Name FontSize C_LONGINT Font Size FontStyle C_LONGINT Font Style Justification C_LONGINT Justification Format String C_LONGINT Object Formatting String ForeRed C_LONGINT Foreground Red ForeGreen C_LONGINT Foreground Green ForeBlue C_LONGINT Foreground Blue BackRed C_LONGINT Background Red BackGreen C_LONGINT Background Green BackBlue C_LONGINT Background Blue ForePattern C_LONGINT Foreground Pattern BackPattern C_LONGINT Background Pattern Line Thickness C_LONGINT Line Thickness ForeColor C_LONGINT Fore Color BackColor C_LONGINT Back Color ForeColor and BackColor are 4D s style of expressing RGB colors OxOORRGGBB gt ResultCode C_LONGINT Result Code SR Get Object Format provides the ability to procedurally retrieve object formatting properties When used with SR Get Object Properties SR Get Object Data and SR Get Object Scripts you can obtain all information about a given object Note All parameters must be valid 4 Dimension variables you cannot use 4D fields ReportArea The desired SuperReport Pro area ObjectID Desired objectID you wish to obtain object prope
208. te or deactivate sections by double clicking on the line for the appropriate section you wish to add delete Note Sections with bold attributes cannot be deactivated and will always be active SRPro Activate Sections SB Active Report Sections Y Subheader 1 Y Subheader 2 Y Subheader 3 x Subheader 4 x Subheader 5 x Subheader 6 I Body Y subtotal 6 Y subtotal 5 Y subtotal 4 Y subtotal 3 Y subtotal 2 Y subtotal 1 Total f Footer Figure 18 SuperReport Pro Section Configuration Dialog e Database Select Records This item will display the standard 4 Dimension Query Editor that will allow you locate the desired records which you wish to print If you don t perform any record selection the current selection will always be printed SuperReport Pro Page 44 of 226 e File Preview This item allows you to preview the report before it is printed When displaying the report preview you can move forward and backwards through the report where applicable and print the current page or entire report Sees Page 1 Processed 7 of 7 Items d el 74 puf fll ae mu Bp nan _ ia _ _ ii ri Figure 19 SuperReport Pro Print Preview SuperReport Pro Page 45 of 226 Creating a basic listing report Now that you have had an overview of the SuperReport Pro toolbar section markers and basic menus you are ready to be
209. te is only required when using a BreakType of SR Section Break On Field 1 Break Variable Name Determines the variable or array that is used to determine when the break should occur This attribute is only required when using a BreakType of SR Section Break On Variable 2 or SR Section Break On Array 3 gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will return all the properties for the SR Section SubHeader1 section iSR_Section SR Section SubHeader1 iSR_UseSection SR Use Section Always iSR_PrintSection 1 iSR_Position 1 use current value iSR_Options SR Section Keep On One Page iSR_ThrowPage _SR Section Throw Page After iSR_MinSpace 0 iSR_BreakType _SR Section Break On Field iSR_BreakTableNo T able gt Customer Code iSR_BreakFieldNo Field gt Customer Code sSR_BreakVarName iSR_Err SR Set Section Properties vSRArea iSR_Section iSR_UseSection iSR_PrintSection iSR_Position iSR_Options iSR_ThrowPage iSR_MinSpace iSR BreakType iSR_BreakTableNo iSR_BreakFieldNo sSR_BreakVarName See Also SR Get Sections SR Get Section Properties SR Get Section Scripts SuperReport Pro Page 207 of 226 SR Get Section Scripts SR Get Section Scripts rep
210. ter Data Type Description ReportArea C_LONGINT Report plug in area Start Script C_TEXT Report Start Script Body Script C_TEXT Report Body Script End Script C_TEXT Report End Script gt ResultCode C_LONGINT Result Code SR Set Scripts will set each of the scripts associated to the report area configured in database menu ReportArea The desired SuperReport Pro area Start Script The desired text which contains the Start script Body Script The desired text which contains the Body script End Script The desired text which contains the End script gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will return the database scripts Start Body and End for the desired report area C_TEXT tSR_StartScript tSR_BodyScript tSR_EndScript tSR_StartScript ALL RECORDS Customer tSR_BodyScript no body script tSR_EndScript UNLOAD RECORD Customer SR_Err SR Set Scripts SR_AREA tSR_StartScript tSR_BodyScript tSR_EndScript See Also SR Get Scripts SuperReport Pro Page 199 of 226 SR Get Sections SR Get Sections reportArea L activeSections L printSections L gt result L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Activ
211. the sum of the section numbers that you require which are listed in the Chapter 7 SuperReport Pro Codes Section Codes You may choose one or more of the following 0 SR All Sections 1 SR Section Header Mask 2 SR Section SubHeader1 Mask 4 SR Section SubHeader2 Mask 8 SR Section SubHeader3 Mask 16 SR Section SubHeader4 Mask 32 SR Section SubHeader5 Mask 64 SR Section SubHeader6 Mask 128 SR Section Body Mask 256 SR Section SubTotal6 Mask 512 SR Section SubTotal5 Mask 1024 SR Section SubTotal4 Mask 2048 SR Section SubTotal3 Mask 4096 SR Section SubTotal2 Mask 8192 SR Section SubTotall Mask 16384 SR Section Total Mask 32768 SR Section Footer Mask Field Delimiter The ASCII field delimiter that will be used to separate report objects in the exported file Generally this value will be a TAB character ASCII value 9 Record Delimiter The ASCII record delimiter that will be used to separate report records in the exported file General this value will be a CR ASCII 13 Object Order When printing to disk you may determine the order in which objects are printed You may choose one of the following values 0 SR Generic Option Set Off Use print order see SR Reorder Objects for more information 1 SR Generic Option Set On Use object order top left coordinate gt Result Code If the routine completed successfully a value
212. tion Bottom RectRight C_LONGINT Object Position Right ObjType C_LONGINT Object Type Options C_LONGINT Object Options Order C_LONGINT Object Order Selected C_LONGINT Object Selected TableNo C_LONGINT Object Table Number FieldNo C_LONGINT Object Field Number VarType C_LONGINT Object Variable Type ArrayElem C_LONGINT Array Element CalcType C_LONGINT Object Calc Type CalcName C_STRING or C_TEXT Object Calc Name Rows C_LONGINT Object Rows Cols C_LONGINT Object Cols RepeatHOffset C_LONGINT Object Horizontal Repeat Offset RepeatV Offset C_LONGINT Object Vertical Repeat Offset gt ResultCode C_LONGINT Result Code SR Get Object Properties provides the ability to procedurally retrieve object properties When used with SR Get Object Format SR Get Object Data and SR Get Object Scripts you can obtain all information about a given object Note All parameters must be valid 4 Dimension variables you cannot use 4D local variables You many not receive information into 4 Dimension fields ReportArea The desired SuperReport Pro area ObjectID Desired objectID you wish to obtain object properties You can use the object support routines SR Get Object IDs SR Get Object Format etc to obtain detailed information about each report object Object Name Contains the field alias see SR Strutcure or the Variable name if you have created a variable If you wish to get static text information please use SR Get Object
213. tion SubHeader4 Mask 32 SR Section SubHeader5 Mask 64 SR Section SubHeader6 Mask 128 SR Section Body Mask 256 SR Section SubTotal6 Mask 512 SR Section SubTotal5 Mask 1024 SR Section SubTotal4 Mask 2048 SR Section SubTotal3 Mask 4096 SR Section SubTotal2 Mask 8192 SR Section SubTotall Mask 16384 SR Section Total Mask 32768 SR Section Footer Mask SuperReport Pro Page 154 of 226 gt Result Code If the routine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Example The following example will create a 4D PICT array one element for each page of the report C_LONGINT iSR_Result options section ARRAY PICTURE apSR_Report 0 options 1 2 valid Page Setup show Job Setup dialog section 0 all sections iSR_Result SR Print PICT ReportMgr ReportData apSR_Report options section See Also SR Page Setup SR Preview SR Print Report SR Print Disk SR Print HTML SR Print To BLOB SuperReport Pro Page 155 of 226 SR Print Report SR Print Report reportObject P options L sections L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area PrintOption C_LONGINT Print Options SectionFlag C_LONGINT Print Section Flags gt Result
214. tor Modify Report Script Activated when one of the three Start Body End scripts is modified 6 SR Editor Control Click Object Activated when a control click or Right mouse button on Windows event occurs This is useful when performing contextual menu access 7 SR Editor Click Object Activated when any object click event occurs 8 SR Editor Selection Changed Activated when the selected object s has changed Editor Codes Object Types When using the SuperReport Pro Editor Callback interface the callback method will receive one of the following object types parameter 4 Event Code Constant Name Description 1 SR Object Type Text Text Object 2 SR Object Type Field Field Object 3 SR Object Type Variable Variable Object 4 SR Object Type Line Line Object 5 SR Object Type Rectangle Rectangle Object 6 SR Object Type Circle Circle Object 8 SR Object Type Picture Picture Object 1 SR Start Report Script Report Start Script Object when SR Editor Modify Report Script action occurs 2 SR Body Report Script Report Body Script Object when SR Editor Modify Report Script action occurs 3 SR End Report Script Report End Script Object when SR Editor Modify Report Script action occurs SuperReport Pro Page 220 of 226 SuperReport Pro Constants SuperReport Pro includes a variety of constants which can be used by each of the SuperReport Pro commands The following table outlines all the constants which are defined in S
215. uperReport Pro Value Constant Name 1 SR Use Section Always 2 SR Use Section On Break 3 SR Use Section On First Page 4 SR Use Section On Second Page 1 SR Section Break On Field 2 SR Section Break On Variable 3 SR Section Break On Array 1 SR Section Throw Page None 2 SR Section Throw Page Before 3 SR Section Throw Page After 4 SR Section Throw Page Min Space 1 SR Section Keep On One Page 2 SR Section Adjust At Print Time 1 SR Obj Flag Left Line 2 SR Obj Flag Top Line 4 SR Obj Flag Right Line 8 SR Obj Flag Bottom Line 15 SR Obj Flag All Lines 16 SR Obj Flag Fixed Horizontal 32 SR Obj Flag Fixed Vertical 64 SR Obj Flag Grow Horizontal 128 SR Obj Flag Grow Vertical 256 SR Obj Flag Variable Width 512 SR Obj Flag Variable Height 1024 SR Obj Flag Replace If Empty 2048 SR Obj Flag Record Calc Value 4096 SR Obj Flag Show Calculated Value 8192 SR Obj Flag Repeating Object 16384 SR Obj Flag Repeat Vertically 32768 SR Obj Flag Repeat Horizontally 65536 SR Obj Flag Replace Row If Empty 1 SR Variable Type Variable 2 SR Variable Type Array Auto 3 SR Variable Type Array Element 0 SR Calculation Type None 1 SR Calculation Type Total 2 SR Calculation Type Min 3 SR Calculation Type Average 4 SR Calculation Type Max SuperReport Pro Description Section cus Section cus Section cus tomization tomization tomization Section customization Section cus Section cus Section cus Section cus Section cus Section c
216. us Section cus Section cus Section cus Replace Below If Empty Replace Row Below If Empty tomization tomization tomization tomization tomization tomization tomization tomization tomization Page 221 of 226 0 SR Pict Format Normal 1 SR Pict Format Centered 2 SR Pict Format Scaled To Fit 3 SR Pict Format Scaled Prop 4 SR Pict Format Scaled Prop Centered 1 SR Iterations Main Table 2 SR Iterations Fixed 3 SR Iterations Variable 4 SR Iterations Array 1 SR Property All 1 SR Property Name 2 SR Property Position 4 SR Property Type 8 SR Property Options 16 SR Property Selected 32 SR Property Field 64 SR Property Variable Type 128 SR Property Calculation 256 SR Property Rows Cols 512 SR Property Repeat Offsets 7169 SR Attribute All 1 SR Attribute Font Name 2 SR Attribute Fore Color 4 SR Attribute Back Color 8 SR Attribute Font Size 16 SR Attribute Font Style 32 SR Attribute Fore Pattern 64 SR Attribute Back Pattern 128 SR Attribute Justification 256 SR Attribute Thickness 512 SR Attribute Format 1024 SR Attribute 4D Fore Color 2048 SR Attribute 4D Back Color 4096 SR Attribute No Adjust 0 SR PowerMenu Tables 1 SR PowerMenu Fields 2 SR PowerMenu Variables 3 SR PowerMenu Commands 5 SR PowerMenu Break Object Type 6 SR PowerMenu Variable Type 7 SR PowerMenu Format 11 SR PowerMenu Color 12 SR PowerMenu Pattern 13 SR PowerMenu Line 1 SR Position At Front SuperReport Pro S
217. used All font attribute settings will be used based on their definition in the report unless a lt FONT gt tag has been supplied Report Object A valid SuperReport Pro Object This is not the actual SuperReport Pro area but rather the report object as it would be stored in a 4 Dimension BLOB field or variable Report Data A valid 4 Dimension BLOB variable which will receive the report output Print Options Print options flags You can pass the sum of the values you wish to execute using the following table 1 SR PrintToBLOB Output HTML Print using HTML attributes otherwise standard text output 2 SR PrintToBLOB Body Only Only output the Body section 3 SR PrintToBLOB Static Text Include static text items 4 SR PrintToBLOB TopLeft Order Print using top left coordinates otherwise print order will be used Section Flag The sections parameter is used to control which sections of the report ate printed assuming that you have not specified the Body section only using the options parameter To print specific sections pass the sum of the section numbers that you require which are listed in the Chapter 7 SuperReport Pro Codes Section Codes You may choose one or more of the following 1 SR Section Header Mask 2 SR Section SubHeader1 Mask 4 SR Section SubHeader2 Mask 8 SR Section SubHeader3 Mask 16 SR Section SubHeader4 Mask 32 SR Section SubHeader5 Mask 64 SR Section SubHea
218. utine completed successfully a value of zero will be returned otherwise a valid SuperReport Pro result code will be returned For a complete list of all return codes please refer to the SuperReport Pro Error Codes section below Examples The following example will execute the Print Preview command from the File menu Notice the option parameter has a value of 1 this will ensure that the standard SuperReport Pro action will be executed despite any override method assigned via SR Menu Item iSR_Err SR Do Command eReportArea 107 1 execute the default Print Preview action See Also SR Menu Info SR Menultem SuperReport Pro Page 102 of 226 SR Menu Info SR Menu Info reportArea L SRProMenu L menuID L menultem L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area SRProMenu C_LONGINT SuperReport Pro Menu MenuID C_LONGINT Desired Menu ItemID C_LONGINT Desired Menu Item gt ResultCode C_LONGINT Result Code SR Menu Info will return the internal SuperReport Pro SRProMenu for a given menuID and itemID or the menuID and itemID for a given SRProMenu e If you wish to return the SRProMenu pass assign a value of 1 as the SRProMenu before calling and pass valid menuID and itemID values e If you wish to return the MenuID and itemID assign values of 1 to each variable before calling and pass a valid SRProMenu ReportArea The desired SuperReport Pro area SRProMenu The int
219. utine will return one of the following values 0 Page setup does not match current printer and has been modified 1 Page setup is correct for current printer lt 0 An error occurred a valid SuperReport Pro Error Code will be returned NOTE If a value of zero 0 is returned you should display the Page Setup dialog using the SR Page Setup routine Example The following example will validate the Page Setup information If it is not correct a value of zero is returned the SR Page Setup routine is called C_LONGINT iSR_Result iSR_Err C_BLOB pSR_ReportData pSR_ReportData Report Format make a copy of the report we might modify it If SR Validate pSR_ReportData 0 iSR_Result SR Page Setup pSR_ReportData update page setup data If iSR_Result 1 ReportMgr ReportData pSR_ReportData stored modified report in ReportMgr table End If End If See Also SR Page Setup SuperReport Pro Page 162 of 226 SR Pro Developer Interface API In addition to the internal forms available when using the default editor SuperReport Pro provides a complete interface whereby application developers can override the default dialogs and use custom interface elements and dialogs for most editor events Routines included in this section are SR Set Editor Callback e SR Set Script Callback e SR Get Object IDs e SR Change Object Order e SR Reorder Objects e SR Create Object e SR Delete Object e
220. valid window reference if the report opened successfully otherwise a valid SuperReport Pro result code will be returned SuperReport Pro Page 149 of 226 Examples The following example will display the desired report in a preview window then continue with code execution C_BLOB pSR_ReportData C_LONGINT iSR_WinRef iSR_WinRef SR Preview pSR_ReportData 50 50 Screen width 50 Screen height 50 8 SR Pro Preview The following example will display the desired report in a preview window modal window C_BLOB pSR_ReportData C_LONGINT iSR_WinRef iSR_WinRef SR Preview pSR_ReportData 50 50 Screen width 50 Screen height 50 8 SR Pro Preview 1 See Also SR Page Setup SR Print Report SR Print Disk SR Print HTML SR Print To BLOB SR Print PICT SuperReport Pro Page 150 of 226 SR Print Disk SR Print Disk reportObject P documentName s printOption L sectionFlags L fieldDelim L recDelim L objectOrder L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Document Name C_STRING 255 Disk filename PrintOption C_LONGINT Print Options SectionFlag C_LONGINT Print Section Flags FieldDelim C_LONGINT Field Delimiter RecDelim C_LONGINT Record Delimiter Object Order C_LONGINT Object Order gt ResultCode C_LONGINT Result Code SR Print Disk allows you to print a SuperReport Pro report to disk without requiring a SuperReport Pro area the output written to the specified documen
221. which will be used as a replacement for the defined SR Pro variable NOTE This command replaces the standard variables for all SuperReport Pro areas and reports printed by the 4D database application using SuperReport Pro Example The following example will override the default date variable SRDate with our own date variable C_DATE dMyDateVar Case of Form event On Load iSR_Err SR Std Vars 1 dMyDateVar End case SuperReport Pro Page 93 of 226 SR Structure SR Structure reportArea L structureArrayName S options L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report plug in area Structure Array Name C_STRING 255 Name of array containing structure Options C_LONGINT Options gt ResultCode C_LONGINT Result Code SR Structure allows you to override the default file structure with your own custom database structure view By default SuperReport Pro will display the first 128 visible tables and will list all the visible fields for each table displayed If you have customized your structure using 4Ds SET TABLE TITLES and SET FIELD TITLES this information will be used by default and calling SR Structure is an additional interface for creating the custom structure Calling SR Structure with the appropriate options see Options below will override the virtual structure you may have created using the 4D virtual structure commands When configuring a custom structure view you can not only li
222. yle report using an HTML table is a logical choice SuperReport Pro Page 60 of 226 Step 3 Since we have already created the table creation tag we ll jump forward a bit to the Total section where we placing the corresponding lt table gt tag We place the close table tag in this section as it is where the report will actually when the corresponding section completes printing Double click on the Total section marker click on the HTML Data button and enter the following HTML tag in the Before section lt table gt SRPro Section Properties H HTML Data Total HTML Begin Tag lt ftable Total HTML End Tag Figure 32 SuperReport Pro Total Section HTML Data If you were to create a break processing report where you had multiple sections you could create nested tables by place the lt table gt tag in the SubHeader section and the lt table gt tag in the corresponding SubTotal section SuperReport Pro Page 61 of 226 Step 4 The next step will be to insert the new row tags lt tr gt and lt tr gt Since the Body script is executed for each record in the current selection and it executes before the body sections object scripts for more information on the SuperReport Pro Execution Cycle please refer to Chapter 4 SuperReport Pro Fundamentals Understanding SuperReport Pro Execution Cycle Double click on the Body section marker click on the HTML Data button and ent
223. you don t use one of the supported fieldTypes a value of zero 0 will be returned SuperReport Pro Page 113 of 226 SR Get Table List SR Get Table List reportArea L tableNameList X tableNoList X options L gt resultCode L Parameter Data Type Description ReportArea C_LONGINT Report Area TableNameList ARRAY STRING Table name Array TableNoList ARRAY INTEGER or ARRAY LONGINT Tablenumber Array Options C_LONGINT Options gt ResultCode C_LONGINT Format Number SR Get Table List builds an array of report table names and table numbers see SR Structure for more information ReportArea The desired SuperReport Pro area Tablename Array A valid 4 Dimension string array which will receive the list of table names for the defined report area Tablenumber Array A valid 4 Dimension integer or longint array which will receive the list of table numbers for the defined report area Note Tablenumber array is always filled with physical 4D table number Options Options for building table lists You may choose one of the following values 0 SR Structure Physical Use physical structure area is ignored 1 SR Structure Virtual Use virtual structure area is ignored 2 SR Structure Area Structure Use structure set by SR Structure If not set SR Structure Physical SR Structure Virtual are checked 4 SR Structure Get Invisible Include invisible tables 8 SR Structure Get Empty Tables Include e
Download Pdf Manuals
Related Search
Related Contents
CITY OF HURON, OHIO The MDS Mentor Sept. 2011 – DADS Manual de Instalación Barcode Tagger® 600 PORTABLE ICE MAKER 26.5 lb RHIM-15001~2 Panasonic DVX100B Camcorder User Manual Copyright © All rights reserved.
Failed to retrieve file