Cell content wrap display

  • Last update:  2021-05-10
  • I. Overview

    1. Problem description

    When the FineReport cell displays the content, it cannot wrap display. If you want the cell to wrap display when displaying data on the Web, how to achieve it?

    1.png



    2. Solutions

    FineReport provides the \n operator to wrap display the cell content.

    This article will briefly explain the two ways of using \n and a string.

    II. Use \n to wrap

    1. Direct input data  

    Create a new template, enter A\nB in the cell.

    \n is an escape character, which means wrap.

    Save the template, click Pagination Preview, you can see that it is displayed in a new line, as shown in the following figure:

    1.png


    2. Create a dataset

    If the data comes from a dataset and needs to wrap display, then the data in the dataset needs to store the character \n, as shown in the following figure:

    2.png

    III. \n display as a string

    When FineReport displays the report on the Web, it will parse all the \n in the cell as wrap by default.

    What if the user does not want to wrap the content of the cell, but wants to display \n as a string on the Web?


    1. Direct input data

    If you want to display \n as a string when entering data directly in a cell, instead of the meaning of wrap, just enter \\\\n instead of \n, as shown in the following figure:

    \\\\ means two backslashes \\, which are escape characters \, and the following n is independent. This will output a string like \n instead of wrap.

    3.png


    2. Create a dataset

    If the data comes from a dataset, you can set the Display Value of the cell in Cell Element> Advanced.

    Replace \n in the dataset with \\\\n, the formula is replace($$$,"\n","\\\\n"), as shown in the figure below:

    6.png

    Attachment List


    Theme: Report Application
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy