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"?>
<VFPData>
	<report>
		<rectype>R</rectype>
		<name>Xtab with Average</name>
		<reportfile/>
		<reportcls>sfreportxtab</reportcls>
		<reportlib>sfrxtab.vcx</reportlib>
		<folders>my Reports</folders>
		<datagroup>Order Entry</datagroup>
		<stdfilt/>
		<allowfilt>true</allowfilt>
		<allowsort>true</allowsort>
		<sort>&lt;sortfields&gt;
		&lt;sortfield&gt;
			&lt;fieldname&gt;Customers.CompanyName&lt;/fieldname&gt;
			&lt;ascending&gt;true&lt;/ascending&gt;
			&lt;group&gt;false&lt;/group&gt;
			&lt;order&gt;1&lt;/order&gt;
		&lt;/sortfield&gt;
	&lt;/sortfields&gt;
	    </sort>
		<fields>&lt;fields&gt;
	&lt;field&gt;
		&lt;fieldname&gt;Products.CategoryID&lt;/fieldname&gt;
		&lt;heading&gt;Category Name&lt;/heading&gt;
		&lt;order&gt;1&lt;/order&gt;
		&lt;width&gt;15&lt;/width&gt;
		&lt;fontbold&gt;false&lt;/fontbold&gt;
		&lt;fontitalic&gt;false&lt;/fontitalic&gt;
		&lt;fontunderline&gt;false&lt;/fontunderline&gt;
		&lt;alignment&gt;0&lt;/alignment&gt;
		&lt;format/&gt;
		&lt;inputmask/&gt;
		&lt;hposition&gt;-1&lt;/hposition&gt;
		&lt;vposition&gt;-1&lt;/vposition&gt;
		&lt;group&gt;2&lt;/group&gt;
		&lt;chart&gt;99&lt;/chart&gt;
		&lt;chartorder&gt;0&lt;/chartorder&gt;
		&lt;chartinputmask/&gt;
		&lt;chartformat/&gt;
		&lt;totaltype&gt;S&lt;/totaltype&gt;
		&lt;charttotaltype&gt;N&lt;/charttotaltype&gt;
		&lt;forecolor&gt;-1&lt;/forecolor&gt;
		&lt;backcolor&gt;-1&lt;/backcolor&gt;
		&lt;suppress&gt;true&lt;/suppress&gt;
		&lt;groupcount&gt;false&lt;/groupcount&gt;
		&lt;fontname/&gt;
		&lt;fontsize&gt;0&lt;/fontsize&gt;
		&lt;fontcharset&gt;-1&lt;/fontcharset&gt;
		&lt;autofit&gt;true&lt;/autofit&gt;
		&lt;newpage&gt;false&lt;/newpage&gt;
		&lt;resetpage&gt;false&lt;/resetpage&gt;
		&lt;descending&gt;false&lt;/descending&gt;
		&lt;includeallfields&gt;false&lt;/includeallfields&gt;
		&lt;aliascaption&gt;Products&lt;/aliascaption&gt;
		&lt;bookmark&gt;false&lt;/bookmark&gt;
		&lt;datatrim&gt;1&lt;/datatrim&gt;
		&lt;memberdata/&gt;
		&lt;usedefaultformat&gt;true&lt;/usedefaultformat&gt;
		&lt;usedefaultformatchart&gt;true&lt;/usedefaultformatchart&gt;
		&lt;groupononeline&gt;false&lt;/groupononeline&gt;
		&lt;nototalsforonerecord&gt;false&lt;/nototalsforonerecord&gt;
		&lt;showpercent&gt;false&lt;/showpercent&gt;
		&lt;appview&gt;Products&lt;/appview&gt;
		&lt;showchange&gt;false&lt;/showchange&gt;
		&lt;showchangeamt&gt;false&lt;/showchangeamt&gt;
		&lt;leftaxis&gt;true&lt;/leftaxis&gt;
		&lt;nogroupfooter&gt;false&lt;/nogroupfooter&gt;
		&lt;textformat&gt;T&lt;/textformat&gt;
	&lt;/field&gt;
