Home
CUT (Crystal UTilities) Documentation
Contents
1. For example BlowFishEncrypt MilletSoftware Sesame Returns 268BA82DCA546F2C4E107E9C8A F16546318A8E275BDE0F8D1C5BBD663C8DF10E Note StringtoEncrypt can t exceed 254 characters If you try to pass a string larger than that the function returns String to Encrypt Must Be Less Than 255 Characters Note however that the returned encrypted string may be longer than 254 characters BlowFishDecrypt Arguments StringToDecrypt Key Returns The decrypted text using the BlowFish algorithm For example BlowFishDecrypt 2688482pc4546F2C4E107E9C8AF16546318A8E27SBDE0F8D1CSBBD663C8DF10E Sesame Returns MilletSoftware Note StringtoDecrypt can t exceed 254 characters If you try to pass a string larger than that the function returns String to Decrypt Must Be Less Than 255 Characters If the string you need to decrypt is longer use BlowFishDecryptSegment see next page 2002 2015 Ido Millet ido 9 MilletSoftware com Page 43 BlowFishDecryptSegment Arguments Key Segmentl Segment2 Segment3 Segment4 Segment5 Note Key is the first argument in this function unlike the prior function Returns The result as HEX of decrypting the combined text of all segments using the BlowFish algorithm For example BlowFishEncryptSegment Sesame MilletSoftware Returns 268BA82DCA546F2CAE107E9C8AF16546318A8E275BDEOFSDICSBBD663C8DF10E This function is like BlowFishDecrypt but it all
2. US Click on left for Bookmarks CUT Light Crystal UTilities User Function Library for email Text ini Files Time Zones SQL etc www MilletSoftware com Version 6 4 6 September 2015 By Ido Millet 5275 Rome Court Erie PA 16509 ido MilletSoftware com 814 825 6009 Disclaimer These component and accompanying files are provided as is by Ido Millet without assuming any responsibility for harm to computer systems software or data with which these files are used Credits The SMTP e mail functionality was adapted from code in vbSendMail vbSendMail co authored by Dean Dusenbery is available from FreeVBCode com Dave Clutter Reed Manufacturing Ken Hamady www kenhamady com Jason Lord Trintech Ross C Ryding Southern Store Fixtures and Adam Peter Butt apbreports com were instrumental in testing this utility and providing suggestions leading to changes and enhancements 2002 2015 Ido Millet ido MilletSoftware com Page 1 INTRODUCTION cssssssssssssessssessessesessessssessessssessessssessessssessessssessasesessasnsesasssessessssessessesessessssessassesessessesessessesess 5 INSTALL UNINSTAEL 6 WINDOWS MISCELLENEOUG sscsscssssssscssssesscosssosesonsseasonsssssvessvessnesssesseeseeessosssoneseasonassnssensvesssessnesseessoeses 7 INEWIEY atan da a ds ds a e o o ld or 7 Avoiding Duplicate Proc
3. Version 4 3 0 4 17 2008 Added ExecuteSQLReturnDelimitedSegment function Version 4 2 0 3 10 2007 Fixed incompatibility with Crystal XI dynamic parameters Version 4 1 0 9 30 2006 Added ExecuteSQLReturnDelimited function Fixed a problem with HTMLstring2RTFFile function Added ReplaceA ccented Chars function Added Hex2Ascii function 99 9 Version 4 0 0 6 2 2006 Added InputBox2Command function Added ExeRun function Version 3 9 0 4 27 2006 Added ExecuteSQLNoReturn function Added ExecuteSQLReturnValue function Version 3 8 0 1 03 2006 Added InputBox function Added HTMLfile2RTFfile function Added HTMLstring2RTFFile function Version 3 7 0 11 29 2005 Fixed importing of RTF files in FileGetText Version 3 6 0 7 12 2005 Added MessageBoxOK function Added MessageBoxYesNo function Version 3 5 0 11 26 2004 Added VisualCutRun function Version 3 3 0 09 15 2004 Added SetIniValue function 2002 2015 Ido Millet ido MilletSoftware com Page 62 Version 3 2 0 08 25 2004 FileAddText now creates the target folder if it doesn t exist even when it is specified in UNC format Version 3 1 0 08 08 2004 Enhanced FileGetText function so it can load large text files segment by segment into a String variable in Crystal It can then be displayed within Crystal as text RTF or HTML Version 3 0 0 08 02 2004
4. Here s another example ExecuteSQLReturnValue Xtreme Sample Database 11 SELECT sum A Order Amount from Orders A WHERE A Customer ID Cstr Orders Customer ID 0 pH I Here s an example that combines both types of SQL Functions WhilePrintingRecords IF ExecuteSQLReturnValue Vision Offline SYSDBA myPass Select PRINTED from ENTRY WHERE ENTRY ID 4cstr ENTRY ENTRY ID 0 0 THEN Vision Offline SYSDBA myPass Update ENTRY SET PRINTED 1 WHERE ENTRY ID cstr ENTRY ENTRY_ID 0 mn 2002 2015 Ido Millet ido MilletSoftware com Page 36 Example with a Connection String Here s an example where instead of ODBC DSN a connection string 15 specified ExecuteSQLReturnValue Provider sqloledb Data Source IP ADDRESS 1433 Network Library DBMSSOCN Initial Catalog DB NAME USER PASSWORD Select Count from Location no nw j nw ExecuteSQLReturnDelimited Arguments ODBC DSN or OLEDB Connection String User ID Password Delimiter sql1 sql2 913 8414 915 This function executes a SQL statement against any ODBC DSN even one that is not used by the Crystal report or any OLEDB Connection String If the SQL statement is longer than 254 characters break it into segments across up to 5 sql segments The SQL statement can be of a type that returns multiple records Th
5. Known Issues and Limitation 1 Function arguments passed to a UFL should not exceed 254 characters That is why some of the functions provided by CUT Light allow you to specify inputs using several arguments that are internally combined In other cases you simply need to chop the string into segments and loop For example here is how you can write a large string to a text String Var MyText LargeText String Var TargetFile c temp test txt chop and write the text in 254 character segments While Len MyText gt 254 Do FileAddText TargetFile Left MyText 254 False False MyText Mid MyText 255 write remaining small segment FileAddT ext TargetFile MyText False False A simple preview of a Crystal report may trigger evaluation formatting of only the 1 page If you want the Master report to be fully processed upon initial preview without manually scrolling to the last page you may need to insert a Special Field such as Page N of M to force immediate processing for the whole report Crystal XI suffers from an issue ADAPT00755322 leading to a termination of Crystal when running a report that uses dynamic parameters on a machine that also has a UFL installed If you are using Crystal XI and reports with dynamic parameters you should not install UFLs until Business Objects resolves this issue 2002 2015 Ido Millet ido 9 MilletSoftware com Page 64
6. The text of the excel cell value Returns Workbook Not Found if the file can t be found Returns Worksheet Not Found if the worksheet can t be found Example GetXLSValue c temp test xlsx Sales 2 Notes 1 If you leave the sheet name blank or as 1 first sheet in workbook is used SetXLSValue Arguments Workbook Worksheet Cell NewValue Returns OK or error message Returns Workbook Not Found if the file can t be found Returns Worksheet Not Found if the worksheet can t be found Example SetXLSValue c temp test xlIsx Sales B2 MyNewValue Notes 1 If you leave the sheet name blank or as 1 the first sheet in the workbook is used 2 NewValue is specified inside double quotes but treated as if typed into the cell so 100 2 would become a number while 100 2 would become text in the spreadsheet due to the single quote n GetXLSOutput This function allows you to plug Crystal values as input to an Excel model and get some output back One typical use scenario is VLOOKUP tables allowing users to maintain lookup logic in Excel without needing to modify the Crystal report Arguments Workbook Worksheet InputCell InputCell Value OutputCell Returns The text of the excel OutputCell after plugging the InputCell Value into InputCell Returns Workbook Not Found if the file can t be found Returns Worksheet Not Found i
7. 29 HTMESTRINGZL TELE aee eri t enel eie oa e ve 30 HTTPEIEEEXISTS iiti tenen en a I IM 31 HTTPEIEEDOWNEONRD i dee eo iei E bete necne d eee e de ip eee e ee ist 32 HTTPFILEDOWNLOADRENAME RR 32 SOL p 33 EXEGCUTESQLEANCONNECT O ui rites tede dee erbe x E ea oon pee v ede dee ees Ee dece 33 EXECUTESQLNORETURN did 34 Avoiding Duplicate Processing old approach seen retener eene treten 35 EXECUTESQERETURN V ALUEQ 5 Aretini cn eie tr eletti eR UE 36 Example with Connection String eee penetret rrr Hetero pre 37 EXECUTESQLRETURNDELIMITED ccceessecesssscecsseececssseecsessesecsssaececsneecsesseeecsesaecesssseecsesaesecsesseceeseeeceesaeseeseaaess 37 EXECUTESQLRETURNDELIMITEDSEGMENT 0 ccssssccesseseecesssececessaececsceecsesaeeecseseececueeecsesueeecseceecesseeeceesaeeeceenaees 38 GEO T OA 39 DISTANCE ETE 39 DISTANCEBYZIP5 dd 39 DISTANCEBYZIPUKO s ia o ae amet 39 DISTANGEB YZIPO tee e EOD 40 GETEATLONGEROMZIP etae dete a 40 GETLATLONGEROMZIPS 4 eee od eeu mea e de ed o ced p Pe eed ete eec 40 EEX CEL erc 41 GETXLS V AEUE a 41 SEIXLSV ALUE iie pet nempe ae ite epe niei iei I ee ed 41 GETXLSOUTPUTO Conan A enn itn 41 A O NO 42 GETTEX
8. Connecting to SMTP Server 04509 psu communications gt sending sender Information gt sending Recipient Information gt sending piss ida Sending Attachment export saddles pdf Transmission complete Closing connection New Email Message To ixm psu edu 5 22 2002 12 00 14 PM Connecting to SMTP Server f04s09 cac psu edu communications gt sending sender Information gt Sending Recipient Information gt sending n gt Sending Attachment export Locks pdf Transmission complete gt C losing connection End of Master Report 55911680 5 22 2002 12 00 23 Effect of the SMTPHost option If the SMTPHost option in the EmailSet function is left blank the utility will attempt to automatically detect the SMTP server the remote computer responsible for processing your outgoing email messages If you get a timeout message you should specify the SMTP server yourself using its domain name for example smtp psu edu or its IP address Wrong SMTP server option would result in the following message CRUFLido Your attempt to send mail Failed For the Following reason s Invalid or Missing SMTP Host 2002 2015 Ido Millet ido MilletSoftware com Page 54 Add Email information using EmailAdd
9. as a number e g 1808600113 or as Hex e g 9432F3CF 2002 2015 Ido Millet ido 9 MilletSoftware com Page 8 GetMachinelP A ddress No arguments Returns a String with the IP Address of the machine where the Crystal report is running GetEnvironmentVar Arguments VariableName Returns The environment variable value for the specified variable name Note typical environment variable names include AppData LOCALAPPDATA PATH ProgramFiles CommonProgramFiles SystemDrive WinDir UserDomain UserProfile For example the following Crystal formula returns a value such as CreateGUID Arguments none Returns a GUID as string Example CreateGuid returns EODDC73A E7FA 484A A640 4DC79315AA 16 2002 2015 Ido Millet ido MilletSoftware com Page 9 GetImageProperties Arguments image file path amp name Returns Width Height string Example GetlmageProperties c temp MyLogo jpg returns 90 111 Notes If image file in not found the function returns File Not Found Supported image types are JPEG JPG GIF BMP and PNG If image type is not supported the function returns Image Type Not Supported BitWiseAnd Arguments Integer1 Integer2 Returns The result as Integer of a BitWise AND operation on the two input integers For example BitWiseAnd 13 6 Returns 4 NormDist Arguments x mean std Returns the cumulative probability for the value x under a normal d
10. doesn t exist it gets created automatically Note use CHR 34 in TextToAdd argument to generate double quotes in the text output If DeleteBeforeAdd is TRUE deletes the file before appending the text Note the deleted file is moved to the recycle bin where it can be recovered If CarriageReturnAfterA dd is set to FALSE follow up calls to this function would add content to the same line allowing wide exports beyond the 254 character limitation of String variables You can use the FileAddText function to generate your own log or export files from within Crystal formulas A specific example would be a situation where after using the functions below to electronically burst and e mail customers their invoices you want to update the database with information about which invoices were emailed You can write to a text file the invoice numbers that were included in the operation and use that file to update a Status column in the INVOICE table using an Update query WHERE INVOICE_N IN the set of invoice numbers If the text you are writing is longer than 254 characters break it to multiple calls like this StringVar MyText LargeText StringVar TargetFile c temp test txt chop and write the text in 254 character segments While Len MyText gt 254 Do FileAddT ext TargetFile Left MyText 254 False False MyText Mid MyText 255 write remaining small segment FileAddT ext TargetFile MyTe
11. t exist Note you may specify the path to the file in various ways Without http httpFileExists www MilletSoftware com Download MyFile zip With http httpFileExists http www MilletSoftware com Download MyFile zip As FTP location httpFileExists ftp ftp cac psu edu pub thesis packages win PsuThesiFull exe 2002 2015 Ido Millet ido MilletSoftware com Page 31 httpFileDownload Arguments File URL LocalFilePathName This function download a file on the web to a specified local file path and name Returns a String Error message if download process failed OK 1f the download succeeded Note you may specify the path to the web file in various ways as described in httpFileExists above httpFileDownloadRename Arguments File URL LocalFilePathName RenameToServerFileName This function 15 useful when a the remote file name is unknown the url responds with a download of an unknown file In that case use a temp file name in the 2 argument and set the 3 argument to TRUE rA Or E b when you wish to download a known file name to a different file name In that case set the 34 argument to FALSE Returns a String Error message if the download process failed Remote File Name if the download succeeded Note you may specify the path to the web file in various ways as described in httpFileExists above 2002 2015 Ido Millet ido MilletSoftware com Page 32 SOL ExecuteS
12. the computer to have access to the internet If the function stops performing you probably exceeded the daily hit quota for the web site You should switch to the DistanceByZip5 function which uses a local data file but is restricted to Canadian or 5 digit US zip codes GetLatLongFromZip Arguments Zip zip code e g 16563 or 16563 1400 Returns Latitude Longitude string Example GetLatLongFromZip 16563 1400 returns 42 124621 79 982133 Note this function receives data from a web site so it requires the computer to have access to the internet If the function stops performing you probably exceeded the daily hit quota for web site You should switch to the GetLatLongFromZip5 function which uses local data file but is restricted to Canadian or 5 digit US zip codes GetLatLongFromZip3 0 Arguments Zip Canadian or 5 digit US codes 16563 or MIBOA9 or 0A9 Returns Latitude Longitude string Example GetLatLongFromZip5 M1B 0A9 returns 43 807304 79 179753 Note this function requires that the CUT_Light ini file is installed to the default location of c Program Files CUT Light Or c Program Files x86 CUT Light Since it uses a local ini file it doesn t depend on a web connection and quota restrictions imposed by GetLatLongFromZip 2002 2015 Ido Millet ido MilletSoftware com Page 40 GetXLSValue Arguments Workbook Worksheet Cell Returns
13. 0D and returns its numeric value 4877 in this case Returns the numeric value of the hex string 2002 2015 Ido Millet ido 9 MilletSoftware com Page 14 File ini registry FileAge Arguments FileName Returns Age of file in minutes 1 if the given file path amp name doesn t exists Arguments FileToCopy DestinationFile Returns OK File Not Found Destination File Already Exists or error message Note use FileExists FileDelete to ensure the destination file doesn t already exist FileDelete Arguments FileToDelete Returns OK File Not Found or Error message if the delete fails FileExists Arguments FileName Returns If the given file path amp name exists returns TRUE Otherwise returns FALSE FileRename Arguments FileToRename NewName Returns OK File Not Found or Error message if rename fails Note use FileExists FileDelete to ensure the new file name doesn t already exist FileJustName Arguments FileName Returns file name without the path FileJustPath Arguments FileName Returns file path without the name 2002 2015 Ido Millet ido MilletSoftware com Page 15 FileAddText Arguments FileName TextToAdd DeleteFileBeforeAdd CarriageReturnAfterAdd Returns TRUE if successful otherwise FALSE Adds text to a given file file path and name If the file doesn t exist it gets created automatically If the directory
14. 1 else Decrypted String Encrypted String is Too Long 2002 2015 Ido Millet ido MilletSoftware com Page 44 Email Functions IsValidEmail Arguments email address Returns True if the email address looks valid False otherwise Note the logic only ensures correct structure and no invalid characters It doesn t check the domain and doesn t test whether the email address actually exists IsValidEmails Arguments email addresses separated by a separator The separator Returns True if all email addresses looks valid False otherwise Note the logic only ensures correct structure and no invalid characters It doesn t check the domain and doesn t test whether the email address actually exists Example Isvalidemails ido MilletSoftware com ixm7 psu edu Returns True EmailSet Arguments FromEmail FromName ToEmail ToName CcEmail CcName BccEmail ReplyToEmail Subject Message Attachment EnableLog SMTPHost Returns ignore the return value Used to set up but not yet trigger an e mail message A full example is provided later in this manual 2002 2015 Ido Millet ido 9 MilletSoftware com Page 45 EmailSet2 Arguments AsHTML LinksRoot Priority ReturnReceipt UseAuthentication UsePopAuthentication POP3Host UserName Password SMTPPort NoMessageBoxes Returns ignore the return value Used to follow EmailSet with more advanced options such allowing HTML me
15. 5 Append Done Active Outdoors Crochet Glove 516 20 Append Done InFlux Lycra Glove 369 69 Append Done Others 54 00 Append Done Send Done Saddles 750 84 Email Setup Done V esper Gelflex ATB Saddle 180 00 Append Done Xtreme Gellite Ladies Saddle 117 50 Append Done Xtreme Gellite Mens Saddle 117 50 Append Done Others 335 84 Append Done Send Done Locks 577 60 Email Setup Done Guardian Mini Lock 325 23 Append Done Xtreme Mtn Lock 91 63 Append Done Guardian ATB Lock 39 42 Append Done Others 121 32 Append Done Send Done 2002 2015 Ido Millet ido MilletSoftware com Page 51 E mail Content Sample You should then get three e mail messages The first e mail message should look like this X PH V4 1 f04n07 From Ido Millet sender lt ixm7 psu edu gt To Millet Ido recipient lt ixm7 psu edu gt Subject Sales Report for Gloves Reply to lt ixm7Opsu edu gt Date Mon 14 Apr 2003 13 18 24 0400 Hi Ido Here s your report summarizing the sales performance for Gloves Active Outdoors Lycra Glove 674 85 Active Outdoors Crochet Glove 516 20 InFlux Lycra Glove 369 69 Others 54 00 Note obviously in real use you would use the e mail address of each Product Type manager This would require having that information in your database Below is a more detailed description of the functionality 2002 2015 Ido Millet ido 9 MilletSoftware com Page 52 Email Setup using EmailSet EmailAdd
16. Add Email information using EmailAdd you can add more Recipients more Message Lines and more file attachments by using EmailAdd function as demonstrated below In this example we append message information about total sales EmailAdd gt one gt gt ttt vee gt CHR 13 CHR 10 Total Sales Value for Product Type Product_Type Product Type Name CHR 13 CHR 10 in Year was Cstr Sum Product_Type Product Type Name 0 Note The EmailAdd function does three distinct things in one function call add Recipients add Text to the message body and add Attachments If all you want to do is add text to the message body the other arguments would remain blank as shown above Note e mails sent via this utility will not appear in your OUT box since the operation bypasses your e mail client software If you want to see copies of the messages you send add yourself as To CC or BCC recipient 2002 2015 Ido Millet ido MilletSoftware com Page 55 Record Information to a Customized Log File using FileAddText I Write to a Custom Log File using FileAddText The FileAddText can be used to create any customized text logging export In real life you may want to embed this in an IF THEN to log information only when certain conditions in the report are met FileAddText File t
17. Added BlowFishDecrypt function Version 5 6 0 4 16 2012 Added DistanceByZipUK function Similar to DistanceByZip5 except that it is used for UK Outer Zip codes Version 5 5 0 12 13 2011 Fixed ZIP codes data set for cases with missing leading zeros Version 5 4 0 10 25 201 1 Added DistanceByZip5 function This function uses a local data file CUT Light ini so it is more reliable than the DistanceByZip function which require a web connection and is subject to a daily quota of hits On the down side it is limited to 5 digit zip codes Version 5 3 0 06 21 2011 Added FileListFromWildCards function Version 5 2 0 05 23 2011 Added ClipboardSetText function Added GetRegistered CompanyName function Added GetDriveSerialNumber function Updated the DistanceByZip and GetLatLongFromZip functions 99 9 Version 5 1 0 11 03 2010 Added NormDist function Version 4 9 0 2 4 2010 Added XLSGetValue function Version 4 8 0 11 2 2009 Fixed handling of New Lines embedded in RTF Files retrieved via FileGetText Version 4 7 0 3 7 2009 Added Distance function Added DistanceByZip function Added GetLatLongFromZip function Version 4 6 0 1 27 2009 Added httpFileExists function 2002 2015 Ido Millet ido MilletSoftware com Page 61 Version 4 5 0 10 10 2008 Added Hex2Number function Version 4 4 0 7 13 2008 Added GetMachineIPAddress function
18. Added FileGetText function Version 2 9 0 06 07 2004 Added GetRegistryString function Version 2 8 0 04 15 2004 FileAddText now automatically creates the specified file directory if it doesn t exist Version 2 7 0 03 12 2004 FileAddText can now create and add content to any text file not just files with TXT name extensions Version 2 6 0 12 12 2003 Fixed a problem leading to SMTP server error messages in special situations Version 2 5 0 09 20 2003 Added GetUser function to return the User Name who is logged into the PC Note among other things this can be used to address data access tracking requirements such as those imposed by HIPAA Health Insurance Portability and Accountability Act By using GetUser and FileAddText you can log to a text file information about who accessed what patient information and on what date Added GetMachineName function to return the Name of the PC running the report Incorporated an updated e mail component vbSendMail version 3 65 instead of 3 54 providing the following relevant improvements e Removed extra blank line from the beginning of the message body Fixed time date formatting error on certain language settings e Changed login authentication code to improve compatibility e Other minor bug fixes Version 2 0 10 10 2002 Released with a version number parallel to that of CUT 2002 2015 Ido Millet ido 9 MilletSoftware com Page 63
19. E 15 eene aom niteat reinen 15 EIPEDEEETE iiec oreet e UID 15 1 9 MPH 15 venie ron etc dica 15 EIEBIJUSTNAME n Ma endete ter Dn AA ENG EUN 15 PUB TUS TPA THC ace x Uni E ein ae E tei 15 FILEADDTEXT A sent ie nii eid itu 16 BIEEADDTEXTKEY ERRARE E ERRARE HORE NOE 17 Ie RR tenet etri erede RS dip lee nin ae eee HI eaa AnA 17 FIEEGETTEXTU nidi A ie enu 17 FIEELISTEROMWIEDCARDS i nectit nel epa ponia eonim 19 GETTEMPPEOEDER dba eaaet ie nmm et nmn REM 20 GETINIVALEBUE hti peg ere ied cte ir rec eet re ep iced elt e eei ee i eeu cet 20 SETINIVA TUE O C A 20 GETREGISTRYSTRING iii T 20 LOOKUPTEXTO A A A hte iet niet 21 2002 2015 Ido Millet ido 9 MilletSoftware com Page 2 GMT LOCAL TIME scsccsssssrssssrsersessrsersesssserssersesscssssessessssessessssesscsessesscsessnsscsensessesensessssessessesensessesensesecsenseseeses 21 GMTTOLOGALMINUTES Disc A il 21 MIRA iaa 22 23 MESSAGE INPUT BOXES poe ORAN 24 MESSAGBBOXOK Q e 24 MESSAGEBOXYESNOQ its A a a E 24 INPUTB OX ot 25 INPUTBOX2COMMANDO cni ette a 26 27 HTMLEEFIEE2RTEFFIEE A A e EIUS 27 HTMLSTRING2RTEFFILEE dci
20. Ido Millet ido MilletSoftware com Page 48 EmailAddText Arguments MoreText Returns ignore the return value This function offers a simple way simpler than EmailAdd with its long list of arguments to add text to the email message body Unlike EmailAdd which automatically starts added text on a new line EmailAddText simply continues the previous paragraph unless you specifically request a new line by including within the MoreText argument This provides more freedom in constructing long paragraphs without being forced to start new lines in the middle Note By calling EmailAdd several times you can create long message bodies Crystal imposes a limit of 254 characters each time you pass an argument to a function EmailSend No arguments Ignore the Return value Used to actually trigger the email message constructed using the EmailSet and EmailAdd functions above A full example is provided later in this manual 2002 2015 Ido Millet ido 9 MilletSoftware com Page 49 Using Functions I believe a concrete example is the best way to learn how these functions work Use Crystal to open and view the Master_with_multiple_formulas rpt report located in the folder where you installed CUT Light This report shows sale information by Product Type for a given year a parameter Let s assume you need to e mail information from this report so that the manager of each product type would receive the information ju
21. N ISSUES AND 64 2002 2015 Ido Millet ido 9 MilletSoftware com Page 4 Introduction CUT Light provides the same functionality as CUT except for the functions dealing with exporting and bursting slave reports This allows for a much smaller install file and a simpler User Manual CUT Light allows you to use functions within Crystal Report formulas to 1 E mail dynamic content messages from within any section of a Crystal report via SMTP used by e mail clients such as Eudora Outlook Outlook Express Netscape Messenger Pegasus Mail etc A variety of options are supported including multiple recipients CC Recipients BCC recipients and attachment files These options can be specified by using the EmailSet function call within a Crystal formula and by appending more elements or more text via follow up EmailAdd function calls before triggering the email via an EmailSend function call 2 Append Content to Text Files Note this can be used to take snapshots of information each time the report runs for example via Visual CUT scheduled processing Another Crystal report can then use the text file as a data source for information across multiple snapshots 3 Read Content of Text RTF HTML Files Provide the file path
22. Note possible Branch values are HKEY_CLASSES_ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_CURRENT_CONFIG HKEY_USERS For example the following Crystal formula returns the following value on my PC USERPROFILE AppData Local Temp 2002 2015 Ido Millet ido MilletSoftware com Page 20 LookupText Arguments FileName String2Match ExactMatch The file name should include the full path to a text file with KeylllValue pairs like this KeylllIValuel Key2IllValue2 Returns the Value from the first line where the Key matches the Strings2Match argument ExactMatch 15 a Boolean argument if it 15 True the Key must match the String2Match on all characters though the matching is not case sensitive If ExactMatch is False the process assumes a match if the key is found anywhere within the String2Match This function can be used to let end users maintain branching logic for a string formula without needing to change the formula within Crystal GMT Local Time GMTtoLocalMinutes Arguments None Returns The a String providing the number of minutes between Local and Universal GMT time taking into consideration Daylight Saving Time periods and the PC time zone setup If the function fails to find the value it returns Failed For example on my PC Eastern Standard Time GMTtoLocalMinutes returns 240 or 300 depending on Daylight Saving Time 2002 2015 Ido Millet ido MilletSoftware com Page 21 GM
23. ODBC DSN even one that is not used by the Crystal report or any OLEDB Connection String If SQL statement is longer than 254 characters break it into segments across up to 5 sql segments The SQL statement can be of a type that returns multiple records The function takes all the values in the first column of the result set and concatenates them into a single delimited string This function is just like ExecuteSQLReturnDelimited see detail in prior page except that it allows you to retrieve strings that are longer than 254 characters by breaking operation into segments Returns Breaking the resulting string into segments of 254 characters each the function returns the segment number specified by the Segment_N argument In Crystal you can load the entire result into a string variable using the following code WhilePrintingRecords String Var sResult String Var sSegment NumberVar 1 1 1 Keep appending segments of 254 characters to sResult string until reaching end nmm sSegment ExecuteSQLReturnDelimitedSegment Xtreme Sample Database Chr 10 chr 13 Select Customer Name from Customer 0 1 while sSegment lt gt Do sResult sResult sSegment 1 1 1 sSegment ExecuteSQLReturnDelimitedSegment Xtreme Sample Chr 10 chr 13 Select Customer Name from Customer 1 Return the resulting s
24. QLCanConnect Arguments ODBC DSN or OLEDB Connection String User ID Password This function tests whether a connection can be made to a database an ODBC DSN even one that is not used by the Crystal report or any OLEDB Connection String You may use such a test before calling other ExecuteSQL statements Returns TRUE or an error message if connection to the database failed Note you may refer to a saved encrypted password by its name if you also own Visual CUT and you copy the entry from the DataLink_Viewer ini file to the CUT_Light ini file like this Options Encrypted_Password_DB 64D26BF23E2C830AE2BE0A8EAC689353159D5618ED8D5D45 2002 2015 Ido Millet ido 9 MilletSoftware com Page 33 ExecuteSQLNoReturn Arguments ODBC DSN or OLEDB Connection String User ID Password sql1 8412 913 sql4 5415 This function executes a SQL statement against any ODBC DSN even one that is not used by the Crystal report or any OLEDB Connection String If the SQL statement is longer than 254 characters break it into segments across up to 5 sql segments The idea is to Update Delete or Insert records as a byproduct of viewing a Crystal report Returns or an error message if failed If the sql statement is not properly constructed e g missing single or double quotes you may get a Memory Full message from Crystal In such a case examine and adjust the sql statement If you email me a request for a sample r
25. TWIDTH isa A aa 42 GETEONTSIZELORITTEXT OS 42 ENCRYPTION M M A 43 BLOWFISHENCRY PT 5 neither entran etie D imt IE 43 BLOWFISHDEGRYPT O neon piod DICH D Denia UD DEO eiie 43 2002 2015 Ido Millet ido MilletSoftware com Page 3 BLOWFISHDECRYPTSEGMENT Di aaa 44 EMAL QU KOd COO Tc 45 ISVAEIDEMAIET 23 caa Itam anten et iietendt a cocer t 45 ISV ALIDEMAIES E Ru EE UE ERE E E eo E 45 EMAILESET 5 uper eee paie anna re Gea lest at et di ean 45 2 EET 46 tinent iuuenem Unde Eme e ED 48 BEMAIUADDTEXI 4 nen Menem iota ais 49 EMATE SEND AAEE E PEE EEEE RR 49 USING WE TOR LBS LO M Eee EN 50 Mund P E H 51 CONTENT SAMPLE terr eere rr E REPRE ERE p FO ERE 52 EMAIL SETUP USING EMAILSETO EMAILADDO AND EMAILSEND eee eese eere eene een seta seen uo 53 EFFECT OF THE ENABLELOG OPTION eere eene enero tetti ttes eset tea tete ease esee e 54 EFFECT OF THE SMTPHOST OPTION c0sccscccscessssscenccseceseensceuecsecsceessneesscescesesnncescececesesnsceueesecesesnsenuecseescsenenneesecesse 54 ADD EMAIL INFORMATION USING EMAILADDY nennen nnns 55 RECORD INFORMATION TO A CUSTOMIZED LOG FILE USING FILEADDTENXT eee 56 UPDATE HISTORY DT 57 KNOW
26. TtoLocal Arguments GMTEpoch Returns Local time as Epoch number of seconds since 1970 01 01 taking into consideration Daylight Saving Time periods and the PC time zone setup Web log files and databases frequently store DateTime information as Greenwich Mean Time GMT or Coordinated Universal Time UTC In your Crystal reports you may need to display this DateTime information as Local Time Since UFL s don t support DateTime arguments this function requires that you pass the GMT DateTime argument as Epoch number of seconds since 1970 01 01 Assuming you have a GMT DateTime field called GMTDateTime you can convert it to Epoch using this formula DateDiff s datetime 1970 01 01 GMTDateTime The function returns the Local Time as Epoch as well Assuming the Formula returning the Local Time as Epoch is called LocalTimeEpoch you can convert the Local Time result back to DateTime format using the following formula DateAdd s LocalTimeEpoch datetime 1970 01 01 You can combine the conversion steps into a single formula such as DateAdd s GM TtoLocal DateDiff s datetime 1970 01 01 GMTDateTime datetime 1970 01 01 Evaluating Report Processing Elapsed Time Since Crystal evaluates CurrentDateTime only once for each report you can t evaluate the time it took a report to process using Crystal functions If you pass a zero or a negative number to the GMTToLocal function it returns t
27. WildCards c mail attach xls sav 1 False lt gt Do sFile sFile FileListFromWildCards c mail attach xls sav i False i i 1 Ji Return the resulting string sFile to show each file on a new line replace delimiter with NewLine CarriageReturn Replace sFile Chr 10 Chr 13 To check for the existence of files matching a wild card expression you can use a Crystal formula like this IF Len FileListFromWildCards c temp zip 1 False gt 0 Then True Else False 2002 2015 Ido Millet ido MilletSoftware com Page 19 GetTempFolder Arguments None Returns The path to the user s temp folder without a closing GetINIValue Arguments FileName SectionName KeyName Returns The String value found in the ini file under the given section for the specified key Returns Failed INI Lookup if the lookup fails SetINIValue Arguments FileName SectionName KeyName KeyValue Returns TRUE if Successful FALSE if failed Writes the String value specified in KeyValue to the specified ini file Section and Key If the path exists but the ini file doesn t the function creates the ini file If the section and or key don t exist they get created GetRegistryString Arguments Branch Key_Name Value_Name Default Returns The registry string value if it was found If the registry value could not be found the Default value is returned
28. amp name as an argument to the FileGetText function and get the file content as a string You can use Crystal s formatting options to interpret the string as RTF or HTML You can also use Crystal s string search and manipulation functions to lookup values inside the text file 4 Check a File Exists Local or Web 5 Execute SQL statements against any ODBC data source 6 Lookup Set Values in ini files 7 Lookup Values in the Registry 8 Replace Accented Characters with Regular Ones 9 Convert GMT UTC to Local or Specified Time Zone 10 Compute Distance between Points by zip codes or by Lat Long 11 Trigger another Application via a Command Line 2002 2015 Ido Millet ido MilletSoftware com Page 5 12 Trigger Message amp Input Boxes Based Report Content 13 Embed Input from User in Command Line Calls 14 Trigger Report Processing by Visual CUT or DataLink Viewer 15 Convert HTML to RTF for Better Rendering in Crystal 16 Convert HEX strings to Values 17 Get User Name amp Name Running the Report Note this can be used to impose row level security or to address data access tracking requirements such as those imposed by HIPAA 18 Encrypt Decrypt Text Install Uninstall The zip file you received should contain a CRUFLido_Light msi Microsoft Installer file containing all the files to be installed and this document Double Clicking the CRUFLido_Light msi file will start the installation process whi
29. and EmailSend EmailSet sets up the mail message properties EmailAdd appends more elements or more text EmailSend triggers the actual e mailing Email Setup using EmailSet Note obviously the e mail functionality can be used on its own but in this case we use it to e mail the exported report after each bursting cycle T D E DN e ixm7 Ido Millet sender ixm7 psu edu Millet Ido recipient eee Il CcName rene BecEmail Blind Copy eee ReplyToEmail Note doesn t have to be your e mail ixm7 psu edu Sales Report for Product_Type Product Type Name CHR 13 CHR 10 Hi CHR 13 CHR 10 Here s your report summarizing the sales performance CHR 13 CHR 10 for Product Type Product Name vee TRUE 2002 2015 Ido Millet ido MilletSoftware com Page 53 Effect of the EnableLog option If the EnableLog option in the EmailSet function is set to TRUE all e mail activity including failure and success outcomes are logged to CRUFido log This text file can be opened by Notepad or any word processor and is automatically created by enabling this option It is located at the user s temp folder Here is what this log file looks like amp j CRUFLido log Notepad ii File Edit Format Help gt Closing Connection New Email Message To ixm psu edu 5 22 2002 12 00 12 PM
30. ataLink Viewer 9 exe y C NProgram Files DataLink Viewer 9 Product Type Catalog V9 rpt Parml Product Type Product Type Name Printer Default Print Copies 31 False Would prompt the user with the following dialog Print Report for Competition The Revenue for Competition is 1 970 125 37 Volume was 844 00 Please Specify How Many Printouts It would then replace the Input token in the command line with the value provided by the user so DataLink Viewer would print the information for that Product Type with the specified number of copies 2002 2015 Ido Millet ido MilletSoftware com Page 26 Web HTML HTMLfile2RTFfile Arguments HTMLfile RTFfile This function converts an HTML file the 1 argument to an RTF file the 2 argument Returns OK or Failed Since Crystal s support for RTF is more advanced than its support for HTML a typical scenario for using this functionality is to display HTML files by converting them to RTF and using RTF rather than HTML interpretation for the formula For example the following Crystal formula takes the CUT_Light htm file converts it to CUT Light rtf and then uses the FileGetText function to bring in the resulting RTF text HTMLfile2RTFFile c temp CUT_Light htm c temp CUT_Light rtf StringVar sFile NumberVar i i 1 Keep appending segments of 254 characters to the sFile string unti
31. ch takes care of registering the dll s and unless you specify another location defaults to installing some files to the C Program Files CRUF Lido_Light directory Double Clicking the CRUFLido_Light msi file again after the installation allows you to Uninstall the software If prompted during the install process you should elect to ignore cases where the file is already being used on your PC skipping the install of that file and not overwrite files on your PC with older versions from the Install 2002 2015 Ido Millet ido MilletSoftware com Page 6 After installation the formula editor within Crystal should show following new functions under Additional Functions Windows amp Miscelleneous NewKey Arguments KeyString Returns True if the string is a new key a NewKey call hasn t been issued for it within the same report preview session False 1f this is a new unique key in which case it gets added to an internal set of keys that 15 reset only when a new report preview is triggered This function can be used to avoid duplicate processing and to compute Distinct Sums Avoiding Duplicate Processing New Approach Crystal might evaluate the same formula multiple times as it renders the page content particularly when Keep Together properties cause shifting of page content from one page to another To avoid duplicate processing of CUT Light function you can use the NewKey above to ensure the
32. ct section 2002 2015 Ido Millet ido MilletSoftware com Page 35 ExecuteSQLReturnValue Arguments ODBC DSN or OLEDB Connection String User ID Password sql1 5412 913 sql4 5415 This function executes a SQL statement against any ODBC DSN even one that is not used by the Crystal report or any OLEDB Connection String If the SQL statement is longer than 254 characters break it into segments across up to 5 sql segments The SQL statement must be of a type that returns a single value rather than a result set A typical use is to look up or get information from a data source that is not included in the report Returns A string containing the result or an error message if failed You must guard against Null return values by first checking for count or by using an aggregate Min Avg Max If the sql statement is not properly constructed e g missing single or double quotes you may get a Memory Full message from Crystal In such a case examine and adjust the sql statement If you email me a request for a sample report I will email you an rpt file that demonstrates this functionality Below is a formula from that report as an example you can follow The formula returns the number of employees in the EMPLOYEE table even if that table or even the ODBC data source is not included in the report ExecuteSQLReturnValue Xtreme Sample Database Select Count from Employee Ww Www Www 7 T
33. e function takes all the values in the first column of the result set and concatenates them into a single delimited string Returns A string containing the result or an error message if failed If the sql statement is not properly constructed e g missing brackets single or double quotes you may get a Memory Full message from Crystal In such a case examine and adjust the sql statement If you email me a request for a sample report I will email you an rpt file that demonstrates this functionality Below is a formula from that report as an example you can follow The formula returns the last names of all employees delimited with a semi colon from the EMPLOYEE table in the Xtreme Sample Database even if that table or even the ODBC data source is not included in the report ExecuteSQLReturnDelimited Xtreme Sample Database lr Select Last Name from Employee The result is Davolio Fuller Leverling Peacock Buchanan Suyama King Callahan Dodsworth Hellstern Smith Patterson Brid Martin Note you may refer to a saved encrypted password by its name See information about this in the ExecuteSQLCanConnect section 2002 2015 Ido Millet ido MilletSoftware com Page 37 ExecuteSQL ReturnDelimitedSegment Arguments ODBC DSN or OLEDB Connection String User ID Password Delimiter sql1 8412 13 5014 5415 SegmentN This function executes a SQL statement against any
34. eRun to call Visual CUT For example the following Crystal formula Triggers processing of the Visual CUT rpt sample report overriding the saved parameter value with a value of 1996 Note that each double quotes in the command line must be duplicated a within the formula so it is recognized as such 2002 2015 Ido Millet ido MilletSoftware com Page 11 CmdRun Arguments CommandLineArguments This function triggers Cmd exe passing to it a command line Returns Done or error message This function is very similar to EXERun except that the EXE is Cmd exe and you don t need to figure out the path to that executable and how to trigger it without leaving a command window open For example the following Crystal formula would delete all files with tmp extensions in the temp folder 2002 2015 Ido Millet ido MilletSoftware com Page 12 String Text Manipulations PopulateTemplate Arguments Template ArgumentsArray EmptyReplacement Returns The result of substituting placeholders 0 1 2 in the Template string with the corresponding entries in the ArgumentsArray Null or empty arguments are replaced with the EmptyReplacement string If the result is longer than 510 characters Result is Longer than 510 characters Assume for example that you wish to build the syntax for an HTML table row with 3 elements First Name Last Name and Middle Initial The following formula PopulateTemplate l
35. ends the specified content to an internal variable If the call specified the TxtFile argument the resulting variable is also written to the specified text file and the internal variable is then reset This allows you to convert a large HTML string to plain text For example the following Crystal formula takes a large HTML string converts it to a text file and then uses the FileGetText function to bring in the resulting text file NumberVar i StringVar HTMLString HTMLString HTML String append the content to a global internal variable but don t yet write to a text File While Len HTMLString gt 254 Do HTMLstring2TxtFile Left HTMLString 254 HTMLString Mid HTML String 255 i i 1 Append to the string variable and write to the Text file HTMLstring2TxtFile HTML String c temp HTMLasText txt Get the Text File Content String Var sFile 1 Keep appending segments of 254 characters to sFile string until done while FileGetText c temp HTMLasText txt i lt gt Do sFile sFile FileGetText c temp HTMLasText txt i 1 lt 1 1 Return resulting string sFile 2002 2015 Ido Millet ido 9 MilletSoftware com Page 30 httpFileExists Arguments File URL This function checks if a specified file exists on the web Returns a String No Response from Web Site if the web site didn t respond TRUE if the file exists FALSE if the file doesn
36. eport I will email you an rpt file that demonstrates this functionality Below are two formulas from that report as examples you can follow The formula increments the Last Year s Sales column in the Customer table by 1 ExecuteSQLNoReturn Xtreme Sample Database Update Customer SET Last Year s Sales Last Year s Sales 1 WHERE TRUE nw nw nw nw This formula sets Customer 7 Address2 column to its Last Year s Sales ExecuteSQLNoReturn Xtreme Sample Database Update Customer SET Address2 Last Year s Sales WHERE nw Customer ID 7 nw wee wee nw This formula demonstrates using information from the current section in the report whileprintingrecords ExecuteSQLNoReturn Vision Offline SYSDBA sesame Update ENTRY SET PRINTED 1 WHERE ENTRY ID Www Www Www Www Embedding File s Content in the SQL Statement If you need to trigger a large SQL script you can embed within any of the sql segments references to files using the following token structure For example Such tokens are replaced with the content of the specified files if such files exists You can use as many file tokens as you wish If an inserted file has embedded file tokens they would be replaced as well the process is recursive 2002 2015 Ido Millet ido MilletSoftware com Page 34 Avoiding Duplicate Processing old approach S
37. essing New 7 CLIPBOARDSETTEX TO 2 ee edle bec e elei dee pecie de eee cde ede rette dd 8 GETUSERO CT 8 ate ai ed I dE edu EE MU 8 GETREGISTEREDCOMPANYNAMEQ odiada 8 GETDISKSERITAL NUMBER ii 8 GETMACHINEIPADDRESS O eE a eiie itia eere ed pce b dase tee pede eed e 9 GETENVIRONMENTV AR tede teet er ii 9 CREATEGWIDQ E ton oe ie nud ee ME GI ER 9 GETIMAGEPROPERTIES ind nere n ERR D iH ne ae 10 IB VARII ID 10 A E 10 VISUALCUTRUN O cta A lo dd 11 EXERUNO ict ideni e e A addi a E EGER CR edi e i a Ies 11 CMDRU NO TEE Een AE NN 12 STRING TEXT MANIPULATIONS c eeeeee ee esee ee ette etae n stone tane 13 POPULATETEMPEATEDQ tnr opi eterne etate Dn iim ted Y 13 tenes 13 REPEACEACCENTEDGHARS 5 etie dette aa 13 2 elg m OA 14 HEX2NUMBER itae nun aen ied niea ue iun up 14 FILE INVREGISTRY eissis 15
38. essing for any function call and to compute Distinct Sums Added FileAddTextKey function This allows avoiding duplicate processing when writing to a text file Version 6 1 3 5 18 2013 Added GetFontSizeToFitText function Version 6 1 2 5 7 2013 Added httpFileDownload function Version 6 1 1 4 8 2013 Added HTMLString2Txtfile function Version 5 9 9 3 31 2013 Added FileGetTextUTFS function Version 5 9 8 3 20 2013 Added IsValidEmail function Version 5 9 7 1 23 2013 Added BitWiseAnd function Version 5 9 6 10 19 2012 ExeRun can now also trigger batch bat and command cmd files Version 5 9 5 9 22 2012 ExecuteSQLNoReturn can now embed the content of referenced text files inside the specified SQL See Embedding File s Content in the SOL Statement Version 5 9 0 7 31 2012 Fixed a problem with ExecuteSQL functions with multiple segments if a segment ended in the middle of a word Version 5 8 0 7 7 2012 Added BlowFishDecryptSegment function 2002 2015 Ido Millet ido MilletSoftware com Page 60 Version 5 7 0 6 21 2012 DistanceByZip5 can now handle US Zip codes as well as Canadian Zip Codes Added function This function uses a local data file CUT Light ini so it is more reliable than the GetLatLongFromZip function which require a web connection and is subject to a daily quota of hits Added BlowFishEncrypt function
39. ever it is used to trigger another executable just like the ExeRun function described above and insert the user s input into the command line passed to the executable The 3 command line arguments allow you to construct a command line that is longer than 254 characters the function simply combines the 3 arguments into a single command line The DebugWindow argument True or False allows you to request a display of the resulting command line useful for debugging purposes Returns Error message if the ExePath doesn t find an exe file in the specified location No Input Processing Skipped if the user clicks Cancel or input was blank The user entered text up to 254 characters if the user clicks OK A possible scenario for using this functionality is to trigger printing of information on the report via a call to DataLink Viewer and another report passing the product name as a parameter and the number of copies as an Input from the user For example the following Crystal formula placed in a Group Footer for Product Type InputBox2Command The Revenue for amp Product Type Product Type Name amp is amp Sum value Product Type Product Type Name amp Chr 10 Volume was Sum Orders Detail Quantity Product Type Product Type Name amp Chr 10 chr 10 amp Please Specify How Many Printouts Print Report for amp Product Type Product Type Name 1 C Program Files DataLink Viewer 9 D
40. f the worksheet can t be found Example GetXLSOutput c temp test xIsx B2 LookUpValue 4 Notes 1 If you leave the sheet name blank 6699 or as 1 the first sheet in the workbook is used 2002 2015 Ido Millet ido MilletSoftware com Page 41 Font GetTextWidth Arguments Text FontName FontSize Bold Italic Units Returns The width of the text in specified Units Twips or Pixels 1 if an error occurs Note 1440 twips 1 inch Examples GetTextWidth Employee Last Name Arial 10 False False Pixels GetTextWidth Employee Last Name Arial 10 False False Twips GetFontSizeToFitText Arguments Text FontName Available Width Bold Italic Units The Units argument reflects the units in which Available Width was specified Inches Centimeters Twips or Pixels Returns The largest font size that would fit the specified text within the available width 1 if an error occurs Example GetFontSizeToFitText This is Some Text Arial 2 False False Inches returns a value of 18 so font size of 18 15 the largest that would fit that text in 2 Inches Note typically used to dynamically control the font size of a field formula in Crystal 2002 2015 Ido Millet 1409 MilletSoftware com Page 42 Encryption BlowFishEncrypt Arguments StringToEncrypt Key Returns The encrypted text as HEX using the BlowFish algorithm
41. for example for constructing HTML table syntax where empty cells should contain a non breaking space amp nbsp Added FileJustPath function to return the path to a file Added FileJustName function to return the name of a file Version 6 2 9 10 14 2014 Added GMTtoLocalMinutes function to return the number of minutes between local and universal GMT time taking into account DayLight Savings periods Added ExpandStringwithEnvironmentVar function to return an input string after expanding any references to environment variables within it to their dynamic values Version 6 2 8 8 6 2014 Added GetTempFolder function to return the path to the user s temporary folder Changed email logging to use the user s temp folder instead of the application folder of the process running the Crystal report Version 6 2 7 7 28 2014 Added FileA ge function to return file age in minutes 2002 2015 Ido Millet ido MilletSoftware com Page 57 2002 2015 Ido Millet ido 9 MilletSoftware com Page 58 Version 6 2 6 6 25 2014 Added ExecuteSQLCanConnect function to test connection to a database before calling other ExecuteSQL functions Improved error handling for ExecuteSQL functions to avoid memory full error when connection to database fails If you also own Visual CUT you can refer to saved encrypted passwords by their name instead of specifying the password itself You need to copy the encrypted pa
42. he current system date amp time This is useful for timing report processing Place the following formula in the report header to capture the start time WhilePrintingRecords DateTimeVar ldt start 1 start DateAdd s GMTtoLocal 0 datetime 1970 01 01 And place the following formula in the report footer to display the elapsed time WhilePrintingRecords DateTimeVar ldt start DateDiff s Idt start DateAdd s GMTtoLocal 0 datetime 1970 01 01 2002 2015 Ido Millet ido MilletSoftware com Page 22 GMTtoZone Arguments GMTEpoch ToZone Returns Specified zone s time as Epoch number of seconds since 1970 01 01 This function is very similar to the GMTtoLocal function described above except that instead of automatically detecting the local time zone on the user s PC it converts the specified GMT UTC time to time at the specified time zone Possible values for the ToZone argument are Tonga Standard Time GMT 13 00 Africa Standard Time GMT 03 00 New Zealand Standard Time GMT 12 00 GTB Standard Time GMT 02 00 Fiji Standard Time GMT 12 00 E Europe Standard Time GMT 02 00 Central Pacific Standard Time 11 00 Egypt Standard Time GMT 02 00 E Australia Standard Time GMT 10 00 South Africa Standard Time GMT 02 00 AUS Eastern Standard Time GMT 10 00 FLE Standard Time GMT 02 00 West Pacif
43. he default location of c Program Light Or c Program Files x86 CUT Light Since it uses a local ini file it doesn t depend on a web connection and quota restrictions imposed by DistanceByZip DistanceBy ZipUK Arguments Zip1 Zip2 unit_of_measure Zipl and Zip2 are the UK Outer Codes of the two points e g AB16 and AB30 unit_of_measure is how the result should be provided m for miles k for kilometers n for nautical miles Returns Distance in the requested units of measure Example DistanceByZipUK AB16 returns 48 92 Kilometers Note this function requires that the CUT_Light ini file is installed to the default location of c Program Files CUT Light c Program Files x86 CUT Light Since it uses a local ini file it doesn t depend on a web connection and quota restrictions imposed by DistanceByZip 2002 2015 Ido Millet ido MilletSoftware com Page 39 DistanceByZip Arguments Zip1 Zip2 unit_of_measure Zipl and Zip2 are the zip code of the two points e g 16563 or 16563 1400 unit_of_measure is how the result should be provided m for miles k for kilometers n for nautical miles Returns Distance in the requested units of measure Example Distance 16509 16563 11400 m returns 5 76 distance in miles between the two points Note this function receives data from a web site so it requires
44. ic Standard Time GMT 10 00 Israel Standard Time GMT 02 00 Tasmania Standard Time GMT 10 00 W Europe Standard Time GMT 01 00 Vladivostok Standard Time GMT 10 00 Central Europe Standard Time GMT 01 00 Cen Australia Standard Time GMT4 09 30 Romance Standard Time GMT 01 00 AUS Central Standard Time GMT 09 30 Central European Standard Time GMT 01 00 Tokyo Standard Time GMT 09 00 W Central Africa Standard Time GMT 01 00 Korea Standard Time GMT 09 00 GMT Standard Time GMT Yakutsk Standard Time GMT 09 00 Azores Standard Time GMT 01 00 China Standard Time GMT 08 00 Cape Verde Standard Time GMT 01 00 North Asia East Standard Time 08 00 Mid Atlantic Standard Time GMT 02 00 Singapore Standard Time GMT 08 00 E South America Standard Time GMT 03 00 W Australia Standard Time GMT 08 00 SA Eastern Standard Time GMT 03 00 Taipei Standard Time GMT 08 00 Greenland Standard Time GMT 03 00 SE Asia Standard Time GMT 07 00 Newfoundland Standard Time GMT 03 30 North Asia Standard Time GMT 07 00 Atlantic Standard Time GMT 04 00 Myanmar Standard Time GMT 06 30 SA Western Standard Time GMT 04 00 N Central Asia Standard Time 06 00 Pacific SA Standard Time GMT 04 00 Central Asia Standard Time GMT 06 00 SA Pacific Standard Time GMT 05 00 Sri Lanka Standard Time GMT 06 00 Eastern Standard Time GMT 05 00 Nepal Standard Time GMT 05 45 Central America Standard Time GMT 06 00 India Standard Time GMT 05 30 Central Standard Time GMT 06 00 Ekaterinburg S
45. ince Crystal may evaluate the same formula multiple times as 1t renders the page content particularly when Keep Together properties cause shifting of page content from one page to another the SQL statements may fire more than once This can be a problem in cases where an Update statement 15 incrementing a value To guard against duplicate processing you can leverage CUT Light s ability to read and write ini file values Here is an example If GetIniValue c cutlight ini PickTicket rpt HDR i TKT NO Failed INI Lookup Or DateDiff s CDateTime GetIniValue c Ncutlight ini PickTicket rpt HDR TKT CurrentDateTime gt 10 then ExecuteSQLNoReturn ODBC1 Update DB1 dbo TKT HDR SET DB1 dbo TKT HDR TIMES PRTD DB1 dbo PS TKT HDR TIMES PRTD 1 WHERE DBl dbo TKT HDR TKT NO TKT HDR TKT NO 4 SetIniValue c Ncutlight ini PickTicket rpt TKT HDR TKT NO ToText CurrentDateTime This formula starts by checking that a value for that particular record ticket number hasn t yet been written to the ini file or if it has it hasn t happened within the last 10 seconds If that condition is satisfied the formula then proceeds to execute the Update statenment and record the execution time for that particular ticket in the ini file Note you may refer to a saved encrypted password by its name See information about this in the ExecuteSQLCanConne
46. istribution with the specified mean and standard deviation For example NormDist 7 5 2 0 8413 2002 2015 Ido Millet ido MilletSoftware com Page 10 VisualCutRun Arguments Visual CUTExePath CommandLineArguments This function triggers processing of another report by Visual CUT Visual CUT is a Crystal Report Manager package developed by Millet Software www MilletSoftware com A typical scenario for using this functionality is running a report on Crystal Enterprise or another software package and using the viewing of that report as a trigger mechanism for exporting printing and or e mailing of information in another report Returns Done if the Visual CUT executable was found in the specified path Otherwise returns an error message For example the following Crystal formula Triggers processing of the Visual CUT rpt sample report overriding the saved parameter value with a value of 1996 Note that each double quotes in the command line must be duplicated a within the formula so it is recognized as such EXERun Arguments ExePath CommandLineArguments This function triggers another application EXE or Bat or Cmd file passing to it a command line Returns Done if the executable was found in the specified path Otherwise returns an error message This function is very similar to VisualCutRun except that it is free to call any application not just Visual CUT You can still use the Ex
47. l done while FileGetTextUTF8 c temp CUT_Light rtf i lt gt Do sFile sFile FileGetTextUTF8 c temp CUT_Light rtf i i i 1 Return the resulting string sFile The left display is HTML with a numbered list shown as RTF in Crystal The right display is the original HTML shown as HTML in Crystal Note that some aspects of the formatting are lost in the Crystal HTML interpretation Testing Testing 1 Item 1 Item 1 Item 2 Red Bold 2 Item2 Red Bold Item 3 Blue 3 Item 3 Blue For a description of RTF rendering limitations in Crystal Reports see SAP Note 1214798 What RTF tags are supported in Crystal Reports 2002 2015 Ido Millet ido MilletSoftware com Page 27 For a description of HTML rendering limitations in Crystal Reports see SAP Note 1217084 What are the supported HTML tags and attributes with HTML Text Interpretation 2002 2015 Ido Millet ido MilletSoftware com Page 28 HTMLstring2RTFFile Arguments HTMLstring RTFFile This function converts an HTML string the 1 argument to an RTF file the 29 argument Returns or Failed Since Crystal s support for RTF is more advanced than its support for HTML a typical scenario for using this functionality is to display HTML string stored in a database column by converting it to RTF and using RTF rather than HTML interpretation for the formula For example the following Crystal formula takes the html string in Cus
48. mailSet 2002 2015 Ido Millet ido MilletSoftware com Page 47 EmailAdd Arguments ToEmail ToName CcEmail CcName BccEmail Message Attachment Returns ignore the return value Used to add more recipients append more text to the e mail message or add file attachments to the e mail message that was set up by a previous EmailSet function call A full example is provided later in this manual Note By calling EmailAdd several times you can create long message bodies Crystal imposes a limit of 254 characters each time you pass an argument to a function Note if you set as TRUE the ASHTML argument of the EmailSet2 function make sure you are using proper HTML tags in content you add via the Message argument For example you can call EmailAdd for each Product within a Product Type group and specify this as the Message argument lt ul gt lt li gt lt p gt GroupName Product Product Name Product_Value lt p gt lt li gt lt ul gt This would append bullets with information about each Product to the e mail message 15 x Who To Millet Ido recipient lt ixm 7 psu edu gt Subject Sales Report for Gloves Hi Ido Here s the sales performance for Gloves e Active Outdoors Lycra Glove 674 85 e Active Outdoors Crochet Glove 516 20 e InFlux Lycra Glove 369 69 e Others 54 00 FDF Lh p export Gloves32 pdf 2002 2015
49. nce the recipient has opened the message Note not supported by all email clients UseAuthentication Set this Boolean argument to TRUE if your SMTP mail server requires LOGIN Authentication In such cases provide also UserName and Password arguments UsePOPAuthentication Set this Boolean argument to TRUE if your SMTP mail server requires POP First authentication Some servers e g yahoo com require POP3 2002 2015 Ido Millet ido MilletSoftware com Page 46 authentication before allowing SMTP transactions In such cases provide also POP3Host UserName Password arguments POP3Host this String argument is required by servers configured for POP First authentication The POP3Host address can be provided in 123 45 678 9 format or as a domain name e g mymailhost com UserName Password Set these String arguments if SMTP or POP3 authentication are required Note you may refer to a saved encrypted password by its name if you also own Visual CUT and you copy the entry from the DataLink_Viewer ini file to the CUT_Light ini file like this Options Encrypted_Password_DB 64D26BF23E2C830AE2BE0A8EAC689353159D5618ED8D5D45 SMTPPort Set this String argument if your SMTP server is not using port 25 NoMessageBoxes Set this Boolean argument to TRUE if you want to suppress messages due to failed email operations This feature was requested by one user who needed unattended operation Note call EmailSet2 after E
50. ns a regular parameter would prompt the user under all conditions For example the following Crystal formula Triggers an email message if the grand total of the Net amount is more than 100 000 and the user responded positively to the message box 2002 2015 Ido Millet ido MilletSoftware com Page 24 InputBox Arguments Prompt Title DefaultText This function triggers an Input Box allowing the user to enter text Returns Blank text if the user clicks Cancel The user entered text up to 254 characters if the user clicks OK A typical scenario for using this functionality is to add comments to areas in the report that show exceptional good bad performance This is something that standard report parameters cannot do because a parameters always get triggered while InputBox can be conditionally triggered and b parameters return fixed values while InputBox can be triggered multiple times for example once for each record or group with an exceptional value For example the following Crystal formula Triggers the following Input Box High Returns for Competition Competition has high Returns Please explain 2002 2015 Ido Millet ido MilletSoftware com Page 25 InputBox2Command Arguments Prompt Title DefaultText ExePath CommandLinel CommandLine2 CommandLine3 DebugWindow This function and the first 4 arguments behaves just like the InputBox function described above How
51. o add text to c temp My_Log txt Text added to the file Product Type Product Type Product Type Name Cstr CurrentDateTime FALSE Don t delete this file before adding the text FALSE FALSE Don t Add an Extra carriage return at the end of the added text FALSE 2002 2015 Ido Millet ido MilletSoftware com Page 56 Update History Version 6 4 6002 9 13 2015 Fixed an issue with httpFileDownloadRename Packaged with a newer Chilkat dll to match the version used by Visual CUT Version 6 4 6 8 14 2015 Added SetXLS Value function to set the value of a spreadsheet cell Added FileDelete FileRename and FileCopy functions Added CmdRun function to pass a command line to Cmd exe Version 6 4 4 8 6 2015 Added information for missing USA zip codes needed for DistanceByZip50 Version 6 4 3 7 6 2015 Packaged with a newer Chilkat dll to match the version used by Visual CUT Version 6 4 2 6 4 2015 Packaged with a newer Chilkat dll to match the version used by Visual CUT Added httpFileDownloadRename function to return the original file name downloaded from the server and to elect to keep or restore that name to the downloaded file Version 6 3 1 4 1 2015 Added PopulateTemplate function to facilitate constructing strings mixing static and dynamic content The functionality includes special handling for missing or Null dynamic values This is useful
52. ows you to break the text you need to decrypt into up to 5 segments that are each no longer than 254 characters Here is a Crystal formula sample that automatically breaks a string to such segments StringVar Plain String Long Plain Text or a reference to a Crystal field formula StringVar Encrypted String BlowFishEncrypt Plain String Sesame String Var Decrypted String IF Len Encrypted String lt 254 Then Decrypted String BlowFishDecryptSegments Sesame Encrypted String Else If Len Encrypted String lt 254 2 Then Decrypted String BlowFishDecryptSegments Sesame Left Encrypted String 254 Mid Encrypted String 254 1 Else If Len Encrypted String lt 254 3 Then Decrypted String BlowFishDecryptSegments Sesame Left Encrypted String 254 Mid Encrypted String 254 1 254 Mid Encrypted String 254 2 1 Else If Len Encrypted String lt 254 4 Then Decrypted String BlowFishDecryptSegments Sesame Left Encrypted String 254 Mid Encrypted String 254 1 254 Mid Encrypted String 254 2 1 254 Mid Encrypted String 254 3 1 Else If Len Encrypted String lt 254 5 Then Decrypted String BlowFishDecryptSegments Sesame Left Encrypted String 254 Mid Encrypted String 254 1 254 Mid Encrypted String 254 2 1 254 Mid Encrypted String 254 3 1 254 Mid Encrypted String 254 4
53. r RTF text rather than plain text you can take advantage of Crystal s formatting options to interpret the string returned by the formula as HTML or RTF Also be sure to use Crystal s Can Grow formatting option where appropriate FileGetTextUTFS 2002 2015 Ido Millet ido MilletSoftware com Page 17 Same as FileGetText except that it works with text files with UTF 8 encoding 2002 2015 Ido Millet ido MilletSoftware com Page 18 FileListFromWildCards Arguments FileName s Delimiter Segment N Recursive Notes the FileName argument can include one or more path and wild card patterns separated by the specified Delimiter The second element in such a delimited list can drop the path if it uses the path of the element before it For example c Mail Attach xls pdf e If Recursive is set to True the search process recourses down into subfolders Returns A delimited list of all files matching the specified FileName s patterns Breaking the file list content into segments of 254 characters each the function returns the segment number specified by the Segment_N argument If the specified file path amp name doesn t exist an empty string is returned In Crystal you can load the entire file list into a string variable using the following code String Var sFile NumberVar 1 1 1 Keep appending segments of 254 characters to sFile string until we reach the end of the file List while FileListFrom
54. same process is not triggered twice Here is an example WhilePrintingRecords NewKey Product Type Product Type Name Then FileAddText c NtempNtestNewkey txt Product Type Product Type Name False True This formula writes to text file only if the NewKey function confirms that the current Product Type Name hasn t been processed yet 2002 2015 Ido Millet ido MilletSoftware com Page 7 ClipboardSetText Arguments TextToSet Returns The text specified as an argument For example ClipboardSetText ToText Invoice Invoice N 0 GetUser No arguments Returns a String with the ID of the user logged to the PC Note among other things this can be used to address data access tracking requirements such as those imposed by HIPAA Health Insurance Portability and Accountability Act By using GetUser and FileAddText you can log to a text file information about who accessed what patient information and on what date GetMachineName No arguments Returns a String with the PC name where the Crystal report is running GetRegistered Company No arguments Returns a String with the Windows Registered Company Name GetDiskSerialNumber Arguments FormatAsHex Returns the serial number of the current disk drive If the FormatAsHex argument is set to True the number is returned formatted as HEX Returns a String displaying the serial number of the current disk drive
55. ssage bodies setting message priority requesting Return Receipt providing user id and password for mail host and POP3 authentication and specifying SMTP Port in cases where users must override the default port 25 AsHTML set this Boolean argument to TRUE if your message body should be interpreted and displayed by the receiving email client as HTML instead of plain text Your message body specified via EmailSet and EmailAdd function calls should includes valid HTML tags such as lt html gt lt body gt lt h1 gt Hi Ido lt h1 gt Here s the sales performance for lt B gt Product_Type Product Type Name lt B gt lt body gt lt html gt NOTE if ASHTML is set to TRUE files for example lt img src myfile gif gt referenced inside the HTML should be included as file attachments to the e mail message LinksRoot Applies to messages sent as html If you set this String argument to http www mysite com you can reference images as lt IMG SRC images happyface gif gt instead of lt IMG SRC http www mysite com images happyface gif gt Note not supported by all email clients Priority Set this String argument to High Medium or Low If you leave this argument as it will default to Normal priority Note not supported by all email clients ReturnReceipt Set this Boolean argument to TRUE to request that a confirmation be emailed back to o
56. ssword name entry from the ini file in Visual CUT to the CUT_Light ini file Options Encrypted Password DB 64D26BF23E2C830AE2BEOA8EAC689353159D5618ED8D5D45 Version 6 2 5 5 12 2014 Added GetImageProperties function This function allows getting image width and height for a specified image file Added CreateGUIDO function Version 6 2 4 1 1 2014 Added GetXLSOutput function This function allows specifying an input value for a specified cell and getting the output value in another cell One typical use scenario is for VLOOKUP functionality Version 6 2 3 12 06 2013 Added LookupText function for looking up a value in a text file containing Key Value pairs Version 6 2 2 11 13 2013 Added GetEnvironmentVar function get Windows environment variable values Version 6 2 1 10 17 2013 Added IsValidEmails function for checking multiple email addresses Version 6 1 9 8 14 2013 ExecuteSQLReturn functions now return an empty string if the SQL statement resulted in a NULL Updated the description of the 4 SQL functions function ExecuteSQLNoReturn ExecuteSQLReturnValue ExecuteSQLReturnDelimited ExecuteSQLReturnDelimitedSegment to reflect the fact that they support specifying either an ODBC DSN or an OLEDB Connection String as the data source 2002 2015 Ido Millet ido MilletSoftware com Page 59 Version 6 1 8 6 19 2013 Added NewKey function This allows avoiding duplicate proc
57. st for that product type Study the following formulas don t preview the report yet since this would generate e mails to me 1 The Set_Up_Email formula is located in a Product Type group header This formula uses the EmailSet function provided by the CUT utility to set up but not yet send the e mail message to the Product Type manager Important please be sure to change all e mail addresses specified in this formula to your own e mail address Otherwise a preview of this report would generate e mail messages to me The Append_to_Email formula is located in the Product Name group level 2 footer This formula uses the EmailAdd function provided by the CUT utility to append to the text of the e mail message summary information for each product included in the report export for the current Product Type Finally Send Email formula is located in the Product Type group level 1 footer This formula uses the EmailSend function provided by the CUT utility to send the e mail message constructed by the previous function calls 2002 2015 Ido Millet ido MilletSoftware com Page 50 Preview Assuming you changed the e mail addresses in the Set_Up_Email formula to your own e mail address you can preview the report Select TRUE for the Enable_Email parameter Monday April 14 2003 Ido Millet ixm7 poa edu Product Sales by Type in 1996 Gloves 1 614 74 Email Setup Done Active Outdoors Lycra Glove 674 8
58. t TR gt lt TD gt 0 lt TD gt lt TD gt 1 lt TD gt lt TD gt 2 lt TD gt lt TR gt Ido Millet 4 amp nbsp would return the following string lt TR gt lt TD gt Ido lt TD gt lt TD gt Millet lt TD gt lt TD gt nbsp lt TD gt lt TR gt Note instead of specifying an array of strings you can pass in an array string variable For example PopulateTemplate lt TR gt lt TD gt 0 lt TD gt lt TD gt 1 lt TD gt lt TD gt 2 lt TD gt lt TR gt MyStringArrayVar amp nbsp ExpandStringwithEnvironmentVar Arguments InputString Returns The input string after expanding any references to environment variables within it to their dynamic values For example the following Crystal formula ExpandStringwithEnvironmentVar UserName gt 9otemp 4c returns the following on my PC where my user id is 1xm7 ixm7 gt C Users ixm7 AppData Local Temp ReplaceAccentedChars Arguments String This function replaces all accented characters in the input string with their non accented versions for example 6 gt e Upper amp lower case are preserved Returns the converted string 2002 2015 Ido Millet ido MilletSoftware com Page 13 Hex2Ascii Arguments String This function takes hex string eg ed0972ba628b29f0ec and returns its ascii equivalent Returns the ascii string Hex2Number Arguments String This function takes hex string for example 00013
59. tandard Time GMT 05 00 Mexico Standard Time GMT 06 00 West Asia Standard Time GMT 05 00 Canada Central Standard Time GMT 06 00 Afghanistan Standard Time GMT 04 30 Mountain Standard Time GMT 07 00 Arabian Standard Time GMT 04 00 Pacific Standard Time GMT 08 00 Caucasus Standard Time GMT 04 00 Alaskan Standard Time GMT 09 00 Iran Standard Time GMT 03 30 Hawaiian Standard Time GMT 10 00 Arabic Standard Time GMT 03 00 Samoa Standard Time GMT 11 00 Arab Standard Time GMT 03 00 Dateline Standard Time GMT 12 00 Russian Standard Time GMT 03 00 Note GMTtoZone properly handles Daylight Saving Time periods at the specified zone 2002 2015 Ido Millet ido 9 MilletSoftware com Page 23 Message Input Boxes MessageBoxOK Arguments Message Title This function triggers a message box with an OK button Returns Ignore the return value A typical scenario for using this functionality is to display a message in a runtime environment that doesn t support Crystal Report alerts For example the following Crystal formula Triggers a message box if the grand total of the Net amount is more than 100 000 MessageBox YesNo Arguments Message Title This function triggers a message box with a YES and NO buttons Returns 1 if the user clicked YES and 0 if the user clicked NO A typical scenario for using this functionality is to condition further processing in the report on a user response but only in specific situatio
60. tomer Comments converts it to CUT Light rtf and then uses the FileGetText function to bring in the resulting RTF text HTMLstring2RTFFile Customer Comments c temp CUT_Light rtf StringVar sFile NumberVar i i 1 Keep appending segments of 254 characters to the sFile string until done while FileGetText c temp CUT_Light rtf i lt gt Do sFile sFile FileGetText c temp CUT_Light rtf i i i 1 Return the resulting string sFile The left display is HTML with a numbered list shown as RTF in Crystal The right display is the original HTML shown as HTML in Crystal Note that some aspects of the formatting are lost in the Crystal HTML interpretation Testing Testing 1 Item 1 Item 1 Item 2 Red Bold 2 Item2 Red Bold Item 3 Blue 3 Item 3 Blue For a description of RTF rendering limitations in Crystal Reports see http support businessobjects com library kbase articles c2011504 asp For a description of HTML RTF rendering limitations in Crystal Reports see http support businessobjects com library kbase articles c2014842 asp 2002 2015 Ido Millet ido MilletSoftware com Page 29 HTMLString2Txtfile Arguments HTMLString Txtfile This function converts an HTML string the 1 argument to a Text file the 204 argument Returns OK or Failed To support cases where the HTML string is longer than 254 characters if the TxtFile argument is left out the call simply app
61. tring sResult Note if you email me a request for a sample report I will email you an rpt file that demonstrates this functionality Note you may refer to a saved encrypted password by its name See information about this in the ExecuteSQLCanConnect section 2002 2015 Ido Millet ido 9 MilletSoftware com Page 38 Geo Distance Arguments lon1 lat2 lon2 unit of measure 1001 are latitude and longitude of point 1 in decimal degrees lat2 lon2 are the latitude and longitude of point 2 in decimal degrees unit of measure is how the result should be provided m for miles k for kilometers n for nautical miles This function calculates the distance between two points given the latitude longitude of those points Note that south latitudes are negative east longitudes are positive Returns Distance in the requested units of measure Example Distance 52 2047 0 1406 53 2047 0 1406 returns 69 09 DistanceByZip5 Arguments Zipl Zip2 unit of measure Zipl and Zip2 are the Canadian or 5 digit US zip code of the two points e g 9 and 16509 unit of measure is how the result should be provided m for miles k for kilometers n for nautical miles Returns Distance in the requested units of measure Example DistanceByZip5 16509 MIB 0 9 m returns 4 76 miles Note this function requires that the CUT Light ini file is installed to t
62. xt False False 2002 2015 Ido Millet ido MilletSoftware com Page 16 FileAddTextKey Arguments FileName TextToAdd DeleteFileBeforeAdd CarriageReturnAfterAdd Key2AvoidDuplication Returns TRUE if successful otherwise FALSE Same as FileAddText above but requires a unique String value in Key2A voidDuplication argument If that value was already used in a prior call within the same report preview the process is skipped The idea is to avoid duplication in cases where report pagination causes the formula evaluation to be duplicated Note FileAddTextKey is just a convenient alternative to using NewKey test before calling FileAddText FileGetText Arguments FileName Segment_N Note the file name should include the full path to the file Returns Breaking the file content into segments of 254 characters each the function returns the segment number specified by the Segment_N argument If the specified file path amp name doesn t exist an empty string is returned In Crystal you can load the entire file content into a string variable using the following code StringVar sFile NumberVar 1 1 1 Keep appending segments of 254 characters to sFile string until we reach the end of the file while FileGetText c temp test ini 1 lt gt Do sFile sFile FileGetText c temp test ini 1 i i 1 Return resulting string sFile Note if the file contains HTML o
Download Pdf Manuals
Related Search
Related Contents
Betriebsanleitung Page 1 Page 2 Features Select Button WF` ONIOFF ShUtter User Manual Ficha de seguridad Casio EX-H30 Owner's Manual Copyright © All rights reserved.
Failed to retrieve file