How to print comments data longer than 250 characters on Crystal Reports at once in Sage X3

By | January 30, 2025

Sage X3 is enterprise resource planning (ERP) product which help organization to manage all the operation of organization and database into a single software solution. Sage X3 contains list of modules like sales, purchase, inventory, project, financial and many more.

At times, users encounter an issue where they input comments in the comment section exceeding 250 characters, but the full value does not get printed in the report because Crystal Reports only accepts 250 characters for the RTF text

We have taken a sales invoice screen as an example, where a user entered comments, as shown in the picture below

New Stuff: Fixing Date Defaults: Date field default year 1930 Instead of 2030

Fig01 : Sales invoice screen
Fig01 : Sales invoice screen

The output is as shown in the below picture :

Fig02 : Sales invoice report
Fig02 : Sales invoice report

To overcome this issue, we have found a solution that allows the full data present on the screen to be printed in the reports as well

To print the full comment data in the report, there is no built-in function in Crystal Reports to fulfill this requirement. Therefore, we created a new query-based sub-report where we used the SUBSTRING and REPLACE functions, as shown in the picture below. The CLOB_0 field in the ACLOB table contains the comment data in RTF text format. We replaced the spaces (“ ”) with tildes (“~”) and used the SUBSTRING function to trim the string into 250-character segments.

Fig03 : Sub report SQL query
Fig03 : Sub report SQL query

Additionally, in Crystal Reports, we created a formula and placed it in the report to replace the tildes (“~”) with spaces (“ ”) and sum all the command fields used in the SQL query, as shown in the picture below:

Fig04 : Sub report Formula
Fig04 : Sub report Formula

After completing all the steps, we get an output where the comments are the same as those entered in the Sales Invoice screen’s comments field as shown in the below picture :

Fig05 : Sales invoice report
Fig05 : Sales invoice report

By following the above steps, we can print comments data longer than 250 characters on Crystal Reports at once in Sage X3.

[about_us_blog_common]