Reporting Features for International Applications

This topic discusses features in Visual FoxPro 9's Report System that facilitate developing reports for use in international applications.

Note

Some of the features discussed here are available only in Visual FoxPro's object assisted reporting mode. If you find that you do not see some of the improvements described in this topic, use the command SET REPORTBEHAVIOR 90, or include the OBJECT clause on the REPORT FORM or LABEL command. For more information, see SET REPORTBEHAVIOR Command.

Using Language Script in Reports

Just as you can choose fonts individually for report layout elements, you can choose a language script for each element individually. For more information, see How to: Change Font Settings in Report Controls.

If you do not choose a language script for a particular element, it receives its language script information, like its font information, from the report's default. You use the Default Font… option on the Report menu for this purpose. You can also set the font and language script defaults for a report using the Page Layout tab of the Report Properties dialog. For more information, see How to: Change Page Settings for Reports.

When you design a new report, the default font and language script for the report is determined by your global preference, as set in the Tools Options dialog box. For more information, see Reports Tab, Options Dialog Box.

Tip

The Options Dialog Box global choice, the Report Builder Page Layout tab, and the Report Builder's options for setting fonts for individual layout elements all offer you an option to omit the language script from your font settings. When you choose this option, the language script for your report elements matches your computer's regional default settings. This behavior is backward-compatible with earlier versions of Visual FoxPro.

The language script with which the Visual FoxPro Report System generates output for report layout elements is automatically available to additional forms of report output you can create with ReportListener-derived classes. The source text provided in the ReportListener's Render method's eContentsToBeRendered parameter is Unicode, and the native Report System has already converted the data to the appropriate character set. For more information, see Render Method.

The ReportListener XML Foundation Class provides an example of an alternative output type leveraging this feature. The class uses its Render method's Unicode value to account for mixed language scripts in report output automatically. It converts the Unicode values to construct UTF-8 encoded documents. For more information about the class's XML output, see Using VFP Report Output XML.

Warning

This capability may appear to work in reports when you do not use object-assisted mode, when you preview the reports. However, it will not print as you expect, and is only supported in object-assisted mode.

Localizing Report Builder, Report Preview, and Report Output Components

The distributable source components of the Visual FoxPro Report System each provides a header (.h) file you can change to localize all user feedback strings. You can recompile the applications, and redistribute them separately, to provide a shared, external reporting component. You can also bind your adjusted version of each component directly into your application's .exe or .app file.

The following table lists the appropriate header file for each component, and provides a help topic you can read to learn more about specifying your adjusted reporting component file for application use.

Component file name Use in applications Localization header file name Help topic with additional information

ReportBuilder.app

Augments the user experience of creating and modifying report and label layouts.

frxbuilder_loc.h

How to: Specify and Distribute ReportBuilder.App

ReportPreview.app

Provides a flexible user interface for GDI+-rendered report previews.

frxpreview_loc.h

How to: Specify and Distribute ReportPreview.App

ReportOutput.app,

_reportlistener.vcx

Provides ReportListener classes for object-assisted reporting.

reportoutput_locs.h,

reportlisteners_locs.h

How to: Specify and Distribute Report Output Application Components

ReportListener Foundation Classes

_frxcursor.vcx

Provides algorithms useful for programmatically creating and adjusting reports.

_frxcursor.h

FRX Cursor Foundation Class

For more information, see Including Report Files for Distribution.

Each component also includes application programming interfaces (APIs) appropriate to changing user feedback messages at run time, to customize for regional purposes as well as other, application-specific needs. For example, the ReportListener User Feedback Foundation Class, the default ReportListener-derived class for print and preview output, provides public members you use to set its various text status messages and captions. The Report Preview Application exposes a Caption property and an extensive API for adjusting its context menu. For more information, see Leveraging the Default Preview Container.

Handing Reading Order (Right-to-Left and Left-to-Right) of Multiple Languages

The Report Designer supports right-to-left languages with Text Alignment and Reading Order properties. You can design labels and text (expression) layout elements to match the desired right-to-left results, by setting both these properties for selected elements, using the following options on the Format menu:

  • Set the Text Alignment of the layout element to Right

  • Set the Reading Order property to Right to Left.

Note

The Reading Order option on the Format menu is disabled unless you have set Windows' regional settings to display a right-to-left language, such as Arabic or Hebrew, for non-Unicode applications. Once you have enabled the setting, you can set individual report items to different Reading Order values as required for a mixed-language report.

At run time, Visual FoxPro 9's new GDI+ rendering system provides more flexible and accurate handling of alignment for right-to-left languages. It also renders the alignment more consistently between preview and print output.

ReportListener-derived classes have access to the alignment and reading order settings stored in your report or label, and can take action based on these settings. For example, the ReportListener HTML Foundation Class uses these options to determine text-align and direction components of style attributes for individual HTML text elements.

See Also

Concepts

Understanding Visual FoxPro Object-Assisted Reporting
Using GDI+ in Reports

Other Resources

Distributing Reports with Applications