insightsengineering / teal.reporter

Create and preview reports with Shiny modules
https://insightsengineering.github.io/teal.reporter/
Other
8 stars 8 forks source link

[BUG]: Report Downloaded is in mess with too many columns #274

Open DucleHan opened 7 months ago

DucleHan commented 7 months ago

What happened?

If we simply add more columns in table and dowaload it. Format will be in mess. I pasted zip file below where my App R code ‘OutputTest.R’ is also included. Here I used siteid as treatment variables.

image report_231123110458.zip

sessionInfo()

No response

Relevant log output

No response

Code of Conduct

Contribution Guidelines

Security Policy

Melkiades commented 1 month ago

@kartikeyakirar, Could you please take a look at this? It is related to teal reports. Thanks!!!

kartikeyakirar commented 1 month ago

The latest version of teal.reporter does not have the issue of overlapping content. However, the table shown in the example is too wide to be adjusted within the PDF. As a result, the issue of not displaying the entire table still persists. This requires pagination and breaking the table to fit into the available spaces, similar to how it is done when the PDF of the table is downloaded directly from the widget with pagination. CC @donyunardi @Melkiades Transferring this issue to teal.reporter. image

Melkiades commented 1 month ago

I am quite sure that this issue still belongs to teal.reporter. export_as_pdf should have somewhat an idea of what is the viewportwidth and it should complain. Can you link the PR with the changes you mentioned?

kartikeyakirar commented 1 month ago

Yes, I have already transferred it to teal.reporter. I can produce the above image with code attached to the issue, with the current version of teal.reporter and overlapping was not observed only a complete view of the table is not available because of the too many columns.

I think the latest changes due to https://github.com/insightsengineering/teal.reporter/pull/265 might have fixed the overlapping problem. But earlier, I was not able to see the overlapping issue. But I did not check with these many columns before.

donyunardi commented 1 month ago

@kartikeyakirar Is this behavior only for PDF output or does it behaves the same for other outputs?

DucleHan commented 1 month ago

Not only pdf but all output files. Thanks for your attention in advance!

Melkiades commented 1 month ago

Not only pdf but all output files. Thanks for your attention in advance!

@DucleHan remember to trim the email if you use emails ;)

kartikeyakirar commented 1 month ago

Is this behavior only for PDF output or does it behaves the same for other outputs?

all formats except HTML have space limitation issues. This problem persists. The tables discussed in the issue are very large, for example.

Adverse Events Summary

BRA-1 (N=8)

BRA-11 (N=8)

BRA-12 (N=1)

BRA-13 (N=1)

BRA-14 (N=2)

BRA-15 (N=1)

BRA-2 (N=2)

BRA-3 (N=2)

BRA-4 (N=2)

BRA-5 (N=1)

BRA-6 (N=1)

BRA-7 (N=1)

CAN-1 (N=2)

CAN-11 (N=2)

CAN-14 (N=1)

CAN-4 (N=2)

CAN-5 (N=1)

CHN-1 (N=57)

CHN-10 (N=1)

CHN-11 (N=48)

CHN-12 (N=8)

CHN-13 (N=8)

CHN-14 (N=9)

CHN-15 (N=6)

CHN-16 (N=6)

CHN-17 (N=11)

CHN-18 (N=3)

CHN-2 (N=16)

CHN-3 (N=11)

CHN-4 (N=9)

CHN-5 (N=11)

CHN-6 (N=4)

CHN-7 (N=6)

CHN-8 (N=2)

CHN-9 (N=3)

GBR-1 (N=3)

GBR-11 (N=2)

GBR-13 (N=1)

GBR-15 (N=1)

GBR-17 (N=1)

GBR-6 (N=1)

JPN-1 (N=5)

JPN-11 (N=3)

JPN-12 (N=1)

JPN-14 (N=1)

JPN-17 (N=2)

JPN-18 (N=1)

JPN-2 (N=1)

JPN-3 (N=1)

JPN-5 (N=2)

JPN-6 (N=1)

NGA-1 (N=10)

NGA-11 (N=6)

NGA-12 (N=2)

NGA-17 (N=2)

NGA-2 (N=2)

NGA-4 (N=2)

NGA-5 (N=1)

NGA-6 (N=1)

PAK-1 (N=10)

PAK-11 (N=9)

PAK-12 (N=2)

PAK-13 (N=2)

PAK-14 (N=1)

PAK-15 (N=1)

PAK-2 (N=3)

PAK-4 (N=2)

PAK-5 (N=1)

RUS-1 (N=1)

RUS-11 (N=4)

RUS-12 (N=1)

RUS-13 (N=1)

RUS-14 (N=1)

RUS-16 (N=2)

RUS-18 (N=1)

RUS-2 (N=1)

RUS-3 (N=1)

RUS-4 (N=3)

RUS-5 (N=1)

RUS-6 (N=1)

RUS-7 (N=1)

USA-1 (N=10)

USA-11 (N=9)

USA-12 (N=6)

USA-14 (N=1)

USA-15 (N=2)

USA-17 (N=2)

USA-19 (N=1)

USA-2 (N=1)

USA-3 (N=2)

USA-4 (N=2)

USA-5 (N=1)

USA-6 (N=1)

USA-8 (N=1)

USA-9 (N=1)

All Patients (N=400)

Total number of patients with at least one adverse event

7 (87.5%)

6 (75.0%)

1 (100%)

1 (100%)

2 (100%)

1 (100%)

2 (100%)

1 (50.0%)

2 (100%)

1 (100%)

1 (100%)

1 (100%)

2 (100%)

2 (100%)

1 (100%)

2 (100%)

0

52 (91.2%)

0

45 (93.8%)

8 (100%)

8 (100%)

9 (100%)

6 (100%)

4 (66.7%)

8 (72.7%)

3 (100%)

16 (100%)

10 (90.9%)

8 (88.9%)

10 (90.9%)

3 (75.0%)

6 (100%)

2 (100%)

3 (100%)

3 (100%)

2 (100%)

1 (100%)

1 (100%)

1 (100%)

1 (100%)

4 (80.0%)

3 (100%)

1 (100%)

1 (100%)

1 (50.0%)

1 (100%)

0

1 (100%)

2 (100%)

1 (100%)

9 (90.0%)

6 (100%)

2 (100%)

1 (50.0%)

2 (100%)

2 (100%)

1 (100%)

0

10 (100%)

8 (88.9%)

1 (50.0%)

2 (100%)

1 (100%)

1 (100%)

3 (100%)

0

1 (100%)

1 (100%)

4 (100%)

0

1 (100%)

1 (100%)

2 (100%)

1 (100%)

1 (100%)

1 (100%)

3 (100%)

1 (100%)

1 (100%)

1 (100%)

10 (100%)

9 (100%)

5 (83.3%)

1 (100%)

2 (100%)

2 (100%)

1 (100%)

1 (100%)

2 (100%)

2 (100%)

1 (100%)

1 (100%)

1 (100%)

1 (100%)

365 (91.2%)

Total AEs

40

33

10

6

13

4

13

4

15

8

3

7

16

12

4

11

0

278

0

261

29

49

51

35

25

43

14

84

36

36

52

15

27

12

14

11

7

2

1

7

3

26

15

5

3

5

1

0

7

12

1

59

33

7

2

7

13

6

0

47

37

9

6

3

8

18

0

9

3

19

0

3

3

11

1

9

4

18

7

9

10

59

45

32

3

8

4

8

8

13

10

5

1

8

3

1934

Total number of deaths

3 (37.5%)

2 (25%)

0

0

1 (50%)

1 (100%)

0

0

0

0

0

0

1 (50%)

1 (50%)

0

0

0

9 (15.8%)

1 (100%)

6 (12.5%)

2 (25%)

1 (12.5%)

1 (11.1%)

3 (50%)

1 (16.7%)

2 (18.2%)

1 (33.3%)

4 (25%)

1 (9.1%)

0

2 (18.2%)

2 (50%)

1 (16.7%)

0

1 (33.3%)

1 (33.3%)

0

0

0

1 (100%)

0

0

0

0

0

2 (100%)

0

0

0

0

0

2 (20%)

1 (16.7%)

1 (50%)

0

0

1 (50%)

0

0

2 (20%)

0

0

0

0

0

0

1 (50%)

0

1 (100%)

2 (50%)

0

0

0

1 (50%)

0

1 (100%)

0

0

0

1 (100%)

0

1 (10%)

3 (33.3%)

0

0

0

0

0

0

0

1 (50%)

0

0

0

0

70 (17.5%)

Total number of patients withdrawn from study due to an AE

0

0

0

0

0

0

0

1 (50%)

0

0

0

0

0

0

0

0

0

3 (5.3%)

0

2 (4.2%)

1 (12.5%)

0

0

0

0

1 (9.1%)

1 (33.3%)

0

0

0

1 (9.1%)

0

0

0

0

0

1 (50%)

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1 (10%)

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1 (100%)

1 (10%)

0

0

0

0

0

0

0

0

0

0

0

0

0

14 (3.5%)

Total number of patients with at least one

Serious AE

7 (87.5%)

5 (62.5%)

1 (100%)

1 (100%)

1 (50.0%)

1 (100%)

2 (100%)

1 (50.0%)

2 (100%)

1 (100%)

0

1 (100%)

2 (100%)

1 (50.0%)

1 (100%)

2 (100%)

0

43 (75.4%)

0

39 (81.2%)

6 (75.0%)

7 (87.5%)

8 (88.9%)

4 (66.7%)

3 (50.0%)

6 (54.5%)

3 (100%)

16 (100%)

6 (54.5%)

6 (66.7%)

8 (72.7%)

3 (75.0%)

5 (83.3%)

2 (100%)

3 (100%)

1 (33.3%)

2 (100%)

0

0

1 (100%)

1 (100%)

4 (80.0%)

2 (66.7%)

1 (100%)

1 (100%)

1 (50.0%)

1 (100%)

0

1 (100%)

2 (100%)

1 (100%)

9 (90.0%)

6 (100%)

1 (50.0%)

0

2 (100%)

1 (50.0%)

1 (100%)

0

8 (80.0%)

6 (66.7%)

1 (50.0%)

2 (100%)

1 (100%)

1 (100%)

3 (100%)

0

1 (100%)

1 (100%)

3 (75.0%)

0

1 (100%)

1 (100%)

2 (100%)

0

1 (100%)

1 (100%)

1 (33.3%)

1 (100%)

1 (100%)

1 (100%)

9 (90.0%)

6 (66.7%)

4 (66.7%)

1 (100%)

1 (50.0%)

1 (50.0%)

1 (100%)

1 (100%)

2 (100%)

2 (100%)

1 (100%)

0

1 (100%)

1 (100%)

304 (76.0%)

Total number of unique preferred terms which are

Serious AE

4

4

2

1

2

2

2

1

4

2

0

2

3

2

1

3

0

4

0

4

4

4

4

4

4

4

3

4

4

4

4

3

4

3

4

3

2

0

0

3

1

4

4

2

1

2

1

0

2

3

1

4

4

1

0

3

2

1

0

4

3

2

2

2

1

4

0

2

2

2

0

1

1

2

0

1

2

2

3

2

3

4

4

4

1

1

2

2

1

3

3

2

0

2

1

4

Total number of adverse events which are

Serious AE

19

10

2

2

6

2

4

1

6

3

0

2

8

3

1

5

0

109

0

103

14

19

24

9

13

19

5

40

13

18

25

7

13

7

11

4

2

0

0

5

1

12

7

2

1

2

1

0

5

3

1

26

17

1

0

3

5

1

0

17

10

2

2

2

3

14

0

2

2

5

0

2

1

3

0

2

3

3

3

3

4

25

20

12

1

2

2

3

1

4

4

2

0

4

1

786

Medical concepts: number of patients with

C.1.1.1.3/B.2.2.3.1 AESI (BROAD)

4 (50.0%)

3 (37.5%)

1 (100%)

1 (100%)

2 (100%)

0

2 (100%)

1 (50.0%)

1 (50.0%)

0

1 (100%)

1 (100%)

1 (50.0%)

1 (50.0%)

1 (100%)

1 (50.0%)

0

33 (57.9%)

0

28 (58.3%)

6 (75.0%)

6 (75.0%)

6 (66.7%)

3 (50.0%)

3 (50.0%)

3 (27.3%)

1 (33.3%)

10 (62.5%)

6 (54.5%)

5 (55.6%)

7 (63.6%)

3 (75.0%)

3 (50.0%)

2 (100%)

1 (33.3%)

0

1 (50.0%)

0

0

1 (100%)

1 (100%)

2 (40.0%)

1 (33.3%)

1 (100%)

1 (100%)

0

0

0

1 (100%)

1 (50.0%)

1 (100%)

6 (60.0%)

4 (66.7%)

1 (50.0%)

0

1 (50.0%)

1 (50.0%)

1 (100%)

0

7 (70.0%)

4 (44.4%)

0

1 (50.0%)

1 (100%)

1 (100%)

2 (66.7%)

0

1 (100%)

1 (100%)

3 (75.0%)

0

0

0

1 (50.0%)

0

1 (100%)

1 (100%)

2 (66.7%)

1 (100%)

1 (100%)

1 (100%)

6 (60.0%)

6 (66.7%)

5 (83.3%)

1 (100%)

1 (50.0%)

1 (50.0%)

0

1 (100%)

1 (50.0%)

1 (50.0%)

1 (100%)

0

1 (100%)

0

226 (56.5%)

Medical concepts: number of unique preferred terms which are part of

C.1.1.1.3/B.2.2.3.1 AESI (BROAD)

2

2

2

1

2

0

1

1

2

0

1

1

1

1

1

1

0

2

0

2

2

2

2

2

2

2

1

2

2

2

2

2

2

2

1

0

2

0

0

1

1

2

1

1

1

0

0

0

2

1

1

2

2

1

0

1

1

1

0

2

2

0

1

1

1

1

0

1

1

2

0

0

0

1

0

1

1

2

1

2

1

2

2

2

1

2

1

0

1

1

1

1

0

2

0

2

Medical concepts: number of adverse events which are part of

C.1.1.1.3/B.2.2.3.1 AESI (BROAD)

6

4

2

1

2

0

2

1

2

0

1

1

2

1

1

2

0

67

0

52

6

7

9

4

8

3

1

21

7

11

10

8

5

5

4

0

2

0

0

3

1

8

2

1

1

0

0

0

4

1

1

10

9

1

0

1

2

3

0

11

6

0

1

1

3

2

0

1

1

4

0

0

0

1

0

3

1

5

1

3

1

12

10

11

1

4

1

0

2

1

1

1

0

4

0

399

Melkiades commented 1 month ago

@kartikeyakirar it is possible to use pagination to get different matrix_forms that will fit the page

kartikeyakirar commented 1 month ago

The current implementation for pagination works in the export_as_* for pdf and doc format, but I believe it needs to be adapted to use flextable. This change is necessary to ensure the table functionality is consistent across other formats, such as PowerPoint . I will investigate this further.