Crystal Reports displays #### in numeric fields after upgrade

被刻印的时光 ゝ 提交于 2019-12-13 02:22:43

问题


I upgraded a Visual Studio solution containing Crystal Report files. Since the upgrade, the reports are displaying cross hatches (also called number signs: #####) when fields are too narrow to display their values. It was not doing that before. Is there any easy solution?

I have 9 reports, and although I tested them all, and fixed the width of the fields that appeared to be too narrow, when I use different data sets, I always find new cases where the field is too narrow to display the value.

What I have found out is that most of the time, only a few pixels are missing. On the old reports, I can even see that some numbers are cut a bit on the edge, but it does not prevent to read the values. The new version of Crystal Reports replaces those values by #####.

I guess I have two solutions: Enlarge all the fields by a few pixels or reduce the font size. I am not sure though if there is a way to do this globally, or if I have to do this by hand for every field.

Is there an easy way to tell Crytsal Reports, in such field, I want to be able to display let's say 5 digits using Courrier New 10 points?

I using Visual Studio 2012, .Net 4.5 and SAP Crystal Reports, developer version for Microsoft Visual Studio SP5. The old reports were from the time when Crystal Reports was embedded in VS.


回答1:


If you can't format the fields to accommodate the largest values from the database, then you don't have many good options without moving to a non-printable-format. These two things might be useful to you:

  1. Enable the clipping of those fields so that they no longer show the '###'. You can do this by right-clicking the number fields having this issue, selecting "Format Field", then go to the "Number" tab, then click "Customize". There should be a check box that reads "Allow Field Clipping". In my mind, this is pretty dangerous as values can appear differently than their true numerical values.

  2. Set the fields to grow when the values are larger than their field size on the canvas. This will extend the fields down the page (I don't believe there is a way to do this horizontally) when necessary. You can access this option by right-clicking the fields, selecting "Format Field", then go to the "Common" tab and select "Can Grow". Note that this doesn't work for numeric fields so you will have to convert it to a string first.

EDIT: Now that I think about it, there is a way to extend a field horizontally, but it's slightly more difficult to pull off and will require calculating and passing the desired width via a formula. You can access this formula by right-clicking those fields, selecting "Size and Position" and clicking the formula button next to "Width".




回答2:


Whenever I come across #### problem while displaying data to field, I just simply increase width of that crystal reports field



来源:https://stackoverflow.com/questions/18876403/crystal-reports-displays-in-numeric-fields-after-upgrade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!