Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

A small problem of Excel format Modification in BeX5 report Development

Shulou Source: shulou.com Published: 2022-06-02 23:30:28 10月24日 Update

problem

Let's put it briefly. Some problems in programming seem simple, but wanting to do it and doing it are often two different things. Computer programming has this characteristic.

The report format based on BeX5 3.6 is currently being modified. Naturally, the report component is used. After switching to the report design state, it feels no problem to use the usual format of EXCEL-with thousand quantiles and RMB symbols, to get rid of the decimal problem. However, the currency format, digital format, accounting format and other formats have been used successively, and the running results are all unchanged; that is, they are all default with two decimal places, and the display form is a long string of numbers, which is quite ugly to read.

Look at the search in the official forum, there is no corresponding question and answer-it is very simple! The problem took only an hour-it couldn't be solved. This reminds me of the good name of "programmer" again.

Forget it, forget it! Install the new version of the software to the customer back, feel relieved! In my spare time, I think of that question in the morning. I don't think it reminds me of the problem of recording EXCEL macros-- the various formats of numbers can of course be easily observed through macro code. Then, the code corresponding to that format part of the xml file corresponding to a report component is analyzed. It is estimated that the external EXCEL macro code format may be common to it.

Test

Start the experiment. The macro recording code obtained in the external EXCEL is as follows:

Range ("A1:A7"). Select

Selection.NumberFormatLocal = "¥#, # # 0; ¥- #, # # 0"

Open the content file TradeNature.xml corresponding to the report component and observe the following:

Try to modify it as follows:

Result

Success! To tell you the truth, although EXCEL has been teaching for more than 10 years, its complex digital format, especially the background code format, has not been carefully analyzed. I don't know if the report component itself has BUG or something? Is it true that the number format will not be completely overwritten after repeated changes? In that case, it can be regarded as a BUG of the component. Next, let's test and analyze it in detail when you have time.

Tags: Formats problems codes numbers components analysis experiments reports decimals feelings files results programming observation complexity detail ugly and then in one breath Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia MySQL vpn Docker MariaDB