CapeSoft.Com
Clarion Accessories
SendTo
Documentation
CapeSoft Logo

CapeSoft SendTo
Documentation

Download Latest Version JumpStart FAQ History
Installed Version Latest Version Gold


SendTo 2 comes with optional "plug in" functionality dependent on the added tools. See the recommended Products below.

Introduction

Wouldn't it be nice to be able to export a list/browse straight to Printer, a file (like Excel or Word) or Email it? We as Clarion Programmers are renowned for spending piles of time getting our browses just right - and then quickly adding a few reports as an after-thought. And so instead of doing the work once, we're effectively doing it many times.

Enter SendTo. SendTo will enable you to send your data exactly as it appears in the browse to Printer, or File (HTML, Excel, Word, CSV or PDF) or email it directly. Simply drop on the SendTo button on any browse/list in your application, and you have all these options available without having to design extra reports or export procedures - it literally takes a few seconds to add this amount of functionality to a browse.

No more designing reports to match the printout the user requires - simply display the data. What you see is what you will get in the SendTo output. So you can do what you do best - display the correct data and let SendTo do the hard work of getting it out of the List/Browse.

Note: Available Output formats are dependent on the extensions that you have added to your application.

Features

* Clarion Enterprise Edition applications only or additional 3rdparty Tools required.
** XML export requires xFiles - a CapeSoft 3rdparty accessory.
*** Excel requires either OfficeInside or xFiles to offer this export functionality.
*** Word requires OfficeInside to offer this export functionality.
****At this stage the STYLE attribute is only supported. COLORs will not be displayed in the output.
*****Icon support requires Draw. At this stage only certain icon formats are supported see FAQ 4.3

Webinar

A webinar on SendTo was presented on ClarionLive on 31 July 2015. Webinar #324.

Adding SendTo to your Application

JumpStart

Before adding SendTo to your application, you need to import the SendToTempFile into your dictionary:
  1. Open your dictionary in the Dictionary Editor.
  2. Import the Send2Tmp.dctx text file into your dictionary (if the button is not visible, it means your DCT Explorer pane is too small):

    This file is found in the Clarion\accessory\Libsrc\win folder.
OK, now we're ready to add SendTo to your application. If this is a Multi-DLL application, then you need to do this in the Data DLL:
  1. Insert the Global Extensions that you will require:
    • Click the Global button and click the Extensions button on the Global Properties window.
    • (Do this step before adding the Send-To global Extension)
      You can add the following Global Extension Templates (Send-To will make use of them if they are there);
      • Activate NetTalk
      • Activate StringTheory
      • Activate Office Inside
      • Enable WinEvent
      • Activate Draw
      • Activate Hyperactive
      • Activate xFiles
      Note: If you are adding these extensions at a later stage, check the FAQs on what else to change.
    • Add the ActivateSendTo Global extension template to the list.
      If this is the Data DLL then go to the Multi-DLL tab and tick on both options.
    • Click on the Import SentTo Procedures button to import the SendTo Procedures.
    • Click OK a couple of times to return to the Application tree window.
  2. If you require PDF file output, then you can either use Soft Velocity's Clarion6 ABC Report to PDF, Klarisoft's wPDFControls or PDFXChange (PDF-Tools). Perform the steps (dependent on the product) to adding the Report to PDF to your application.

  3. For XML output support, check out FAQ 7.1

For Multi-DLL Applications

Now that you've added the SendTo functionality to the Data-Dll, you can use the functionality in all your applications that use this Data DLL.
  1. Add the SendTo Global Extension template to your other app (e.g. your mainEXE application).
    • On the SendTo Global Extension, go to the multi-DLL tab and turn on the first option (This is part of a multi-dll program) ON, but turn the second option (Export SendTo classes from this DLL) OFF.
    • In the SendTo Global Extension template, check the SendTo Window is in another app checkbox.
    • Enter the name of the SendTo Procedure (that is in your Data DLL) in the entry field provided.
    • If you check the Don't automatically map the procedure checkbox, then you'll need to manually map the procedure in your Global map, otherwise SendTo will do this automatically for you. If this is a Multi-Proj application, then you'll need to check this because Multi-Proj will do the mapping for you.

      If you want icon support, you must also add the WinEvent Global Extension to this application (if it is not already present)
  2. If you have not done so already, then you need to add the Data-DLL as an external module to this application.
    • In your Application tree, select the Insert Module... item from the Application menu.
    • Select ExternalDLL from the list that appears.
    • Enter the name of the lib that is generated by your Data-DLL application.

Adding a SendTo Button to your Browse/List

  1. Open the Window Formatter for the Browse procedure that you require the SendTo button on.
  2. Select the Control Template... option from the Populate menu, and the select the BrowseSendTo or ListSendTo control template from the list that appears. Place the button on the window in an appropriate place.

Translation

There are two places you need to make alterations in order to cater for translations:
  1. Open the SendTo_Window window formatter and translate all the prompt texts.
  2. Go to the SendTo Controls on the SendToWindow control template prompts on the SendTo_Window, tab across to the Translation tab, and fill in the respective text there:

Using SendTo with SV-PDF

(from SoftVelocity, included in Enterprise Edition).

Using SendTo with PDF-Tools

(from Tracker Software Products) (written for version 4.1 or later).

Using Send-To in Legacy Applications, with large browses

Send-To works by loading your browse as "File Loaded" instead of "Page Loaded" - then sends that completely loaded browse (actually a completely loaded Queue) to the requested destination. In ABC apps this works flawlessly, and in Legacy apps it works for browses with around 2000 rows or less. However there is a limitation present in the Legacy template set which limits the size of the queue.

Unfortunately there are no embed points near the code which applies this limit, so the only way to avoid this limitation is to make a small adjustment to the Legacy template set. The adjustment itself is harmless, and won't affect any browse behavior. However it will need to be re-applied if you update your Legacy template set.
The change will not cause a problem in an application which does not have Send-To installed. It is a completely safe change from that point of view.

The file to edit is in your
\clarion\template\win
folder.

It is called CTLBROW.TPW

search for a line

DELETE(%ListQueue)

6 lines _above_ this line is a line;

IF %InstancePrefix:RecordCount = %ListControl{PROP:Items}

make this line longer, by adding the following;

And SendingTo# = 0

to create this line;

IF %InstancePrefix:RecordCount = %ListControl{PROP:Items} And SendingTo# = 0

To be clear, you only need to make one change to the CTLBROW.TPW file, and it is to extend a single line to become the line above.

Aside: The root of the problem is that Prop:Items is limited to a very narrow range of numbers. It cannot be set to a negative number (which would neatly solve the problem) and if it is set to any value higher than 2044 it sets itself to 2044. By adding the additional test to the IF statement, the possibility of deleting records from the queue is removed.

Customizing the Report

When you do a SendTo a Printer, the SendTo_Printer report procedure is called. This procedure is a bare-bones Clarion report into which the headers, and data will be populated.

This procedure is in your app, as a procedure in the tree, so you can customize the report a lot to suit the needs of your program. Here are some tips for doing that;
  1. You can change the size of the Header, Footer and Report sections. So if you need to make the Header or Footer part bigger then you can do so. 
  2. You could add images (logos) to the header, or perhaps the standard Clarion Date & Time control templates.
  3. In the header is a box control called ?Box1. This box will determine where the Header fields will go. Do not delete this control, but feel rfee to change the fill and border colors if you like.
  4. You can make the header bigger as needed, and place additional fields on there if you like.
  5. The report itself might be used in Portrait mode (which is what you are seeing in the designer) or in Landscape mode. If you are in Landscape mode then make use of the Controls tab (on the SendTo Extension) to tell SendTo which controls should be moved completely to the right, which controls should be made bigger, or which ones are aligned to the centre of the report.

The SendToTemplates

The Global Extension Template

General Tab

Disable All SendTo Features
This disables the SendTo template, and no template code will be generated into the application. This is useful for debugging.
Import SendTo Procedures
Imports the SendTo procedures into your application

Options Tab

SendTo Procedure
Default value is SendTo_Window. If you have named the procedure something else then put the name in here.
SendTo Window is in another app
Tick this option on if the SendTo_Window procedure is in another DLL in your system.
Don't automatically map the procedure
Tick this on if you have an alternate system (like Multi-Proj) which generates the MAP prototypes for you.
Force Multi-Lined rows into one row
You can specify if you would like to force multi-lined rows (i.e. where LastOnLine is used in groups) into one row for some or all file outputs. This often makes for more logical sense, especially in CSV file outputs. Otherwise, the data will be exported as it appears (on separate rows) in the list/browse box.
Suppress Prop:Buffer Use
SendTo turns on prop:buffer for the Browse boxes where the SendTo button is added. This makes the collating of data more efficient. You can check this option if you don't want to use the prop:buffer feature.
Don't add SendTo to the Right-Click popup menu
If this is off then the SendTo button will automatically be added to the right-lick list of options on the browse.
Default Maximum
This allows you to set the Maximum number of allowed columns. Use this if you want to create a maximum which is LOWER than the default maximum (which is set in SendTo.Inc as an equate called MAXCOLS.)
Don't include prnprop.clw
By default a statement to include prnprop.clw is added to the app. Tick this on if you need to suppress this include.

Browse SendTo Control Template

Basic Tab

Disable SendTo here
If this option is on then the SendTo code will ot be generated for this button. The button itself will still be visible though.

Options Tab

