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><sortfields>
<sortfield>
<fieldname>Customers.CompanyName</fieldname>
<ascending>true</ascending>
<group>false</group>
<order>1</order>
</sortfield>
</sortfields>
</sort>
<fields><fields>
<field>
<fieldname>Products.CategoryID</fieldname>
<heading>Category Name</heading>
<order>1</order>
<width>15</width>
<fontbold>false</fontbold>
<fontitalic>false</fontitalic>
<fontunderline>false</fontunderline>
<alignment>0</alignment>
<format/>
<inputmask/>
<hposition>-1</hposition>
<vposition>-1</vposition>
<group>2</group>
<chart>99</chart>
<chartorder>0</chartorder>
<chartinputmask/>
<chartformat/>
<totaltype>S</totaltype>
<charttotaltype>N</charttotaltype>
<forecolor>-1</forecolor>
<backcolor>-1</backcolor>
<suppress>true</suppress>
<groupcount>false</groupcount>
<fontname/>
<fontsize>0</fontsize>
<fontcharset>-1</fontcharset>
<autofit>true</autofit>
<newpage>false</newpage>
<resetpage>false</resetpage>
<descending>false</descending>
<includeallfields>false</includeallfields>
<aliascaption>Products</aliascaption>
<bookmark>false</bookmark>
<datatrim>1</datatrim>
<memberdata/>
<usedefaultformat>true</usedefaultformat>
<usedefaultformatchart>true</usedefaultformatchart>
<groupononeline>false</groupononeline>
<nototalsforonerecord>false</nototalsforonerecord>
<showpercent>false</showpercent>
<appview>Products</appview>
<showchange>false</showchange>
<showchangeamt>false</showchangeamt>
<leftaxis>true</leftaxis>
<nogroupfooter>false</nogroupfooter>
<textformat>T</textformat>
</field>
</fields>
</fields>
<comments/>
<rep_type>X</rep_type>
<footer/>
<header>Xtab with Average</header>
<leftmargin>0</leftmargin>
<doquery/>
<filter><conditions>
<condition>
<connection/>
<fieldname>Orders.OrderDate</fieldname>
<operclass>sfoperatorbetween</operclass>
<values><![CDATA[<value>{^1996-07-01 00:00:00}</value><value>{^1996-07-08 23:59:59}</value>]]></values>
<display/>
<dispvalues/>
<case>true</case>
<prompt>true</prompt>
<valuetype>Value</valuetype>
<nodisp>false</nodisp>
<description/>
</condition>
</conditions>
</filter>
<reportprop><reportprop><other runnorecords="Y"/></reportprop>~</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><joins>
<join>
<table1>Orders</table1>
<table2>Customers</table2>
<jointype>right outer join</jointype>
</join>
</joins>
</customjoin>
<autofit>false</autofit>
<warnnofilt>false</warnnofilt>
<recpergrp>0</recpergrp>
<afterprev/>
<templatefile>*Not shown for brevity*</templatefile>
<templatename>Elegant</templatename>
<security><root><role><name>Everyone</name><rights>2</rights></role></root></security>
<sdata/>
<calcfields/>
<repfile/>
<images/>
<functions/>
</report>
</VFPData>
Here are the elements in the XML:
Element | Description |
---|---|
rectype | Record type: always "R." |
name | The name of the report. The name should match the name of SFX file or there may be confusion when the report is imported. |
reportfile | The name of the report file for external reports (that is, Visual FoxPro or Crystal Reports). |
reportcls | The 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. |
reportlib | The library containing the class specified in REPORTCLS. This always contains either SFReports.VCX, SFRXTab.VCX, or SFRCrystal.VCX. |
folders | The 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. |
datagroup | The data group used for this report. This is blank if you don't use data groups. |
stdfilt | An 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 "=." |
allowfilt | If 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. |
allowsort | If 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. |
sort | This 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> |
fields | This 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> |
comments | Comments about the report shown to the user in the Information page in the Reports Explorer. |
footer | Text to print in the footer of the report; this is only used by quick and cross-tab reports. |
header | Text to print in the header of the report; this is only used by quick and cross-tab reports. |
leftmargin | The left margin (in characters) for the report; this is only used by quick and cross-tab reports. |
doquery | If 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. |
filter | This 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> |
reportprop | This contains additional information about the report, stored as XML. As an example of its use, information about labels goes in this field. |
onselect | This contains any code automatically executed when the specified report is selected. |
orientat | The orientation to use for the report. 0 means "automatic," 1 means use portrait, and 2 means use landscape. |
frxfile | Contains XML for an advanced layout report. |
afterrun | If this isn't empty, the program assumes it contains code and executes that code after a report has been run. |
summary | This contains "true" if Summary was selected in the Options page of the Reports Explorer for this report. |
showfilter | This contains "true" if the filter is included in the report header. |
beforedata | If this isn't empty, the program assumes it contains code and executes that code before data is retrieved from the database. |
afterdata | If this isn't empty, the program assumes it contains code and executes that code after data is retrieved from the database. |
createdat | The date and time the report was created. |
createdby | The user who created the report. |
modifiedat | The date and time the report was last modified. |
modifiedby | The user who last modified the report. |
runat | The date and time the report was last run. |
runby | The user who last ran the report. |
template | The ID of the template for this report. |
oldengine | This 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". |
snapshot | Not used. |
sqlclause | Additional clauses to add to the SQL statement for the report. |
exclude | This 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. |
customjoin | This 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. |
recpergrp | The number of records to retrieve per group (0 means retrieve all records). |
afterprev | The After Preview script for the report. |
beforeout | The Before Output script for the report. |
useothers | "true" to use "Other" for non-top records or "false" to omit non-top records. |
templatefile | XML defining the layout of the template for the report. |
templatename | The name of the template for the report. |
security | XML 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 |
sdata | The license number for the report. |
calcfields | XML defining the formulas used in the report. |
repfile | Not used. |
images | Images used in the advanced layout of the report (binary converted to text so it can be written out when the report is imported). |
functions | Custom functions used by formulas in the report (encrypted). |
© Stonefield Software Inc., 2023 • Updated: 06/24/20
Comment or report problem with topic