Sage X3 is a powerful ERP system that helps businesses manage their operations efficiently. One of its key features is its robust reporting capabilities, often powered by Crystal Reports. Crystal Reports allows users to create dynamic, customizable reports to extract meaningful insights from Sage X3 data. A particularly useful feature in Crystal Reports is shared variables, which can significantly enhance the flexibility and functionality of Sage X3 reports. In this blog, we’ll explore the role of shared variables in Crystal Reports and how they can be leveraged to improve Sage X3 reporting.
Recently, we received a requirement from one of our clients to include the Invoicing Element Tax within the main tax summary section located in the footer on the Sales Invoice report.
Typically, to avoid duplication in the main report, we handle Invoicing Elements separately by placing them in a sub-report. In this case, we calculated the Invoicing Element Tax within the sub-report. To include this calculated tax value in the main report’s tax summary at the footer, we used a shared variable. By leveraging the Shared Variable feature in Crystal Reports, we were able to pass the tax value from the sub-report to the main report, ensuring accurate and consolidated tax reporting without duplication.
In Crystal Reports, shared variables serve as a bridge between sub-reports and the main report when standard linking or parameter passing isn’t sufficient to transfer data.
Crystal Reports has three types of variable scope:
- Local – available only within the formula
- Global – accessible across all formulas in the same report
- Shared – accessible across sub-reports and main reports
Step 1: Calculate the Invoicing Element Taxes in a formula field using Shared Variables within the sub-report. We are using Shared Variables here because we need to pass the calculated values from the sub-report to the main report, allowing us to include them in the total tax section of the main report. Refer to the screen below for your reference.
New Stuff: From Generic to Geared: Making Sage X3 Work for Oil & Gas

Step 02: Place the formula (created in Step 1) in the Report Footer section of the sub-report and suppress the section, as we do not want to display the value directly in the sub-report. Since Crystal Reports processes data from top to bottom (header to footer), placing the formula in the footer ensures that if there are multiple detail lines, the values will be summarized correctly at the end of the sub-report. Refer to the screen below for your reference.

Step 03: In the main report, create a new formula field and assign the value of the Shared Variable (declared in the sub-report) to it.

Step 04: In the final step, create a new formula field in the main report to calculate the total tax. In this formula, add the main tax values along with the Shared Variable that holds the Invoicing Element Tax value. Place this formula in the Report Footer section of the main report, as this is where the tax summary calculation should appear.
Refer to the screenshot below for your reference.

In the below screenshot you will get desired output –


By implementing this solution, the report now correctly displayed the Invoicing Element Tax from the sub-report in the summary section of the main report, giving users a complete and accurate view of tax details without navigating between sections. Whether you’re calculating running totals, aggregating data conditionally, or passing values between sub-reports, shared variables can streamline your reporting process and elevate the quality of your Sage X3 reports.
About Us
Greytrix – a globally recognized and one of the oldest Sage Development Partners is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience and expertise, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation competence.
Greytrix has some unique integration solutions developed for Sage CRM with Sage ERPs namely Sage X3, Sage Intacct, Sage 100, Sage 500, and Sage 300. We also offer best-in-class Sage ERP and Sage CRM customization and development services to Business Partners, End Users, and Sage PSG worldwide. Greytrix helps in the migration of Sage CRM from Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer. Our Sage CRM Product Suite includes addons like Greytrix Business Manager, Sage CRM Project Manager, Sage CRM Resource Planner, Sage CRM Contract Manager, Sage CRM Event Manager, Sage CRM Budget Planner, Gmail Integration, Sage CRM Mobile Service Signature, Sage CRM CTI Framework.
Greytrix is a recognized Sage Champion Partner for GUMU™ Sage X3 – Sage CRM integration listed on Sage Marketplace and Sage CRM – Sage Intacct integration listed on Sage Intacct Marketplace. The GUMU™ Cloud framework by Greytrix forms the backbone of cloud integrations that are managed in real-time for the processing and execution of application programs at the click of a button.
For more information on our integration solutions, please contact us at sage@greytrix.com. We will be glad to assist you.