Crystal report is an application used to create custom reports from a various of data sources. It includes major features such as formulas, cross-tab reports, sub-reports , special fields and conditional formatting etc.
In Sage X3 recently we had an requirement that one of our client wants the hardcoded declaration based on supplier type and date conditions in sales invoice print report. We can achieve this requirement by using the cdate() function in crystal report formula fields.
cdate() Function – The cdate function converts a valid date and time expression to type date , and returns the result.
To achieve the above requirement follow the below steps:
Step 1: Open the sales invoice report in Crystal Reports and create a new formula named ‘Declaration’. This will make it easier to identify the formula when handling the declaration part. Please refer to the screenshot below for your reference.
New Stuff: Mass update price list using a tag instead of updating line wise through standard template.

Step 2: Create a formula in the Formula Wizard based on your date condition and other criteria. Then, add the text that you want to include in the report.
For example, in the screenshot below, we’ve created a formula by adding the hardcoded text ‘Sample Text Declaration for Sales Invoice Report.’ We’ve also included the date condition : this declaration will print after October1,2023.Additionally there’s another declaration, ‘Sample Declaration for Sales Invoice Report before October1,2023,’which will print before 01 oct 2023,as shown in below figure.

Step 3: Save the formula and placed it in report where you require . Save the report and print .
Step 4: In below screenshot you will get desired output .


Additionally, you can supress the dummy date that may be generated in the report for any date field by using the cDate function.
To achieve this,right – click on the date field, select the ‘Format Field’ option in the ‘Commmon’ tab, and add the condition to supress the field. For reference, please check the below screenshot.

In this way, we can restrict the text based on date condition by using the cdate() function in Sales invoice report by following simple steps in crystal report as mentioned in this blog.
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.