Heading
By default the heading text used for the data output will be the text on the titlebar of the window. You can change this in the Heading entry field in the template. Use quotes for constants or variable names. For example you could add the currently active tab's text to the TitleBar's text.
Force Suppress Greenbar On
If your list has it's own greenbar, and you don't want SendTo to apply its greenbar, then check this option.
Limit Records Output To
You can force or warn a user on a record limit - if the user has selected to SendTo, but is unaware of the magnitude of the output that will be generated.
Give the User the Option to Limit Records
You can force or warn a user on a record limit - if the user has selected to SendTo, but is unaware of the magnitude of the output that will be generated.
ABC: SendTo Popup menu
(For ABC) You can set the position of the SendTo popup menu - to one of first (i.e. at the top of the menu), Before Update items, After Update Items or Last.
Alternate Queue
By default the queue associated with the browse control will be "Sent To" whatever output the user chooses. However it is possible to specify an alternate queue to send here.
Another COM object on this window controls Excel/Word
Tick this on if there is another Office Inside control on the window.

Prime Tab

These settings allow you to prime the settings on the SendTo window.
Destination
Select the destination from the drop list.
File Type
Select the file Type from the drop list
Email
Enter an email address here. This setting can contain an expression so use quotes around fixed values.
Filename
Enter the filename (and path) here.

Column Customization Tab

For each column you can set the following settings;
Suppress Column
If this is on then the column will not appear in the output, even if it is visible to the user in the browse. You can also make the column conditionally appear by entering an expression here.
Change Header To
By default the browse column header, as visible in the browse is used. Use this option to override it to another value.
Force Column to String
CSV and Excel files differentiate between numeric values and string values. By default it will auto-detect the value and pick the best one. However if you wish to force a column to be a string value then tick this option on.
Force Column to Numeric
CSV and Excel files differentiate between numeric values and string values. By default it will auto-detect the value and pick the best one. However if you wish to force a column to be a string value then tick this option on.

The ListSendTo Control Template

Basic Tab

Disable SendTo here
If this option is on then the SendTo code will ot be generated for this button. The button itself will still be visible though.

Options Tab

Heading
By default the heading text used for the data output will be the text on the titlebar of the window. You can change this in the Heading entry field in the template. Use quotes for constants or variable names. For example you could add the currently active tab's text to the TitleBar's text.
List Control
Enter the list control that this SendTo button applies to.
Queue
Enter the Queue here that the list control is displaying
Force Suppress Greenbar
If your list has it's own greenbar, and you don't want SendTo to apply its greenbar, then check this option.
Another COM object on this window controls Excel/Word
Tick this on if there is another Office Inside control on the window.

Columns Tab

The SendToWindowControls Control Template

This control template is used on the SendTo_Window procedure. It controls the behaviour of the SendTo window in the program, for all the browses and lists that use it.

General Tab

Disable SendTo here
If this option is on then the SendTo code will not be generated for this window. The window itself will still be visible though.
Send To Email Procedure
If you support sending files via Email then enter the SendTo_Email procedure name here.
Send To Printer Procedure
If you wish to allow the browse to be sent to the printer then enter the report procedure here. The default is SendTo_Printer.
Send To File Procedure
If you wish to support any of the Sendto File possibilitties then enter the SendTo_File procedure here.
Send To FTP Procedure
If you support sending files via FTP then enter the SendTo_FTP procedure name here.

Output Setup Tab

Outputs to Support
Tick on the various outputs that the SendTo window should support.
File Formats to use
Tick on the various file formats that you wish to support.
Add extension to the Filename
If the user does not specify an extension to the file name, then add an appropriate one based on the file settings above.
Allow Email/FTP configuration
If this is on then the user will be able to use the SendTo_Email window to configure the email server settings, which are then stored in the SendToTemp file. If you already have email server settings in your program then you can leave this option off.
Don't Remove Tempfile after Emailing
If this is on then the file created will remain after it has been sent via Email or FTP. If this is off then these files will be considered temporary and will be deleted after the file is sent.
Use a Style File
If you are outputting to HTML then you can use your own CSS style file to determine the "look" of the HTML page.  If you turn this option on then enter the name of your style file here as well.

Location Tab

This tab controls the default location of the file that the user may be creating. the user can choose an alternate location if they wish.
Default Output File Location
The default location of the file being created.
Output Filename
The default name of the file being created.
Only use Filename when Header is Blank
If this is off then the header will be used to create the file name.

Save Settings Tab

This tab is used to "remember" the various settings on the window so that when the user returns to the window the previous values are primed into the fields. This speeds up the task when several browses are being Sent somewhere in a single session.
Storage Method
Choose whether to store the settings or not.
INI Filename
If you select INIFile in the above setting, then you can enter the name of the INI file here.

Translation Tab

If you want the text used on the window to be translated using a runtime translator (or altered to some fixed value) then enter the various translations on this tab.

Class Tab

This tab allows you to generate

The SendToPrinterReport Extension Template

General Tab

Disable Send To here
If this option is on then the SendTo code will not be generated for this report.

Options Tab

Initial Previewer Display Options
This section contains some options that can be sent to the report previewer.
Left Column Indentation
The report controls will be indented from the left margin by this amount.
Paper Used If None Set
For example Paper:Letter
Color Forcing
White text is often visible on a window where it would not be visible on paper. This option allows you to specify a color to use if the text color in the browse is white.
It also allows you to set a threshold of brightness (ie the nearness of a color to white) when this alternate color will be used.

The SendToWindowControls Control Template

This template is added to the SendTo_File procedure. There are no prompts for you enter in this template. This template generates the necessary code in a process to export the data to a file.

The SendTo Objects

SendToBase
SendToPrinter
SendToCSV
SendToHTML
SendToExcel
SendToWord
SendToFile

SendToBase() class

The SendTo base class forms the foundation of all the SendTo classes. It handles all the nitty-gritty of extracting data, fontsetting, etc. generic to all the other classes.

Properties

Property Name Type Description/Use
q &Queue A pointer to the Queue containing the data for the Report/File.
control long The ID of the List control containing the Queue.
Header string(255) The text to use for the header of the Report/File.
TotalWidth long The total width factor of the Listbox - to ensure all the columns fit into the Report/File.
LinesPerDetail long Lines required for each record entry for the Report/File
RecIndex long A counter containing the Index number of the record currently 'Got'
ProgressValue long The Progress Percent of the records processed.
Preview byte Set to Preview the Report/File.
PreviewProgram string(255) A name for the program to run to preview the data. If left blank, then use ShellExecute.
FileName string(255) The name of the File containing the exported data.
GreenBar byte If set to 2, then Greenbar is disabled, otherwise, it is used to switch between showing and hiding the background for the Greenbar effect.
Opened byte Indicates whether a file has been opened successfully.
fontName string(40) Contains the Fontname of the ListBox to use as the default (if the cell has no font)
fontSize long Contains the Fontsize of the ListBox to use as the default (if the cell has no font)
fontStyle long Contains the Fontstyle of the ListBox to use as the default (if the cell has no font)
fontColorFG long Contains the TextColor of the ListBox to use as the default (if the cell has no TextColor)
fontColorBG long Contains the BackColor of the ListBox to use as the default (if the cell has no BackTextColor)
fontCharset long Contains the Characterset of the ListBox to use as the default (if the cell has no CharacterSet)
Styles Group,pre(Styles),Dim(255) An array to store the ListBoxes style array during the Report/File formatting.
FontName string(40) Name of the Font for this stylegroup
FontSize long Size of the Font for this stylegroup
FontStyle long Style of the Font for this stylegroup
CharSet long CharacterSet of the Font for this stylegroup
ColorFG long Text color for this stylegroup
ColorBG long Background color for this stylegroup
Picture string(32) Picture used for this stylegroup
Exists byte(0) Set if this propstyle array row is used.

End
Icons Group,Dim(255) An array to store the Icon file names, and whether they exist or not.
IconName string(255) Name of the Font for this stylegroup
Exists byte(0) Set if this propstyle array row is used.

End
File string(255) Used to store the name of the file created (also contains the error code if the file was not created).
clm Group,dim(MAXCOLS1),pre(clm) An array containing formatting for each column.
Exists byte Set if this element of the queue is present in the List box.
width long Contains the width of the column
RightBorder byte Set if there is a border on the right of the column
LastOnLine byte Wraps the next field to the start of the next line
RunningWidth long Used to ensure the width of the column is not too small (for the data)
Header string(255) Contains the text for the heading of the column
HeaderAlign string(6) Contains 'left', 'center' or 'right' dependent on which alignment the header is.
HeaderLeft byte Set if the Header is left justified
HeaderRight byte Set if the Header is right justified
HeaderCenter byte Set if the Header is center justified
HeaderDecimal byte Set if the Header is decimal left justified
HeaderOffset long Offset of the Header text
HeaderControl long Used for the control of the header text in a report
Align string(6) contains 'left', 'center' or 'right' dependent on which alignment the column is
Underline byte True if the column text is underlined
Picture string(40) The picture of the column text
GroupNo long The number of the group that this field is part of.
FieldNo long Contains the field number of the queue that is the first in the list. If blank, than the field number is assumed to be incremented from the previous columns field.
Left byte Set if the column text is left justified.
Right byte Set if the column text is right justified.
Center byte Set if the column text is center justified.
Decimal byte Set if the column text is decimal justified.
Offset long Contains the offset of the text.
Color long Set if there are color settings for this column.
TextColor long Contains the color of the text.
BackColor long Contains the color of the background
Icon byte Set if there is an icon attribute for this column
IconTrn byte Set if the icon is transparent
CellStyle byte Set if the cell can be individually formatted with a style.
ColStyle byte Contains the default style for the column (if used).
DetailControl long The ID of the control containing the text for the cell.
IconControl ulong The ID of the IconControl to contain the icon for the cell.
DetailText string(255) The formatted text to be placed in the cell to be exported.
RunningColumn long The physical column that this column occurs in (numbered from left to right)
RunningRow long The physical row that this column occurs in (numbered from top to bottom)

End
grp group,dim(MaxCols),pre(grp) This Group contains the settings for Group headers.
Header string(255) Contains the heading text (for the group)
HeaderAlign String(6) Alignment
HeaderLeft byte Left justified (if set)
HeaderRight byte Right justified (if set)
HeaderCenter byte Center justified (if set)
HeaderDecimal byte Decimal justified (if set)
HeaderOffset long Offset for justification
HeaderControl long Control to contain the group header string
Columns long The number of columns in this group.
Exists byte whether the group exists (as a group) or not
Width long The total width of the group.
Rows long The rows that exist in this group (i.e. the amount of cells with the LastOnLine attribute in them).

End
ProgressText string(100) Contains the text for the Progress string on the Progress Window.
StyleFile string(255) The name of the style file (for HTML files)
NoOfColumns long The number of columns wide that the output will contain.
LastColumn long The number of the last column
RunningColumns long The number of physical columns that will be used in the output
RunningRows long The number of physical rows that will be used in the output.
HeaderRows long The number of physical rows that will be used in the output header
WriteToClipboard byte Set in order to write to clipboard (rather than file).
PreserveDateData long Set in order to present date date in true-date format (in Excel exports).
NoColumnHeadings long Set in order to prevent column headings from being generated (into Word, CSV and Xcel)

Methods

MethodName Parameters Description
DisplayProgress (*Byte ProgressValue,
Long ProgressControl'
long ProgressText=0)
Set and Display the value for the progress control on the progress window.
Parameters:
ProgressValue - a handle to the Progress thermometer
ProgressControl - the ID of the progressbar
ProgressText - the ID of the ProgressText string.
Init (Queue pQueue,
Long pListControl,
<SendToOptionsGroup pOptionsGroup>)
Initialize the object - set queue pointer, and gets the list properties and styles.
Parameters:
pQueue - the queue that contains the data
pListControl - the ID of the control containing the data
pOptionsGroup - a group containing the SendTo options
Next (),Long Populates the queue buffer with the next record in the queue. Returns a 0 if record is OK, otherwise the next failed.
LoadIcons () This procedure loads the list controls icon array into aSendTo icon array.
LoadListBoxProperties () Get the all the listbox's format properties.
LoadStyles () Get the list box's style arrays.
Run () Run the program associated with the file created.
ErrorTrap (Long p_Code, String p_Text) Display an error that occurs.
Parameters:
p_Code - the errorcode that occurred.
p_Text - the message text that must be displayed.
_FontColor (long p_Col),Long Returns the FontColor for this specific cell.
Parameters:
p_Col - the column number of the cell
_FontBackGroundColor (long p_Col),Long Returns the BackGroundColor for this specific cell.
Parameters:
p_Col - the column number of the cell
_FontName (long p_Col),String Returns the FontName for this specific cell.
Parameters:
p_Col - the column number of the cell
_FontStyle (long p_Col),Long Returns the FontStyle for this specific cell.
Parameters:
p_Col - the column number of the cell
_FontSize (long p_Col),Long Returns the FontSize for this specific cell.
Parameters:
p_Col - the column number of the cell
_FontCharset (long p_Col),Long Returns the CharacterSet for this specific cell.
Parameters:
p_Col - the column number of the cell
Kill () Dummy method for classes derived from the base class.
Open () Dummy method for classes derived from the base class.
CreateHeader () Dummy method for classes derived from the base class.
WriteColumn (<string pDetails>,
<long pColumn>,
byte pHeader=0,
<string pAlign>,
long pSpan=0)
Writes the Details into the cell/block specified (and sets up styling and alignment as necessary. If Details is blank, a blank detail is written.
Parameters:
pDetails - the content of the string to place in the control
pColumn - the column number 
pHeader - set if this is the header, otherwise cell is in the body.
pAlign - an optional alignment string 
EndHeaderRow () Code to run at the end of a Header row (like adding into the file and incrementing the column)
EndDetailRow () Calls the parent EndHeaderRow - but allows for overwriting if other code is required.
SetDetail () Dummy method for classes derived from the base class.
GetFontStyleName (long pFontType),string Return's the name(i.e. string description) of the FontType.
Parameter:
pFontType - contains the FontType equate
Debug (string pDebugStr) Output debug information for debugging.
Parameters:
pDebugStr - the debug string to output.
_CellStyle (long p_Col),long Returns the style number for the cell of the column.
Parameters:
p_Col - the column number.
_ColorEquate (long pColor),long Returns the closest Clarion color equate (for Word and Excel)
Parameters:
pColor - the color used.
OldNoOfColumns (),long Returns the number of columns that appear in the output (taking into account the LastOnLine columns)
NoOfRows (),long Returns the number of rows that appear in the output (taking into account the LastOnLine columns)
GetProgress (),long Returns the value to display on the progress bar/counter

SendToPrinter(SendToBase)class

The SendToPrinter class is based on the SendToBase class and handles sending the data to a printer in a report format.

Properties

Property Type Description/Use
Report &Report A pointer to the pre-defined report (in the report procedure)
ReportHeader long The control on the report that contains the Header of the report
ReportDetail long The control on the report that contains the detail
ReportFooter long The control for the report footer
ReportTitle long The control for the title of the report
HeaderBox long The box control around the header
DetailBox long The box around the detail of the report
FooterBox long The box around the footer of the report
WidthFactor Real A property used to factor out the size of the paper with the widths of columns in the list box.
LineHeight long A property used to work out the height of the detail line.
LineSpacing long If required - used to create uniform spaces between the lines
CellSpacing long Ensure uniform spaces between cells of data.
TotalPages long A property containing the amount of pages required for a report.
LinesPerPage long Contains the maximum amount of lines used in a page
HeaderYPos long Contains the position of the header of the list in the report.
FirstControl long Contains the x position of the first cell in the report.
DetailYPos long Contains the starting point of the row of detail cells to print
PagesWide long(1) The amount of pages (across) to use. Set to 0 for automatic.
PagesWideCount long Contains the running count of the amount of pages (across) used.
LastControl long Keeps a track of the last control number used (for the creating of the report controls)
FirstColumn long Contains the FirstColumn that was used for the current page (or last page) printed.
FirstRunningColumn long Contains the First physical Column (from left to right) that was used for the current page (or last page) printed.
LastRunningColumn long Contains the Last physical Column (from left to right) that was used for the current page (or last page) printed.
StartWidth long The first column's width in this page (across).
PageWidth long Total width for this page (across)
PageCount &long Contains a pointer to the variable used to track the pagecount on the report.
LinesOnThisPages long Tracks the lines used on the page (vertically).
PaperWidth long Contains the width of the paper to use
PaperHeight long Contains the height of the paper to use
TotalLinesPrinted long Contains a running tally of the detail bands printed

Methods

Method name Parameters Description
CreateHeader (byte pFirstTime=0) It creates the columns with their respective headers.
CreateDetail ( ) This method creates each detail band and the controls in the detail band.
SetDetail ( ) Sets the properties for the cells of the detail band.
Init (Queue p_Queue,
Long p_ListControl)
Initializes the object.
Greenbar ( ) Sets the greendbar effect on the report.
Next (),long When all the records are retrieved, redo from start if the PagesWide > 1.
ArrangePages (*Queue pQueue) Once all the pages are printed, arrange into the correct order.
GetProgress (),long Returns the correct progress value (when multiple pages wide is used)
Kill () Used to dispose the Draw object.
SetPageWidth (long pPaper) This method sets the PaperWidth and PaperHeight properties for the paper used in the report. pPaper is an equate containing the Clarion paper ID.
EndPage ( ) This method checks whether an EndPage is required and enforces one if the LinesOnThisPage = LinesperPage. Calculation using the height of the detail bands and the Report height does not match the printed output.
OpenReport (long pPaper=0 ) This method creates the report outline and sets the various report properties.

SendToCSV (SendToBase) class

The SendToCSV class is based on the SendToBase class and handles the exporting of data to a CSV file.

Properties

Property Type Description/Use
detail string(65535) The complete datastring of all the columns to be added to the file.
clipboardstring any Contains a string that will be sent to the clipboard.
clipboardstringlen long Contains the length of the string that will be sent to the clipboard.
delimiter string(',') Contains the delimiter that will be used in a CSV export.

Methods

Method name Parameters Description
Kill ( ) Close the file and kill the object
CreateHeader ( ) Creates the header of the file (column headers to match the columns)
WriteColumn (<string pDetails>,
<long pColumn>,
byte pHeader=0,
<string pAlign>,
long pSpan=0)
Writes the Details into the block specified. If Details is blank, a blank detail is written.
Parameters:
pDetails - the content of the string to place in the control
pColumn - the column number
pHeader - set if this is the header, otherwise cell is in the body.
pAlign - an optional alignment string
EndHeaderRow () Writes the record to the file and clears the detail string.
Open ( ) Opens the file to store the export.
SetDetail ( ) Creates the text to be entered into the file.
Init (Queue pQueue,
Long pListControl,
<SendToOptionsGroup pOptionsGroup>)
Calls the parent Init method and sets the name of the PreviewProgram to run.
WriteToFile (*string pStringToWrite,
ulong pBytesToWrite) 
A method that writes the string passed to the file (or the clipboard if the output is the clipboard).

SendToHTML (SendToCSV) class

The SendToHTML class is based on the SendToCSV class and handles the exporting of data to a HTML file.

Properties

Property Type Description/Use
meta string(1024) A property which allows you to write stuff into the meta tag section at the beginning of the HTML doc.

Methods

Method name Parameters Description
CreateFooter ( ) Ends off the doc.
CreateHeader ( ) Creates the doc, sets the styles and creates the columns' heading text and the title text. 
WriteColumn (<string pDetails>,
<long pColumn>,
byte pHeader=0,
<string pAlign>,
long pSpan=0)
Writes the Details into the cell specified (and sets up styling and alignment as necessary). If Details is blank, a blank detail is written.
Parameters:
pDetails - the content of the string to place in the control
pColumn - the column number 
pHeader - set if this is the header, otherwise cell is in the body.
pAlign - an optional alignment string 
EndHeaderRow () Code to run at the end of a Header row (like adding into the file and incrementing the column)
EndDetailRow () Code to run at the end of a Detail row (like adding into the file and incrementing the column)
Init (Queue pQueue,
Long pListControl,
<SendToOptionsGroup pOptionsGroup>)
Calls the parent.init method and suppresses the Greenbar property (if not required).
SetDetail ( ) Sets the greenbar effect and the styles of the cell text.
_Color (long p_Color) This method returns the hex RGB value of a Clarion RGB color long format.
Parameters:
p_Color - a long containing the RGB Clarion color.
_DecToHex (Byte p_Decimal) Converts a byte to a Hex string.
Parameters:
p_Decimal - a byte containing the number to convert to hex.
Kill ( ) Creates the footer and then kills the object.
_ReadCSSFile (byte pAddInFont=1),string This method returns the contents of the Style file, optionally modified to contain the FontName of the browse.
Parameters:
pAddInFont - If set, adds the Font name in, where required.

SendToExcel (SendTOBase) class

The SendToExcel class is based on the SendToExcel class and handles the exporting of data to an Excel spreadsheet.

Properties

Property Type Description/Use
Excel &oiExcel A pointer to the OfficeInside Excel object.
StartColumn string(2) The column to start the first cell to export
StartRow long The Row to start the first cell to export
RowNumber long Used for storing the row where the object is writing to.
ColumnNumber string(2) Used for storing the column where the object is writing to.
ColumnNumberB byte,dim(2),over(ColumnNumber) Used for incrementing the column where the object is writing to.
TemplateFile string(255) Contains the name of the template file to use.
WidthFactor Real A property used to factor out the size of the spreadhsheet with the widths of columns in the list box.
NumColors long Number of colors used in the custom excel palette
ColorPalette long, dim(40) Colors in the excel palette, allows existing colors to the fetched
CurColor long The current color in the excel palette
PalettePos long The position of the current color in the palette

Methods

Method name Parameters Description
Open ( ) Opens the excel spreadsheet.
Close ( ) Closes the spreadsheet.
CreateHeader ( ) Creates the header of the spreadsheet
WriteColumn (<string pDetails>,
<long pColumn>,
byte pHeader=0,
<string pAlign>,
long pSpan=0)
Writes the Details into the cell specified (and sets up styling and alignment as necessary).
Parameters:
pDetails - the content of the string to place in the control
pColumn - the column number 
pHeader - set if this is the header, otherwise cell is in the body.
pAlign - an optional alignment string 
EndHeaderRow () Code to run at the end of a Header row (like adding into the file and incrementing the column)
Init (Queue pQueue,
Long pListControl,
<SendToOptionsGroup pOptionsGroup>)
Calls the parent.init and sets up some of the initial settings.
SetDetail ( ) Formats the cells and writes the data to the cells.
_IncrementColumn ( ) An internal method used to increment the column letter.
Kill ( ) Closes the doc and kills the excel object.
_CheckForFormula (string pDataString),long Returns True if the string contains formula characters
Parameters:
pDataString - The string to pass to Excel.
_ColumnName (string pColumn), string
_HasFormulaChars (string pCheckString,
long startPos=1),long

GetPaletteColor (long pColor), long Returns zero if the color is not in the palette, or the position if it is
AddPaletteColor (long pColor)

SendToWord (SendToBase) class

The SendToWord class is based on the SendToBase class and handles the exporting of data to a Word document.

Properties

Property Type Description/Use
Word &oiWord A handle to the Office Inside Word object required.
RowNumber long Used for storing the row where the object is writing to. 
ColumnNumber long Used for storing the column where the object is writing to.
TemplateFile string(255) Contains the name of the template file to use.
TableNumber long The number of the table created.

Methods

Method name Parameters Description
Open ( ) Creates the word document
Close ( ) Saves and closes the word document
CreateHeader ( ) Creates the header of the document and the table for the text.
Init (Queue pQueue,
Long pListCo
ntrol,
<SendToOptionsGroup pOptionsGroup>)
Inits the object and the Office Inside word object.
SetDetail ( ) Write the necessary to text to the cell and format the style of the cell.
WriteColumn (<string pDetails>,
<long pColumn>,
byte pHeader=0,
<string pAlign>,
long pSpan=0)
Writes the Details into the cell/block specified (and sets up styling and alignment as necessary. If Details is blank, a blank detail is written.
Parameters:
pDetails - the content of the string to place in the control
pColumn - the column number
pHeader - set if this is the header, otherwise cell is in the body.
pAlign - an optional alignment string
EndHeaderRow () Code to run at the end of a Header row (like adding into the file and incrementing the column)
Kill ( ) Close the document and kill the objects.

SendToFile() class

The SendToFile class controls the exporting of the data to a file. It is a generic class that has a handle that points to the class specific to the file type that is required in the output.

Properties

Property Type Description/Use
SendToFile &SendToBase The handle of the object to use to create the file.

Methods

Method name Parameters Description
Init (SendToBase pSendToClass,
queue pQueue,
long pListControl,
string pFilename,
byte pPreview=0,
SendToOptionsGroup pOptionsGroup),
long
Inits the SendToObject, sets up the required options and opens the document, as well as creating the header. Returns 0 if successful.
Parameters:
pSendToBase - a handle to the SendTo object.
pQueue - the queue containing the data for the output.
pListcontrol - the list control displaying the pQueue.
pFileName - the file to export the data to.
pPreview - set if the file must be previewed.
pOptionsGroup - a group containing the various options (class type dependent).
Next (*long pRecordsProcessed,
*byte pThermometer,
long pThermometerCtrl,
long pProgressText=0),long
Calls the SendTo object's next method and handles the update of the Progress bar.
Parameters:
pRecordsProcessed - a handle to the variable containing the records processed.
pThermometer - a percentile incrementor for the Progress bar.
pThermometerCtrl - the ID of the progress bar.
pProgressText - the ID of the progress text string on the Progress window.
Kill ( ) Kills the SendTo class and runs the file preview (if required)

Updating SendTo to use xCell to output to Excel / OpenOffice

Version 2.21 of SendTo (and later) can make use of the xCell class in xFiles (version 2.64 or later) to create xml files from the list.

These xml files are in an open spreadsheet standard and can be read by most popular spreadsheet programs including Microsoft Excel and Open Office from the Apache Foundation.

In addition to better compatibility this approach is quite a bit faster, than using Office Inside, as an interim XML file rather than an absolute XLS file is created. It also removes the requirement to have Office (or OpenOffice) installed on the machine generating the file. 

Of course this is in addition to the XLS option - you can choose to leave both options in your program or choose just one of the options for your users.

Adding the support for xCell to your application can be done using the following steps;
  1. Add the xFiles global extension to the application.
  2. On the SendTo_window procedure add a radio option to the LocST:FileFormat variable.
    Text: Excel (xml) ! or whatever text you prefer
    Value: 8
    Use: ?XCellFormat

Examples

The following examples are shipped with SendTo:
Demo\abcdemo.app This demonstrates the use of SendTo in a simple single-EXE stand-alone ABC application. It shows the use of all the SendTo templates. (Clarion6 demonstrates the use of PDF generation)
multi DLL\root.app and mainexe.app This demonstrates the use of SendTo in a multi-DLL application (ABC) where the SendTo procedures reside in the DataDLL (root.app), while the procedures from which SendTo is used resides in the mainexe.
SendTo with wPDFControls\ abcdemo.app These two applications (one for legacy and one for ABC) demonstrate the use of SendTo using wPDFControls for PDF file export.
SendTo with PDFTools\
abcdemo.app
This ABC application demonstrates the use of SendTo using PDFXChange to generate PDF files.
SendTo with xFiles\
abcdemo.app
This ABC application demonstrates the use of SendTo with XML output.
SendTo with FTP\
abcdemo.app
This ABC application demonstrates the use of SendTo with export to FTP (requires NetTalk).

FAQs

I'm getting compile errors. What am I doing wrong?

What must you do to include SendToFTP and SendToEmail and other additional functionality to my application?

1. Procedure importing and Template Issues:
1.1. I ran the ImportSendToWindows utility and no procedures were imported.
1.2. My SendTo window is in another app, but I have a SendTo_Window ToDo procedure.
1.3. The template utility fails to create the SendTo_Window and/or other SendTo procedures
1.4. I have 2 (or more) browses on my window, I cannot select which browse to associate the SendTo control with - it always gets associated with the one browse.
1.5. The imported procedure 'SendTo_Window' has predetermined controls that are displayed based on the output. How can I permanently hide some of them?
1.6. I want to send straight to the printer (or another format) without displaying the SendTo window. How do I do that?

2. General Formatting Issues:
2.1. SendTo is not formatting the output of my browse correctly.

2.2. Why do my style settings in my list not get depicted in the output properly?
2.3. My pages are appearing in strange orders and the rows aren't all appearing on the printed output.
2.4. Only the first 100 columns of my browse is being output. How do I change this limitation?
2.5. How do I suppress the column header row?
2.6. My text font color is white in the output - so it is not visible. How can this be rectified?
2.7. How do I get my date values into true Excel dates when exporting to Excel?
2.8. Is there a way to include a total on a column?
2.9. I want to export my data to Excel without the ' preceding the data - i.e. I want Excel to format the data for me.
2.10. I want to hide certain columns based on certain conditions from the SendTo output
2.11. I want to filter out certain records, add a total column, change some data before the SendTo output

3. PDF and Excel Issues:
3.1. I'm using a Report to PDF template, but my reports are being printed, not PDFed.
3.2. How do I add PDF support to SendTo in my application?
3.3. How do I use HyperActive to view my PDF files?
3.4. I upgraded SendTo and Office Inside, but now my SendTo excel is not working.

4. Report (Printing) Issues:
4.1. My PageNumbers are not correct in my reports.
4.2. I want to be able to select the paper size for my printer. It's fixed to A4.
4.3. Not all my icons in my browse are being shown in the printout. How come?
4.4. I want to use a 3rdParty previewer. How do I do this?
4.5. How do I change the Report Header font - or spacing between the lines?
4.6. I have a Right justified header/column that is being printed as left justified.
4.7. How do I change the font of the text in the report? Change the default font of the report in the report procedure

5. Legacy Template Issues:
5.1. Not all my records are appearing in the SendTo output.
5.2. When I return from my SendTo output, the record I selected is different from when I called the SendTo routine.

6. Email Issues:
6.1. My SMTP server requires a Authorized user and password. How do I do this in SendTo?
6.2. When using SendTo, how can I change the default email Text from 'Please find the attached file.'?
6.3. I need to send email using SSL. How do I do this?

7. Other export formats (FTP, XML, etc)
7.1. How do I export to XML using xFiles?
7.2. How can I enable my user to select a Tab delimiter character for the CSV file at runtime?

8. Miscellaneous Questions
8.1. Do I really need to purchase all those other products in order to get SendTo to work?
8.2. Not all my data is being output to the SendTo output.
8.3. How do I use a different text editor (other than notepad) to view the CSV file output?
8.4. How can I get SendTo to work with a Dynamic Queue?
8.5. My app GPFs when I SendTo from one of my procedures. It has a COM/OLE object attached.
8.6. Can I use a IMDD (memory table) for the SendtoTemp table? Yes
8.7. I would like to add a total at the end of the SendTo output. How do I do this?

If your question is not answered in the docs, contact support

What must you do to include SendToFTP and SendToEmail and other additional functionality to my application?

Answer:

For SendToFTP and SendToEmail: Once you have installed NetTalk and added the NetTalk global template to your application, you need to re-import the SendTo windows. The template utility will import the procedures based on the existence of the NetTalk template.

For Icon support: Simply add the Draw template to the global extension templates.

For external Icon support and embeded Email HTML, add the WinEvent global extension to your application. You'll need to do this to each application with a SendTo button on at least one of the procedures.

1.1. I ran the ImportSendToWindows utility and no procedures were imported.

Answer:

Are you sure you completed all the steps to add SendTo to your application? (Check the Adding SendTo to your Application for more details).

You've probably missed one of the following:
  1. The SendToTemp file has not been imported to your dictionary.
  2. The Global Extensions of all the products have not been added before running the import utility.
  3. The incorrect template utility is being used (you must use the ImportSendToWindowsABC must be used for ABC applications, not legacy applications and visa-versa)

1.2. My SendTo window is in another app, but I have a SendTo_Window ToDo procedure.

Answer: You need to:
  1. Go into your SendTo global extension template (on the same app) and uncheck the SendTo Window is in another app.
  2. Delete the entry in the SendTo Procedure so that it is blank.
  3. Check the SendTo Window is another app checkbox.
  4. Type in the name of your SendTo_Window (that is in the other application) into the SendTo Procedure entry field.

1.3.The template utility fails to create the SendTo_Window and/or other SendTo procedures.

Answer: Make sure you:
  1. Add the SendTo file to your dictionary.
  2. Add the recommended 3rdparty templates (NetTalk, Draw, WinEvent and/or OfficeInside)
  3. Select the correct utility for the template type (ABC or legacy)
  4. If all the above are correct and the SendTo procedures are still not being added to your application, then manually import the txa file from the clarionx\3rdparty\libsrc directory (either SendToWindowsabc.txa or SendToWindowsLegacy.txa depending on whether your application is legacy or ABC).
For more details see the Adding SendTo to your Application section of this doc.

1.4. I have 2 (or more) browses on my window, I cannot select which browse to associate the SendTo control with - it always gets associated with the one browse.

Answer: This is a Clarion IDE oddity. Unfortunately there is nothing we can do about it. The only way to solve this is by deleting and re-adding the browses.

1.5. The imported procedure 'SendTo_Window' has predetermined controls that are displayed based on the output. How can I permanently hide some of them?

Answer: You can delete the following optional controls from the SendTo window if you don't require them:
  1. Configure Email Settings.
  2. Preview after Save.
  3. Suppress Greenbar.
  4. ExcelSettings group.
  5. Pageswide selection group.

1.6. I want to send straight to the printer (or another format) without displaying the SendTo window. How do I do that?

Answer: If you are wanting to do this on a global basis, then simply code in the SendTo_Window procedure the printer option (or whichever other option required) select and post an accepted event to the Send button as follows:

LocST:SendToWhat = 1             !For other formats use the respective equate
post(event:accepted,?Start)


If you're wanting to programmatically do this for certain instances of the SendTo button, then use the Option parameter bit loaded flag. I'd go with something >255. For example, where your SendTo_Window is called:

BrowseFormat6 = BrowseControl6{prop:format}
LocSendTo6:ListControl = BrowseControl6
LocSendTo6:Version = 2
LocSendTo6:Header = clip(target{prop:text})
LocSendTo6:CallingModule = ds_GetHModule()
LocSendTo6:Options = 256                    !<<<<<<<<<<<< Your addition
SendTo_Window(BRW1.Q,LocSendToParameters6)


Then in your Sendto_Window, in the init method:

if band(pSendToWindowParameters.Options,256)
  LocST:SendToWhat = 1
  post(event:accepted,?Start)
end



2.1. SendTo is not formatting the output of my browse correctly.

Answer: Sometimes Clarion does not return the correct Browse format:
If you have a group with a header, and the first column is blank, then, you will have 2 headers in your SendTo output. Unfortunately there's nothing I can do about this, but what you can do is move the header from the group to the column header. This will ensure that SendTo will obtain the correct information.


2.2. Why do my style settings in my list not get depicted in the output properly?

Answer:

Unfortunately some of the style properties in a list box are not readable. This means that (besides the text and background color settings) SendTo cannot determine the settings of your browse. As a result only the 2 color properties of the font will be depicted in the output.


2.3. My pages are appearing in strange orders and the rows aren't all appearing on the printed output.

Answer: You're probably not using the correct printer driver for the printer. This is the most likely cause. The best way to verify this, is to check the PDF output and see if it is correct. If it is correct, then this is the problem - otherwise mail us at support.


2.4. Only the first 100 columns of my browse is being output. How do I change this limitation?

Answer: This is easily changeable. We needed to pick a maximum and to optimize the amount of calls done in loops and size of memory used - while not over optimizing in that this becomes an inconvenience we picked 100 columns as the maximum. You can easily increase this, by changing the SendTo.inc file equates. So if you wanted to increase this limit to 200:

MaxCols        equate(200)
MaxCols1      equate(201)



2.5.How do I suppress the column header row?

Answer: You need to re-create the SendTo window (which will have the 'Suppress Column Headers' checkbox that you can use to suppress column headers at runtime).


2.7. How do I get my date values into true Excel dates when exporting to Excel?

Answer: You might need to re-import the SendTo window (as this is a control introduced in version 1.45). In the SendTo window, you'll find a check 'Date using True-date format' that you can use to use the excel date format when selecting Excel as the output format.


2.6. My text font color is white in the output - so it is not visible. How can this be rectified?

Answer: You cannot use propstyle:FontColor in your style's fonts. You must use propstyle:TextColor (which is an exact replacement). This is a known bug in Clarion, as propstyle:FontColor is write-only (and not read/write as the help indicates).


2.8. Is there a way to include a total on a column?

Answer:

The easiest way to do this, is to add a record at the end of the queue immediately before calling the sendto window. You'll find this in the 'SendTo - Call the SendTo Procedure' embed code.

For example:
localTotal = 0
loop x = 1 to records(MyListQueue)

  get(MyListQueue,x)
l
  localTotal += MyListQueue.TotalField
end

clear(MyListQueue)
add(MyListQueue)
!you might like to add a blank record in here to define a gap between the last record and the total - although you'll need to make sure that all your list fields are strings so that the zeros don't appear in the blank line.
MyListQueue.FirstField = 'Total'

MyListQueue.TotalField = localField

add(MyListQueue)


You'll need to delete the entry as well, immediately upon returning to the called procedure (i.e. in the embed point after the 'SendTo - Call the SendTo Procedure' embeded code)

get(MyListQueue,records(MyListQueue))
delete(MyListQueue)


2.9. I want to export my data to Excel without the ' preceding the data - i.e. I want Excel to format the data for me.

Answer: There's a property in the SendToExcel class (PreserveData) - that you can use to preserve the data and allow excel to format it. In your SendTo window, in the 'SendTo','Before sending File to','Excel' embed point - you can set it as follows:

ThisSendToExcel.PreserveData = 1  !Note you must use the ExcelClass directly

2.10. I want to hide certain columns based on certain conditions from the SendTo output

Answer: you can either do this in code, or set a variable/function to determine if the column must be visible (using the SendToButton control template prompts).

To use the template, go to the Column Customization section of this doc in code, Go to the "Prime The SendTo Queue" embed point and hide the columns that require hiding using the following example code:

if SuppressCol1       !This is the condition
  BrowseControl6{proplist:width,1} = 0     !In this case, BrowseControl6 is the list equate, and 1 is the column number.
end


2.11. I want to filter out certain records, add a total column, change some data before the SendTo output

Answer: To change the filter (in an ABC app) call BRW??.setfilter() before the SendTo - Prime the SendTo Queue embeded code.
To change data, delete records or add a total record, embed your code in after the SendTo - Prime the SendTo Queue embeded code.

You'll need to refresh the queue after the call to the SendTo Procedure so that your list appears as it did before the SendTo call.




3.1. I'm using a Report to PDF template, but my reports are being printed, not PDFed.

Answer 1: Check (we'll use the wPDFControls template in this example):
  1. That you've added the wPDFControls Global template.
  2. The 'Save Report to PDF' extension template to the SendTo_Printer procedure (leave as is).
  3. That you've checked the 'Use wPDFControl to support PDF generation' checkbox on you SendTo template on the SendTo_Printer procedure.
  4. That you've checked the 'Use a Report to PDF Convertor' checkbox on the SendTo control template in the SendTo_Window procedure.
Answer 2: There is an oddity in the Clarion6 IDE/Compiler. You need to:
  1. Remove the SendTo windows and the SVReportToPDF global Extension template
  2. Re-import the SendTo windows and add the SVReportToPDF global Extension template
  3. Setup the SendTo_Printer procedure and the SendTo_Window procedure templates to cater for PDF.


3.2. How do I add PDF support to SendTo in my application?

Answer:

For Clarion6 and up ABC applications:
  1. Your application must be an ABC based application compiled in Clarion6
  2. You need to add the Report to PDF - Global extension template to your global templates (and the HyperActive global extension if you would like to support previewing the PDF file after generation).
  3. In your SendTo local extension on your SendTo_Window - you need to check the Use a Report to PDF Convertor checkbox on the General tab. You also need to check the PDF checkbox on the File Formats tab.

    Either
  4. Re-run the ImportSendToWindowsABC Template Utility (Note: this will overwrite your existing SendTo windows).

    OR
  5. In your SendTo_Printer Report Properties, who must have the Report Target set to Printer. 
  6. Your SendTo_Printer procedure prototype should be as follows:

    (queue pQueue, long pListControl, string pHeader, byte pPreview=1,byte pSuppressGreenBar=0,<string pPdfFile>)

    Lastly: In your SendTo Extension template on your SendTo_Printer procedure, check the available PDF support checkbox on the options tab:


    To support previewing of the file, do the following:


For other applications:
  1. You need to purchase a 3rdparty Report to PDF tool (like wPDFControls).
  2. Follow the tool's instructions to add the template to your application (particularly your SendTo_Printer procedure).
  3. Add the HyperActive global extension if you would like to support previewing the PDF file after generation.
  4. The SendTo control template will detect the presence of the 3rdparty tool and add support to the procedure for that tool. Currently supported 3rdparty tools are: wPDFControls and PDFXChange. For support on other tools, please contact support<at>capesoft.com for more information.
  5. In your SendTo local extension on your SendTo_Window - you need to check the Use a Report to PDF Convertor checkbox on the General tab. You also need to check the PDF checkbox on the File Formats tab.
  6. In your SendTo Extension template on your SendTo_Printer procedure, check the available PDF support checkbox on the options tab:


    To support previewing of the file, do the following:



3.3. How do I use HyperActive to view my PDF files?

Answer:

This is Available for PDF users (in conjunction with the ABC Clarion6 SVReportToPDF extension template)
  1. Add the HyperActive Global Extension to your application.
  2. In the Local Extensions of your SendTo_Printer extension template, highlight the SendTo Local Extension template, and check the Use HyperActive to Preview the PDF File checkbox.


3.4. I upgraded SendTo and Office Inside, but now my SendTo excel is not working.

Answer: Due to the format change of MS Office when Office 2007 was released (to xlsx type), you must not force a file extension into the filename. Remove the default extension from the SendTo template (in the SendTo_Window procedure) for the Excel type (it's probably set to xls).


4.1. My PageNumbers are not correct in my reports.

Answer: You need to change your pagenumber counter on your report to the following SendTo populated variable:




4.2. I want to be able to select the paper size for my printer. It's fixed to A4.

Answer: This is currently supported in SendTo - although you have an old version of the SendTo window procedures. You need to re-run the SendTo Template Utility to import the SendTo windows again.


4.3. Not all my icons in my browse are being shown in the printout. How come?

Answer: Standard icons formats are 16 (4 bit) and 256 (8 bit) colors and 32 bit color. ALL formats are supported for icon resources, but their are some limitations in the icon formats that are supported off disk.

For icons from disk the following color formats are not currently supported:

1, 2, 4, 16 and 24 bit color.

This means that icons with 16 colors (4 bit) are currently not supported. This may be added to Draw at a later stage. 1,2 and 16 bit colors are unlikely to be supported.

If your icon is not appearing on the SendTo printer output, it is probably an icon on disk which is in one of the unsupported formats. You can either: 1. include the icon as a resource in your application, or 2. change to using an alternative icon that is in one of the supported formats.

If you are using a multi-dll application (using embedded icons) - then you may need to add these to the exe as well.


4.4. I want to use a 3rdParty previewer. How do I do this?

Answer: The SendTo_Printer procedure is the procedure that handles the printing, and is added to your application when you import the SendTo windows. Because this procedure forms part of your application, you can modify this to however you would like.

For example, to use the CPCS report previewer, you need to add the global extension template, and then in the SendTo_Printer procedure, code the call to the previewer as follows:

CPCSINIFileToUse = 'CPCSRPTS.INI'
ReturnValue = PrintPreview(ThisWindow.PreviewQueue,100,CLIP(CPCSINIFileToUse),ThisSendTo.Report,CPCSPreviewOptions,'','','',,,,,,,,,,,,)



4.5. How do I change the Report Header font - or spacing between the lines?

Answer: You have a procedure "SendTo_Printer" in your application (which was imported when you ran the Template Utility). You can use the
report designer to change this (or any of the reports other properties) in there.

4.6. I have a Right justified header/column that is being printed as left justified.

Answer: This is unfortunately a bug in Clarion that does not allow a print control to be right-justified at runtime (as of Clarion 6.3 9059). You will need to use the Decimal justification (which with a string will have the same effect as right-justified).


5.1. Not all my records are appearing in the SendTo output (legacy applications).

Answer: Unfortunately there is a Clarion oddity where there are more than 2517 records to be populated into a list box. SendTo needs to first load all the records to the list, before proceeding with the output. Clarion5.5 does not have the necessary embed points to allow this, and so this is only supported in Clarion6 onwards.

Implement one of the following two solutions. (Only one is necessary).

Possible Solution 1 (recommended)

See here.

Possible Solution 2
  1. Upgrade to Clarion6 or later.
  2. Re-run the SendTo install and check the 'Copy Legacy Browse template for SendTo support' checkbox.
  3. Manually edit your CTLBROW.TPW file (in your c55\template directory) by searching for the line (LOOP WHILE %InstancePrefix:ItemsToFill) and placing immediately above it the line shown here in red:

    END
    #embed(%PreCyclingThroughView,'In FillRecord - Before cycling through VIEW')
    LOOP WHILE %InstancePrefix:ItemsToFill


5.2. When I return from my SendTo output, the record I selected is different from when I called the SendTo routine.

Answer: This is related to FAQ 5.1. in that we've had to work around the list loading in legacy applications. Unfortunately this has an impact on the selection of records when returning to the list box window. The only way to solve this is to remodel to ABC templates.


6.1. My SMTP server requires a Authorized user and password. How do I do this in SendTo?

Answer: You need to override some of your code in the following procedures:

SendEmail:

6.2. When using SendTo, how can I change the default email Text from 'Please find the attached file.'?

Answer: In your SendTo_Email procedure find the line:

Loc:Text = 'Please find the attached file.'

and replace it with:

Loc:Text = getini('SendToSettings','EmailSubject','Please find the attached file.')

In your Kill method put:

putini('SendToSettings','EmailSubject',Loc:Text)


6.3. I need to send email using SSL. How do I do this?

Answer: In your SendEmail window, you can add your SSL settings into the code of the ?EmailSend button's accept event. Checkout the NetEmailSend section of the NetTalk docs on the properties required to be set using SSL.

7.1. How do I export to XML using xFiles?

Answer: You need to do the following 2 simple steps:
  1. Add the ActivatexFiles Global extension template.
  2. Add the IncludexFilesObject local extension template to your SendTo_Window procedure.

    2.1. Double click on your SendTo_Window procedure and click the Extensions button on the SendTo_Window procedure properties window.

    2.2. Click insert and locate the IncludexFilesObject template in the tree provided (If it's not there, then you have not installed/purchased xFiles - a CapeSoft product available from www.Clarionshop.com).

    2.3. Ensure that the Base Class is set to 'xFileXML'.
  3. In the prompts of your SendTo controls on the SendToWindow control template, go to your Output setup tab and check the XML checkbox in the 'File formats to use' option group.
Note: xFiles supports suppression of prefixes by default. This means that in legacy, you're likely to have a strange looking output (because of the naming structure that legacy uses for it's template generated browses). You might like to include the template generated prefix in the XML output (but with converted : to .) - although xFiles will exclude this by default.


7.2. How do I offer support for SendTo FTP in my application?

Answer: This requires NetTalk 4. Once you've installed NetTalk 4, you'll need to re-import the SendTo windows and the SendToTMP file into your dictionary and SendTo FTP will automatically be supported.


7.3. How can I enable my user to select a Tab delimiter character for the CSV file at runtime?

Answer: On the runtime window it's looking for a fixed single character, e.g. ','. At this point it's a lot harder to enter a "tab" because a tab is not a "printable character" that can be entered in a entry field. And <9> isn't going to work there because the program is running and <9> is a compiler directive.

Probably the best way is to put a check box on that window (which you can do easily enough as the window is in your application) and if the box is checked then (in embed code) set Loc:STDelimiter to '<9>'. (You can actually put the following as the embed code for the checkbox) - assuming the checkbox uses a (new) variable LocST:Tab:

if locST:Tab
  disable(?LocST:Delimiter)
  LocST:Delimiter = '<9>'
Else
  LocST:Delimiter = ','
  enable(?LocST:Delimiter)
End
 


8.1. Do I really need to purchase all those other products (NetTalk, OfficeInside, WinEvent, Draw, xFiles) in order to get SendTo to work?

Answer: Since the release of SendTo 2.0 - the good news is "No you don't". It does mean that if you don't purchase them, you will have limited functionality. If you do not purchase additional products, your SendTo outputs will be limited to : SendTo Printer, SendToHTML, SendToCSV. No list box icons will be included in the output, and you won't be able to email the SendTo output.

Depending on your need for the different outputs you could purchase one/more of the following to get what you need:
  1. OfficeInside - this is probably adds the most functionality to SendTo - in that it provides Excel and Word output format.
  2. Draw - this provides you with the ability to export icons to your output.
  3. NetTalk - this provides you with the ability to email and FTP your SendTo output.
  4. WinEvent - this provides you with the ability to read icons out of other DLLs (needs Draw to draw the icons), and embed HTML output in emails.
  5. xFiles - this provides you with the ability to SendTo xml.


8.2. Not all my data is being output to the SendTo output.

Answer: This is normally because you're using a page-loaded list that needs to be file-loaded. For ABC and Legacy browses SendTo will do this for you, but for other third party tools, you will need to code the necessary calls before the SendTo_Window call to make the list file-loaded. Contact your 3rdParty vendor to acquire the necessary information to accomplish this.


8.3. How do I use a different text editor (other than notepad) to view the CSV file output?

Answer: You need to set the PreviewProgram property in the SendTo_Window in the SendTo | Before sending File to | CSV embed point:

SendToClass.PreviewProgram = 'textpad.exe'

8.4. How can I get SendTo to work with a Dynamic Queue?

Answer:
  1. You need to declare a DummyQ in the local variable declaration section of the procedure. The DummyQ should contain more than the maximum number of fields that you anticipate your dynamic queue to contain:
    DummyQ        Queue
    String1              string(252)
    String2              string(252)
    ..............
                         end
    MyAny                any
    MyAny2                any
  2. Your listbox needs to use the DummyQ as its source:
    LIST,AT(8,111,595,128),USE(?ListDLBQ),FLAT,HIDE,HVSCROLL,VCR,FROM(DummyQ)
  3. Before the SendToWindow is called, you need to populate the DummyQ (in a loop) with the contents of the Dynamic queue:
    free(DummyQ)
    loop x = 1 to records(MyDynamicQ)
      get(MyDynamicQ,x)
      if errorcode() then break .
      clear(DummyQ)
      loop y = 1 to MyDynamicQ{prop:fields}
        if who(MyDynamicQ,y) = '' then break .
        MyAny &= what(MyDynamicQ,y)
        MyAny2 &= what(DummyQ,y) 
        MyAny2 = MyAny
      end
      add(DummyQ)
    end


8.5. My app GPFs when I SendTo from one of my procedures. It has a COM/OLE object attached.

Answer:

SendTo is disposing the COM object that is used on your window. you need to check the "Use with other OLE/COM control on this thread" checkbox on the SendTo button control template's prompts.


8.7. I would like to add a total at the end of the SendTo output. How do I do this?

Answer:

The easiest is (immediately before the SendToWindow is called) tally the cells you want and add a total row to the queue.

That row will be included in the sendto output.

Compile Errors

Check out general product CompilerErrors.


1.   UNRESOLVED EXTERNAL TYPE$DRAW
    UNRESOLVED EXTERNAL VMT$DRAW
   
Answer:
a) You have not added the Draw Global Extension template. Go to your global extensions and add the Draw Extension or
b) You have removed the Draw extension from the application, but you need to remove the STDrawHere=>1 project define from the project defines.

2.   UNRESOLVED EXTERNAL oiWORD....

Answer: You have not added the Office Inside Global Extension template. Go to your global extensions and add the Office Inside Extension.

3.   LABEL DUPLICATED, SECONF USED, PROPPRINT:PAPER

Answer: You have another 3rdparty product that has an incorrect inclusion of the prnprop.clw file. You need to contact that vendor for an update (CPCS and IceTips XPlore have updates).

4.  UNRESOLVED EXTERNAL TOPSPEED IN SENDTO.OBJ

Answer: T This normally occurs in a Multi-DLL application, where SQL tables are used in the dictionary, and no Topspeed files are used in that particular app that is throwing up the error. Because the SendTo file is a tps file, you need to include the TPS driver in parent applications (it's not linked in automatically).

Compile Errors related to version upgrading

You can either fix these issues by deleting the SendTo Windows and re-running the SendTo template utility, or fix the errors individually as follows (if you have made changes to the SendTo windows and would like to preserve those changes):

1.   ASSERT: The SendTo Window has the wrong parameters

Answer: The required parameters for the SendTo window changed in version 1.70. You must either:
(Queue pQueue,SendToWindowParametersType pSendToWindowParameters)    
You can have more parameters if you would like to handcode other information to pass to the SendTo window, but these are the minimum required parameter.

2.  ASSERT: The SendTo Printer Procedure has the incorrect parameters.

Answer: The required parameters for the SendToPrinter procedure changed in version 1.10. Go to your SendToPrinter procedure in the Clarion IDE and change the prototype to:

(queue pQueue, long pListControl, string pHeader, byte pPreview=1,byte pSuppressGreenBar=0,<string pPdfFile>,byte pPagesWide=1,SendToWindowParametersType pSendToWindowParameters)

YoYou can have more parameters if you would like to hand code other information to pass to the SendToPrinter procedure, but these are the minimum required parameters.

Note: You will also get incorrect page numbering. Check out the FAQ onMy PageNumbers are not correct in my reports. to rectify this.

3.   Unknown Identifier ?ExcelSettingsGroup

Answer: T The SendTo Window control template changed in version 1.10. Open your SendTo_Window procedure and go to the window formatter for that window. Then delete one of the controls in the SendToWindow control template and click Yes and OK to delete the control template. Now repopulate the SendToWindow control template onto the window.

4.  Syntax Error: Field not found MERGECELLS

Answer: You have an old version of OfficeInside - you need to upgrade to at least version 1.58.

5   Syntax Error : Unknown Identifier: SEN2TMP:FTP_PORT

Answer: You have an old Send2Temp file in your dictionary. Open your dictionary, delete the Send2Temp file, re-import it from the Clarion\Accessory\libsrc\win\send2tmp.dctx file and recompile. You will also probably need to re-import the sendto windows, because some prompts will be deleted.

6.  ASSERT: You need NetTalk 4 or later in order to use the Send To FTP Functionality

Answer: No - this isn't a clever marketing ploy, you've manually imported the SendTo window instead of using the template utility. The FTP functionality is only available for NetTalk users. When you use the Template Utility to import the SendTo window, the Template Utility will detect whether NetTalk is installed and import the correct SendToWindows.txa. Delete all the SendTo windows and re-run the Template Utility.

7.  Unknown function label: self.excel.filename in the SendTo.clw file

Answer:You are using an old version of OfficeInside. You need to upgrade to at least Version 2.66.

8.  Duplicate EmailMessageHTML variable declaration.

Answer:Open your SendEmail procedure properties and delete the EmailMessageHTML variable declared in the data tab.

9.  Unknown Identifier PSENDTOWINDOWPARAMETERS.

Answer:The prototype and parameters settings for the SendTo_Printer procedure are wrong. (This changed in build 2.24)They should be set to;
Prototype: (queue pQueue, long pListControl, string pHeader, byte pPreview=1,byte pSuppressGreenBar=0,<string pPdfFile>,byte pPagesWide=1,SendToWindowParametersType pSendToWindowParameters),name('QueuePrint')

Parameters:
(queue pQueue, long pListControl, string pHeader, byte pPreview=1,byte pSuppressGreenBar=0,<string pPdfFile>,byte pPagesWide=1,SendToWindowParametersType pSendToWindowParameters)


What the Users are saying about SendTo

Adrian Hastings in an Email (14 October, 2004):

The number of reports SendTo has saved me from writing has been a godsend. I rate your product an (sic) one of the more essential tools.

Hans Vinckier on the SoftVelocity News Group (May 25, 2004) (Re: SendTo):

I've send(sic) the app to a customer and asked his comments....
1 hour later he returned an email : 'This is the max, why did it take you so long to make it ???'

Fantastic job from the capesoft guys : From zero to customer comments in less than 2 hours.

License and Copyright

This template is copyright © 2015 by CapeSoft Software. None of the included files may be distributed. Your programs which use SendTo can be distributed without any royalties required from the use of SendTo.

This product is provided as-is. Use it entirely at your own risk. Use of this product implies your acceptance of this, along with the recognition of copyright stated above. In no way will CapeSoft Software, their employees or affiliates be liable in any way for any damages or business losses you may incur as a direct or indirect result of using this product.

Distribution

You may not distribute, copy or duplicate in any way any of the files that are included in SendTo (including but not limited to files with the extensions inc, clw, tpl, txa) except for the SendTo.ico. The SendTo.ico file you may copy and distribute freely with your applications. You do not require any other files to be distributed with your application.

Source Code Policy

We have chosen to ship SendTo as source code, rather than as a compiled DLL. This makes it much easier for you to modify, but it also makes it much easier for you to pirate. We ask you to please consider the effort involved in writing this product, before you choose to hand it on to any other developers.

If you received this program illegally (i.e. if you didn't pay for it, or you didn't buy it from CapeSoft, ClarionShop, or one of their respective dealers) then we ask you to contact us so that we can remedy this situation. Without the revenue generated from products such as this it is impossible for us to create new products.

Installation

Run the supplied installation file.

Support

To save you time (with the delay of waiting for reply emails), we suggest checking the FAQs. These are regularly updated and contain answers for most questions.
YoYour questions, comments and suggestions are welcome. Check our web page (www.capesoft.com/accessories/downloads.htm) for new versions. You can also contact us in one of the following ways.

CapeSoft Support
Email
Telephone +27 87 828 0123
087 828 0123
CapeSoft SendTo may be purchased from:

Version History

Download latest version here

Go to the CompileErrors section for instructions on how to upgrade your SendToWindows (if you're upgrading from a version prior to version 2.24).


Version 2.36 : 25 May 2021
Version 2.35 : 13 September 2018 Version 2.34 : 5 September 2017 Version 2.33 : 4 July 2016 Version 2.32 : 18 November 2015 Version 2.31 : 4 November 2015 Version 2.30 : 8 October 2015 Version 2.29 : 19 August 2015 Version 2.28 : 14 August 2015 Version 2.27 : 10 August 2015 Version 2.26 : 4 August 2015 Version 2.25 : 3 August 2015 Version 2.24 : 21 July 2015 Version 2.23 : 15 May 2015 Version 2.22 : 15 May 2015 Version 2.21 : 11 May 2015 Version 2.20 : 25 February 2015 Version 2.19 : 16 January 2015 Version 2.18 : 4 June 2014 Version 2.17 : 31 January 2014 Version 2.16 : Version 2.15 : Released 1 May 2013 Version 2.14 : Released 14 November 2012
Version 2.13 : Released 25 October 2012 Version 2.12 : Released 25 September 2012 Version 2.11 : Released 7 December 2011 Version 2.10 : Released 2 December 2011 Version 2.09 : Released 8 September 2011 Version 2.08 : Released 26 August 2011 Version 2.07 : Released 13 July, 2011 Version 2.06 : Released 17 June, 2011 Version 2.05 : Released March 21, 2011 Version 2.04 : Released October 11, 2010 Version 2.03 : Released September 21, 2010 Version 2.02 : Released June 4, 2010 Version 2.01 : Released May 24, 2010 Version 2.00 : Released May 19, 2010 Version 1.90 : Released October 29, 2009 Version 1.89 : Released September 28, 2009 Version 1.88 Gold: Released June 22, 2009 Version 1.87 Gold: Released January 25, 2009 Version 1.86 Gold: Released November 10, 2008 Version 1.85 Gold: Released July 21, 2008 Version 1.84Gold: Released July 21, 2008 Version 1.83 Gold: Released July 15, 2008 Version 1.82 Gold: Released June 20, 2008 Version 1.81Gold: Released April 21, 2008 Version 1.80Gold: Released March 6, 2008 Version 1.79 Gold: Released February 29, 2008 Version 1.78 Gold: Released February 29, 2008 Version 1.77 Gold: Released October 4, 2007 Version 1.76 Gold: Released October 4, 2007   Version 1.75 Gold: Released October 4, 2007 Version 1.74 Gold: Released September 4, 2007 Version 1.73 Gold: Released August 23, 2007 Version 1.72 Gold: Released July 24, 2007 Version 1.71 Gold: Released July 20, 2007 Version 1.70 Gold: Released July 19, 2007 Version 1.66 Gold: Released June 18, 2007 Version 1.65 Gold: Released October 3, 2006 Version 1.64 Gold: Released October 2, 2006 Version 1.63 Gold: Released June 21, 2006 Version 1.62 Gold: Released June 20, 2006 Version 1.61Gold: Released June 19, 2006 Version 1.60Gold: Released June 8, 2006 Version 1.51 Beta: Released June 6, 2006 Version 1.50 Beta: Released June 2, 2006 Version 1.49 Beta: Released March 22, 2006 Version 1.48 Beta: Released March 21, 2006 Version 1.47 Beta: Released January 9, 2006 Version 1.46 Beta: Released December 7, 2005 Version 1.45 Beta: Released November 18, 2005

Note: This release requires an updated Draw to version 2.20 Version 1.44 Beta: Released November 8, 2005 Version 1.42 Beta: Released November 2, 2005

In this release, I recommend a re-import of the SendToTMP file into your dictionary,
as well as a re-import of the SendTo windows into your application. This is not essential,
but in order to utilize new and future features, this is recommended.
Version 1.41 Beta: Released November 1, 2005 Version 1.40 Beta: Released September 12, 2005 Version 1.39 Beta: Released July 01, 2005 Version 1.38 Beta: Released June 10, 2005 Version 1.37 beta: Released March 18, 2005 Version 1.36 beta: Released March 09, 2005

Important: You need Office Inside 1.69 or newer for this version of SendTo! Version 1.35 beta: Released March 02, 2005

Important: You need Office Inside 1.67 or newer for this version of SendTo!
Version 1.34 beta: Released February 7 , 2005 Version 1.33 beta: Released January 24 , 2005 Version 1.32 beta: Released 7 December , 2005 Version 1.31 beta: Released 6 December , 2004 Version 1.30 beta: Released 29 November , 2004

What's Changed: Version 1.29 beta: Released 29 November , 2004

What's Changed: Version 1.28 beta: Released 29 November , 2004

What's Changed:
Version 1.27 beta: Released 29 November , 2004

What's Changed: Version 1.26 beta: Released 26 November , 2004

What's Changed:
Version 1.25 beta: Released 22 November , 2004

What's Changed:
Version 1.24 beta: Released 22 November , 2004

What's Changed:
Version 1.23 beta: Released 18 November , 2004

What's Changed:
Version 1.22 beta: Released 11 November , 2004

What's Changed:
Version 1.21 beta: Released 10 November , 2004

What's Changed:
Version 1.20 beta: Released 28 October , 2004

What's Changed:
Version 1.19 beta: Released 26 October , 2004

What's Changed:

Note: You will need at least version 1.54 of Office Inside in order to implement this version of SendTo. Version 1.18 beta: Released 19 October , 2004

What's Changed:
Version 1.17 beta: Released 19 October , 2004

What's Changed:
Version 1.16 beta: Released 18 October , 2004

What's Changed:
Version 1.15 beta: Released 13 October , 2004

What's Changed:

Details: Version 1.14 beta: Released 21 September , 2004

What's Changed:
Version 1.13 beta: Released 14 September , 2004

What's Changed:
Version 1.12 beta: Released 13 August , 2004

What's Changed:
Details: Version 1.11 beta: Released 4 August , 2004

What's Changed:
Version 1.10 beta: Released 2 August , 2004
What's Changed:
Version 1.09 beta: Released 28 July , 2004

What's Changed:
Version 1.08 beta: Released 23 July , 2004

What's Changed:
Version 1.07 beta: Released 21 July , 2004

What's Changed:
Version 1.06 beta: Released 16 July , 2004

What's Changed:
Details: Version 1.05 beta: Released 11 June , 2004
What's Changed: Details: Version 1.04 beta: Released 8 June , 2004

What's Changed:
Details: Version 1.03 beta: Released 28 May , 2004

What's Changed:
Version 1.02 beta: Released 28 May , 2004

What's Changed:
Details Version 1.01 beta: Released 27 May , 2004

What's Changed: Details Version 1.00 beta: Released 21 May , 2004