Successfully!

Error!

Scroll message by HTML

  • Last update:  2021-04-15
  • I. Overview

    1. Expected effect

    On some large-scale display screens, the current static graphic display can no longer meet the market demand. Sometimes it may be necessary to achieve some dynamic graphic display effects, such as the marquee scrolling effect. Then how to achieve it through the fan soft report? The expected effect is as follows:

    1) Vertical scrolling:

    1.gif

    2) Horizontal scrolling:

    2.gif

    3) Irregular horizontal scrolling:

    3.gif

    Note: In the dashboard, you can also directly use the official plugin scrolling message.


    2. Realization ideas

    It can be achieved through the pure HTML display effect of the cell.

    II. Example: Vertical scrolling

    1. Prepare data

    Create a new normal report, create a new built-in dataset Embedded1, add only one field, and customize some text data, as shown in the following figure:

    4.png


    2. Design report

    Drag the information field in the dataset to cell D4 and set the expansion direction to not expand. The design table style is shown in the figure below:

    5.png

    Right-click on column D to hide it.

    6.png



    3. Cell insert formula

    1) From top to bottom, scroll horizontally to the left

    Select cell B4, right-click and select "Cell Element> Insert Formula", the formula is as follows:

    "<marquee id='affiche' align='left' behavior='scroll' bgcolor='#ffffff' direction='up' height='250' 
    width='400' hspace='0' vspace='2' loop='-1' scrollamount='10' scrolldelay='100' onMouseOut='this.start()' 
    onMouseOver='this.stop()'>" + REPLACE(D4, ",", "<br /><br />") + "</marquee>"

    Note: The formula is for splicing the content of cell D4 into the HTML statement. REPLACE(D4, ",", "<br/><br/>") means to replace "," in the contents of cell D4 with "<br/><br/>",<br /><br /> means "line break" in HTML.

    2) Scroll from bottom to top, horizontally centered

    Just modify the above formula to:

    "<marquee id='affiche' style='text-align:center;' behavior='scroll' behavior='scroll' bgcolor='#ffffff' 
    direction='up' height='250' width='400' hspace='0' vspace='2' loop='-1' scrollamount='10' scrolldelay='100' 
    onMouseOut='this.start()' onMouseOver='this.stop()'>" + REPLACE(D4, ",", "<br /><br />") + "</marquee>"
    3) Formula parameter explanation

     Parameter
    Meaning  
    directionIndicates the direction of scrolling, the value can be left, right, up, down and the default is left
    behaviorIndicates the way of scrolling, the value can be scroll (continuous scrolling) slide (slide once) alternate (scrolling back and forth)
    loopIndicates the number of loops, the value is a positive integer, loop='-1' means an infinite loop
    scrollamountRepresents the movement speed, the value is a positive integer, the default is 6
    scrolldelayRepresents the pause time, the value is a positive integer, the default is 0, the unit is milliseconds
    alignIndicates the vertical alignment of the element, the value can be top, middle, bottom defaults to middle
    bgcolorRepresents the background color of the moving area, the value is hexadecimal RGB color, the default is white
    heightIndicates the height of the motion area, the value is a positive integer (the unit is pixels) or a percentage, the default width=100%
    widthIndicates the width of the motion area, the value is a positive integer (in pixels) or a percentage, the default height is the height of the element in the label
    hspaceIndicates the horizontal distance between the element and the boundary of the region, the value is a positive integer, and the unit is pixel
    vspaceIndicates the vertical distance between the element and the boundary of the region, the value is a positive integer, and the unit is pixel

    onmouseover=this.stop()

    Indicates that scrolling stops when the mouse is over the area
    onmouseout=this.start()Indicates to continue scrolling when the mouse is moved away
    style

    Means adding style

    text-align:center; means that the text is centered horizontally

    display:table-cell; means that the text is centered vertically

    vertical-align:middle; Refers to the label element to be presented in the form of a table cell


    4. Set cell attributes

    1) Display by HTML

    Select cell B4, and set the display content of "Cell Attributes> Other" to "Display by HTML", as shown in the figure below:

    7.png


    2) Cancel the automatic adjustment of cell height

    Select cells C4 and D4, right-click to select other, and select "No Automatic Adjustment".

    8.png



    5. Effect preview

    Save the report and click "Pagination Preview". The effect is the same as the vertical scrolling effect in section I.1.

    Note: Both the App and HTML5 end support scrolling effects, but do not support the pause and resume scrolling effects by mouse movement.


    III. Example: Horizontal scrolling

    1. Prepare data

    Create a new noemal report, create a new built-in dataset Embedded1, add only one field, and customize some text data.


    2. Design report

    Drag the data column to cell A1 and set the expansion direction to "no expansion", right-click column A to hide it, the table style is as shown in the figure below:

    9.png


    3. Cell insert formula

    Insert the formula in cell B2:

    "<marquee id='affiche' style='text-align:center;display:table-cell;vertical-align:middle;' behavior='scroll' 
    bgcolor='#ffffff' direction='left' height='100%' width='500%' hspace='0' vspace='2' loop='-1' scrollamount='10'  
    scrolldelay='100' onMouseOut='this.start()' onMouseOver='this.stop()'>" + REPLACE(A1, ",", " ") + "</marquee>"

    Note: Please refer to section II.3.3) for the explanation of formula parameters.


    4. Set cell attributes

    Select cell B2, set "Cell Attributes> Other", select "No Automatic Adjustment" under "Basic", and set the Display Content to "Display by HTML", as shown in the following figure:

    10.png


    5. Effect preview

    Save the report, click "Pagination Preview", you can see that the text scrolls from right to left, vertically centered, and the effect is consistent with the horizontal scrolling effect of section I.1.

    Note: Both the App and HTML5 end support scrolling effects, but do not support the pause and resume scrolling effects by mouse movement.


    IV. Example: Irregular horizontal scrolling

    1. Prepare data

    Create a new normal report, create a new built-in dataset Embedded1, add only one field, and customize some text data, as shown in the following figure:

    11.png


    2. Design report

    Drag the data column into cell A3 and set its expansion direction to "Vertical expansion", the table style is as shown in the figure below:

    12.png

    Finally, column A is hidden.


    3. Cell insert formula

    Insert the formula in cell B3:

    "<marquee id='affiche' align='left' behavior='scroll' bgcolor='#ffffff' direction='left' height='250' width='400' 
    hspace='0' vspace='2' loop='-1' scrollamount='"+(rand()*(11-1)+1)+"' scrolldelay='100' onMouseOut='this.start()' 
    onMouseOver='this.stop()'>" + REPLACE(A3, ",", "<br />") + "</marquee>"

    Note: Please refer to section II.3.3) for the explanation of formula parameters.

    Among them, scrollamount='"+(rand()*(11-1)+1)+"' means to generate a random number between 11 and 1 as the value of the movement speed.


    4. Set cell attributes

    Select cell B3, set "Cell Attributes> Other", select "No Automatic Adjustment" under "Basic", and set the Display Content to "Display by HTML", as shown in the figure below:

    13.png


    5. Effect preview

    Save the report and click "Pagination Preview". The effect is the same as the irregular horizontal scrolling effect in section I.1.

    Note: Both the App and HTML5 end support scrolling effects, but do not support the pause and resume scrolling effects by mouse movement.


    V. Template download

     Refer to the completed templates:

    %FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\BasicApplication\Vertical_scroll.cpt

    %FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\BasicApplication\Horizontal_scroll  .cpt

    %FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\BasicApplication\Irregular_scroll.cpt

    Click to download:

    Horizontal_scroll  .cpt

    Irregular_scroll.cpt

    Vertical_scroll.cpt


    Attachment List


    Theme: Report Application
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback