Reports are stored in files with an SFX extension in the Reports subdirectory of whichever folder you specified as the location for reports.

If you configured Stonefield Query to use a server database to store its data, SFX files are not created automatically. However, you can choose Export Reports or Export Selected Report from the File menu to create SFX files if you wish.

SFX files are actually text files containing XML. Here is an example of one:

<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
		<name>Xtab with Average</name>
		<folders>my Reports</folders>
		<datagroup>Order Entry</datagroup>
		&lt;heading&gt;Category Name&lt;/heading&gt;
		<header>Xtab with Average</header>
		&lt;values&gt;&lt;![CDATA[&lt;value&gt;{^1996-07-01 00:00:00}&lt;/value&gt;&lt;value&gt;{^1996-07-08 23:59:59}&lt;/value&gt;]]&gt;&lt;/values&gt;
		<reportprop>&lt;reportprop&gt;&lt;other runnorecords="Y"/&gt;&lt;/reportprop&gt;~</reportprop>
		&lt;jointype&gt;right outer join&lt;/jointype&gt;
		<templatefile>*Not shown for brevity*</templatefile>

Here are the elements in the XML:

rectypeRecord type: always "R."
nameThe name of the report. The name should match the name of SFX file or there may be confusion when the report is imported.
reportfileThe name of the report file for external reports (that is, Visual FoxPro or Crystal Reports).
reportclsThe class used for this report. It contains SFReportQuick for a quick report, SFReportXTab for a cross-tab report, SFReportLabel for labels, SFReportChart for a chart report, SFReportFRX for a Visual FoxPro FRX report, or SFReportCrystal for a Crystal Reports report.
reportlibThe library containing the class specified in REPORTCLS. This always contains either SFReports.VCX, SFRXTab.VCX, or SFRCrystal.VCX.
foldersThe folders the report belong to. As with name, this should match the name of folder the SFX file is in or weird things can happen, such as a report you deleting reappearing in the Reports Explorer.
datagroupThe data group used for this report. This is blank if you don't use data groups.
stdfiltAn expression representing a "standard" filter applied to the data. This filter is not shown to the user and is ANDed with any filter specified by the user. An example is a U.S. customer report, in which STDFILT contains:

The user can specify any additional filter they want (if they don't specify anything, they get a list of all U.S. customers), but they cannot see nor can they change this standard filter. You can specify an expression that's evaluated at runtime by prefixing it with "=."

allowfiltIf this is "true" (which is normally the case), the user can define a filter for this report. You may set this to "false" if the report has a standard (STDFILT column) or saved (FILTER column) filter and you don't want the user to specify anything else.
allowsortIf this is "true,"" the user can specify the sort order for the report. You'll likely want to set this to False for any report that uses group expressions.
sortThis contains XML defining how the data is sorted for this report. The XML has the following structure:
    <fieldname>aliased field name for first sort field</fieldname>
    <ascending>"true" for ascending, "false" for descending</ascending>
    <group>"true" if this is a grouped field</group>
    <order>numeric order value</order>
    <fieldname>aliased field name for second sort field</fieldname>
    <ascending>"true" for ascending, "false" for descending</ascending>
    <group>"true" if this is a grouped field</group>
    <order>numeric order value</order>
  additional <sortfield> nodes as necessary
fieldsThis contains XML defining the fields used in the report. The XML has the following structure:
    <fieldname>aliased field name</fieldname>
    <heading>column heading</heading>
    <order>numeric field order</order>
    <fontbold>"true" for bold</fontbold>
    <fontitalic>"true" for italic</fontitalic>
    <fontunderline>"true" for underline</fontunderline>
    <alignment>numeric alignment value (0 = left,
      1 = center, 2 = right)</alignment>
    <format>format setting</format>
    <inputmask>picture setting</inputmask>
    <hposition>horizontal position; -1 for automatic</hposition>
    <vposition>vertical position; -1 for automatic</vposition>
    <group>numeric group number; 0 if not grouped</group>
    <chart>numeric chart number: 0 for values field, 1 for category field,
        2 for series field</chart>
    <chartorder>numeric field order for charts</chartorder>
    <chartinputmask>picture setting for charts</chartinputmask>
    <chartformat>format setting for charts</chartformat>
    <totaltype>first letter of the total type (N = none)</totaltype>
    <charttotaltype>first letter of the total type (N = none) for
    <forecolor>foreground RGB value (-1 = default)</forecolor>
    <backcolor>-background RGB value (-1 = default)</backcolor>
    <suppress>"true" to suppress repeating values</suppress>
    <groupcount>"true" to show count in group footer</groupcount>
    <fontname>font name (blank for default)</fontname>
    <fontsize>font size (blank for default)</fontsize/>
    <autofit>"true" for auto-fit</autofit>
    <newpage>"true" to start each group on new page</newpage>
    <resetpage>"true" to reset the page number to 1</resetpage>
    <descending>"true" to sort group fields descending</descending>
    <includeallfields>this element isn't used anymore, but is still present
        for backward compatibility; it's always "false" in
        new reports</includeallfields>
    <aliascaption>the table caption</aliascaption>
    <bookmark>"true" to create a bookmark</bookmark>
    <datatrim>numeric trimming value; 1 = word wrap,
      2 = cut off with ellipsis at end,
      3 = cut off with ellipsis in middle</datatrim>
    <memberdata><![CDATA[additional formatting information]]></memberdata>
    <usedefaultformat>"true" to use default format</usedefaultformat>
    <usedefaultformatchart>"true" to use default format for
    <groupononeline>"true" to include all fields in the group header on
        one line</groupononeline>
    <nototalsforonerecord>"true" to not show a group footer band if there's
        only one record in the group</nototalsforonerecord>
    <showpercent>"true" to display a "% of total"
        field for this field</showpercent>
  additional <field> nodes as necessary
commentsComments about the report shown to the user in the Information page in the Reports Explorer.
footerText to print in the footer of the report; this is only used by quick and cross-tab reports.
headerText to print in the header of the report; this is only used by quick and cross-tab reports.
leftmarginThe left margin (in characters) for the report; this is only used by quick and cross-tab reports.
doqueryIf this isn't empty, the program assumes it contains code and executes that code rather than creating and executing a SQL statement for the report.
filterThis contains XML specifying the filter conditions for the report.
    <connection>The connection to the previous condition</connection>
    <fieldname>Aliased field name</fieldname>
    <operclass>Class used for filter operator</operclass>
    <values><![CDATA[<value>filter value</value>]]></values>
    <display><![CDATA[filter expression as the user sees it]]></display>
    <case>"true" for case-sensitive filter</case>
    <prompt>"true" for ask-at-runtime</prompt>
    <valuetype>type of value: "Value," "Fields,", or
  additional <condition> nodes as necessary
reportpropThis contains additional information about the report, stored as XML. As an example of its use, information about labels goes in this field.
onselectThis contains any code automatically executed when the specified report is selected.
orientatThe orientation to use for the report. 0 means "automatic," 1 means use portrait, and 2 means use landscape.
frxfileContains XML for an advanced layout report.
afterrunIf this isn't empty, the program assumes it contains code and executes that code after a report has been run.
summaryThis contains "true" if Summary was selected in the Options page of the Reports Explorer for this report.
showfilterThis contains "true" if the filter is included in the report header.
beforedataIf this isn't empty, the program assumes it contains code and executes that code before data is retrieved from the database.
afterdataIf this isn't empty, the program assumes it contains code and executes that code after data is retrieved from the database.
createdatThe date and time the report was created.
createdbyThe user who created the report.
modifiedatThe date and time the report was last modified.
modifiedbyThe user who last modified the report.
runatThe date and time the report was last run.
runbyThe user who last ran the report.
templateThe ID of the template for this report.
oldengineThis contains "true" if the old report engine is used to run this report.
allowdupe"true" to set the *Add DISTINCT to SQL Statement* setting to "No" or "false" to set it to *When filtering on a table not included in the fields list* if the *distinct* element is "false".
snapshotNot used.
sqlclauseAdditional clauses to add to the SQL statement for the report.
excludeThis contains XML specifying the exclude conditions for the report using the same format as described above for the filter element.
headtotals"true" if group totals should appear in group header bands or "false" to appear in group footer bands.
distinct"true" to set the *Add DISTINCT to SQL Statement* setting to "Yes" or "false" to use the *allowdupe* element to set it.
customjoinThis contains XML specifying the custom joins for the report.
    <jointype>right outer join</jointype>
autofit"true" to auto-fit the report to the page or "false" to not auto-fit.
warnnofilt"true" to display a warning if the report has no filter when it's run or "false" to not display a warning.
recpergrpThe number of records to retrieve per group (0 means retrieve all records).
afterprevThe After Preview script for the report.
beforeoutThe Before Output script for the report.
useothers"true" to use "Other" for non-top records or "false" to omit non-top records.
templatefileXML defining the layout of the template for the report.
templatenameThe name of the template for the report.
securityXML specifying the security for the report. The format is:

where RoleName is the name of a role and Rights are the rights that role has to the report: 0 = no access, 1 = read access, 2 = write access

sdataThe license number for the report.
calcfieldsXML defining the formulas used in the report.
repfileNot used.
imagesImages used in the advanced layout of the report (binary converted to text so it can be written out when the report is imported).
functionsCustom functions used by formulas in the report (encrypted).

© Stonefield Software Inc., 1996-2020 • Updated: 06/24/20
Comment or report problem with topic