Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
This article explains how to use the @WRExportType reserved word to control the export format of a report when using VDM / WebReports.
What is @WRExportType?
@WRExportType is a special keyword (called a reserved word) that helps automatically set the export format (like PDF, HTML, Excel, etc.) for a report based on how it's run—whether in VDM or through WebReports via API calls.
How @WRExportType Works: Using @WRExport as the Default Value
1. Running the Report in VDM
-
The
@WRExportTypevalue will be empty/null. -
VDM will automatically use the first option in your list of export types (e.g., “HTML”).
2. Running the Report in WebReports Without Export Settings Set
-
If the API URL does not include an ExportType or SaveFile setting:
-
@WRExportTypewill be empty. -
WebReports will default to the first option in your export type list (e.g., “HTML”).
-
3. Running the Report in WebReports With Export Settings
-
If the API URL includes
SaveFileand anExportType(likePDF,XLSX, etc.):-
That value will be passed to
@WRExportType. -
The report will export in that specified format.
-
Understanding API URL Calls
If you're unfamiliar with API URL calls used in WebReports, here’s a quick overview:
An API URL is a specially formatted web address that sends information to WebReports to run a report automatically. It includes details like:
-
The report name
-
Connection name
-
Parameters (like date filters or export format)
-
Whether to use saved data
-
Whether to export the file, and what format to export in
Example API URL with SaveFile / ExportType:
https://webreports.bridgeworksllc.com/api/FinishedReport?report=WRExportType.vdm&
Connection=ABCLocal%20Web%20Reports&Type=Finished%20Report&UseSavedData=True&&SaveFile=True&ExportType=PDF
🔍 What to notice:
ExportType=PDFtells WebReports to export the result as a PDF fileThis value (
@WRExportTypeparameter behind the scenesIf the API URL does not include an ExportType or SaveFile setting:
@WRExportTypewill be empty and default to the first value in the parameters value collection list.
Video Tutorial:
Not Yet Available
How to Set Up the WRExportType Parameter in VDM.
1. Open Your View in VDM: Launch VDM.
Either:
-
-
Open an existing view you want to modify
-
Create a new view
-
2. Access the Parameters Setup: Click the “Parameters” button on the toolbar or from the menu.
3. Add a New Parameter: Click “Add Parameter.”
4. Name the Parameter: Set the parameter Name to WRExportType.
5. Add Export Format Options: In the Value / Collection List, enter the export formats (e.g., HTML, PDF, XLSX, RTF), one per line.
🔔 Note: The first value in the list is used as the default. Use the up/down arrows to change the order if needed.
6. Assign the Reserved Word Default Value: Set the Value property in the Default Value section to@WRExportType
7: Disable User Input (Optional but Recommended)
-
Set the Enabled property to
False.-
This hides the parameter in the user interface so users cannot manually enter or change its value.
-
It ensures the format is programmatically controlled based on VDM or API call behavior.
-
✅ Why this is useful: It prevents user confusion and guarantees consistent export formatting across different environments.
8: Save and Test the View: Once complete, save your view and test it by running the view in VDM and via WebReports using various export type scenarios:
-
-
No export type specified → should default to the first format.
-
API call with
ExportType=XLSX→ should export to Excel as expected.
-
Comments
0 comments
Article is closed for comments.