{"id":27813,"date":"2023-11-29T09:33:19","date_gmt":"2023-11-29T09:33:19","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sagex3\/?p=27813"},"modified":"2024-12-03T04:58:24","modified_gmt":"2024-12-03T04:58:24","slug":"how-to-restrict-the-text-based-on-date-condition-by-using-the-cdate-function-in-crystal-report","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2023\/11\/29\/how-to-restrict-the-text-based-on-date-condition-by-using-the-cdate-function-in-crystal-report\/","title":{"rendered":"How to restrict the text based on date condition by using the cdate() function  in Crystal report"},"content":{"rendered":"\n<p>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.<\/p>\n\n\n\n<p>In <a href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\" rel=\"noreferrer noopener\">Sage X3<\/a> 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.<\/p>\n\n\n\n<p>cdate() Function \u2013 The cdate function converts a valid date and time expression to type date , and returns the result.<\/p>\n\n\n\n<p><strong>To achieve the above requirement follow the below steps:<\/strong><\/p>\n\n\n\n<p><strong>Step 1:<\/strong> Open the sales invoice report in Crystal Reports and create a new formula named \u2018Declaration\u2019. This will make it easier to identify the formula when handling the declaration part. Please refer to the screenshot below for your reference.<\/p>\n\n\n\n<p><strong>New Stuff:<\/strong> <a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2023\/11\/29\/mass-update-price-list-using-a-tag-instead-of-updating-line-wise-through-standard-template\/\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2023\/11\/29\/mass-update-price-list-using-a-tag-instead-of-updating-line-wise-through-standard-template\/\" rel=\"noreferrer noopener\">Mass update price list using a tag instead of updating line wise through standard template.<\/a><\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2023\/11\/Formula-Field-1024x520.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2023\/11\/Formula-Field-1024x520.png\" alt=\"Formula Field\"><\/a><\/center>\n<font size=\"2\"><center>Formula Field<\/center><\/font>\n\n\n\n<p><strong>Step 2: <\/strong>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.<\/p>\n\n\n\n<p>For example, in the screenshot below, we\u2019ve created a formula by adding the hardcoded text \u2018Sample Text Declaration for Sales Invoice Report.\u2019 We\u2019ve also included the date condition : this declaration will print after October1,2023.Additionally there\u2019s another declaration, \u2018Sample Declaration for Sales Invoice Report before October1,2023,\u2019which will print before 01 oct 2023,as shown in below figure.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2023\/11\/Formula-with-cdate-function-1024x520.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2023\/11\/Formula-with-cdate-function-1024x520.png\" alt=\"Formula with cdate() function\"><\/a><\/center>\n<font size=\"2\"><center>Formula with cdate() function<\/center><\/font>\n\n\n\n<p><strong>Step 3:<\/strong> Save the formula and placed it in report where you require . Save the report and print .<\/p>\n\n\n\n<p><strong>Step 4:<\/strong> In below screenshot you will get desired output .<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2023\/11\/Declaration-for-date-before-October12023-1024x520.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2023\/11\/Declaration-for-date-before-October12023-1024x520.png\" alt=\"Declaration for date before October1,2023\"><\/a><\/center>\n<font size=\"2\"><center>Declaration for date before October1,2023<\/center><\/font>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2023\/11\/Declaration-for-date-after-October-12023-1024x520.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2023\/11\/Declaration-for-date-after-October-12023-1024x520.png\" alt=\"Declaration for date after October 1,2023\"><\/a><\/center>\n<font size=\"2\"><center>Declaration for date after October 1,2023<\/center><\/font>\n\n\n\n<p>Additionally, you can supress the dummy date that may be generated in the report for any date field by using the cDate function.<\/p>\n\n\n\n<p>To achieve this,right \u2013 click on the date field, select the \u2018Format Field\u2019 option in the \u2018Commmon\u2019 tab, and add the condition to supress the field. For reference, please check the below screenshot.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2023\/11\/Supress-condition-for-dummy-date-1024x520.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2023\/11\/Supress-condition-for-dummy-date-1024x520.png\" alt=\"Suppress condition for dummy date\"><\/a><\/center>\n<font size=\"2\"><center>Suppress condition for dummy date<\/center><\/font>\n\n\n\n<p>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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>About Us<\/strong><\/h2>\n\n\n\n<p>Greytrix \u2013 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.<\/p>\n\n\n\n<p id=\"block-28013e99-0882-44c6-b705-7b16c85053b2\">Greytrix&nbsp;has some unique integration solutions developed for&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-crm\/\">Sage CRM<\/a>&nbsp;with Sage ERPs&nbsp;namely&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-x3-erp\/\">Sage X3<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-intacct\/\">Sage Intacct<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-100-erp\/\">Sage 100<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-500-erp\/\">Sage 500<\/a>,&nbsp;and&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-300-erp\/\">Sage 300<\/a>. We also offer best-in-class&nbsp;Sage ERP&nbsp;and&nbsp;Sage CRM&nbsp;customization and development services&nbsp;to&nbsp;Business&nbsp;Partners,&nbsp;End&nbsp;Users, and Sage PSG worldwide. Greytrix&nbsp;helps in&nbsp;the migration of Sage CRM from&nbsp;Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer. Our Sage CRM Product Suite includes&nbsp;addons like&nbsp;&nbsp;Greytrix Business Manager,&nbsp;Sage CRM Project Manager,&nbsp;Sage CRM Resource Planner,&nbsp;Sage CRM Contract Manager,&nbsp;Sage CRM Event Manager,&nbsp;Sage CRM Budget Planner,&nbsp;Gmail Integration,&nbsp;Sage CRM Mobile Service Signature,&nbsp;Sage CRM CTI Framework.<\/p>\n\n\n\n<p id=\"block-4bc42a09-fb13-4598-8137-ce5f7b91ce28\">Greytrix is a recognized&nbsp;Sage Champion Partner&nbsp;for GUMU&#x2122; Sage X3 \u2013 Sage CRM integration listed on&nbsp;<a href=\"https:\/\/www.sage.com\/marketplace\/asb_ListingDetail?listingId=a1h24000007PC3aAAG\" target=\"_blank\" rel=\"noreferrer noopener\">Sage Marketplace<\/a>&nbsp;and Sage CRM \u2013 Sage Intacct integration listed on&nbsp;<a href=\"https:\/\/marketplace.intacct.com\/MPListing?lid=a2D0H000007kiHyUAI\" target=\"_blank\" rel=\"noreferrer noopener\">Sage Intacct Marketplace<\/a>. The&nbsp;<a href=\"https:\/\/www.greytrix.com\/gumu\/\" target=\"_blank\" rel=\"noreferrer noopener\">GUMU&#x2122; Cloud framework<\/a>&nbsp;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.<\/p>\n\n\n\n<p id=\"block-76376301-1c3e-4250-8a09-727595a606f0\">For more information on our integration solutions, please contact us at&nbsp;<a href=\"mailto:sage@greytrix.com\">sage@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2023\/11\/29\/how-to-restrict-the-text-based-on-date-condition-by-using-the-cdate-function-in-crystal-report\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,8],"tags":[461,504,801,3517,863,1655,2538],"class_list":["post-27813","post","type-post","status-publish","format-standard","hentry","category-integration","category-sage-erp-x3","tag-crystal-report","tag-date","tag-fields","tag-formula","tag-functions","tag-reports","tag-sales-invoice"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/27813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=27813"}],"version-history":[{"count":6,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/27813\/revisions"}],"predecessor-version":[{"id":27819,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/27813\/revisions\/27819"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=27813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=27813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=27813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}