&lt;/fields&gt;
</fields>
		<comments/>
		<rep_type>X</rep_type>
		<footer/>
		<header>Xtab with Average</header>
		<leftmargin>0</leftmargin>
		<doquery/>
		<filter>&lt;conditions&gt;
	&lt;condition&gt;
		&lt;connection/&gt;
		&lt;fieldname&gt;Orders.OrderDate&lt;/fieldname&gt;
		&lt;operclass&gt;sfoperatorbetween&lt;/operclass&gt;
		&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;
		&lt;display/&gt;
		&lt;dispvalues/&gt;
		&lt;case&gt;true&lt;/case&gt;
		&lt;prompt&gt;true&lt;/prompt&gt;
		&lt;valuetype&gt;Value&lt;/valuetype&gt;
		&lt;nodisp&gt;false&lt;/nodisp&gt;
		&lt;description/&gt;
	&lt;/condition&gt;
&lt;/conditions&gt;
</filter>
		<reportprop>&lt;reportprop&gt;&lt;other runnorecords="Y"/&gt;&lt;/reportprop&gt;~</reportprop>
		<onselect/>
		<orientat>0</orientat>
		<frxfile/>
		<afterrun/>
		<summary>true</summary>
		<showfilter>true</showfilter>
		<beforedata/>
		<afterdata/>
		<createdat>2018-04-06T16:22:26</createdat>
		<createdby>ADMIN</createdby>
		<modifiedat>2018-04-09T15:40:16</modifiedat>
		<modifiedby>ADMIN</modifiedby>
		<runat>2018-04-09T15:40:03</runat>
		<runby>ADMIN</runby>
		<template>2</template>
		<oldengine>false</oldengine>
		<allowdupe>false</allowdupe>
		<snapshot/>
		<sqlclause/>
		<exclude/>
		<headtotals>false</headtotals>
		<distinct>false</distinct>
		<customjoin>&lt;joins&gt;
	&lt;join&gt;
		&lt;table1&gt;Orders&lt;/table1&gt;
		&lt;table2&gt;Customers&lt;/table2&gt;
		&lt;jointype&gt;right outer join&lt;/jointype&gt;
	&lt;/join&gt;
&lt;/joins&gt;
        </customjoin>
		<autofit>false</autofit>
		<warnnofilt>false</warnnofilt>
		<recpergrp>0</recpergrp>
		<afterprev/>
		<templatefile>*Not shown for brevity*</templatefile>
		<templatename>Elegant</templatename>
		<security>&lt;root&gt;&lt;role&gt;&lt;name&gt;Everyone&lt;/name&gt;&lt;rights&gt;2&lt;/rights&gt;&lt;/role&gt;&lt;/root&gt;</security>
		<sdata/>
		<calcfields/>
		<repfile/>
		<images/>
		<functions/>
	</report>
</VFPData>

Here are the elements in the XML:

ElementDescription
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:
CUSTOMER.COUNTRY = 'U.S.'

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:
<sortfields>
  <sortfield>
    <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>
  </sortfield>
  <sortfield>
    <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>
  </sortfield>
  additional <sortfield> nodes as necessary
</sortfields>
fieldsThis contains XML defining the fields used in the report. The XML has the following structure:
<fields>
  <field>
    <fieldname>aliased field name</fieldname>
    <heading>column heading</heading>
    <order>numeric field order</order>
    <width>width</width>
    <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
        charts</charttotaltype>
    <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
        charts</usedefaultformatchart>
    <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>
  </field>
  additional <field> nodes as necessary
</fields>
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.
<conditions>
  <condition>
    <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
        "Expression"</valuetype>
  </condition>
  additional <condition> nodes as necessary
</conditions>
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.
<joins>
  <join>
    <table1>ORDERS</table1>
    <table2>CUSTOMERS</table2>
    <jointype>right outer join</jointype>
  </join>
</joins>
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:
<security>
    &lt;root&gt;
        &lt;role&gt;
            &lt;name&gt;RoleName&lt;/name&gt;
            &lt;rights&gt;Rights&lt;/rights&gt;
        &lt;/role&gt;
    &lt;/root&gt;
</security>

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., 2023 • Updated: 06/24/20
Comment or report problem with topic