natergj / excel4node

Node module to allow for easy Excel file creation
MIT License
1.38k stars 215 forks source link

WRAPPING GROUP CELLS ISSUE #288

Open Gryffind96 opened 5 years ago

Gryffind96 commented 5 years ago

When I make a horizontal group cells for example: ws.cell(2,5,2,11,true) .string(HERE LONG TEXT) .style({ alignment:{ wrapText:true } })

And I try to using wrapText propertie to fit a long paragraph into grouped cells their don't apply the wrapping correctly.

How can fix this issue?

I GONNA ATTACH the full code of my problem

  //#region ASPECTS
            disy += 2
            ws.cell(disy,5,disy,16,true)
            .string('Fortalezas y debilidades o aspectos a mejorar de la asignatura')
            .style(subtitleStyle)
            disy +=1; 
            ws.cell(disy,5)
            .string('GRUPOS')
            .style(ItemStyle)
            ws.cell(disy,6)
            .string('INTEGRANTES')
            .style(ItemStyle)
            ws.cell(disy,7,disy,11,true)
            .string('FORTALEZAS')
            .style(ItemStyle)
            ws.cell(disy,12,disy,16,true)
            .string('DEBILIDADES')
            .style(ItemStyle)

            disy += 1;

            for (let index = 0; index < body.section_d[1].groups_comments.length; index++) {
                const element = body.section_d[1].groups_comments[index];
                ws.cell(disy,5)
                .number(index+1)

                ws.cell(disy,6)
                .string(element.members)

                ws.cell(disy,7)
                .string(element.fortress)
                .style({
                    alignment:{
                        wrapText:true
                    }
                })

                ws.cell(disy,7,disy,11,true)

                ws.cell(disy,12)
                .string(element.weakness)
                .style({
                    alignment:{
                        wrapText:true
                    }
                })

                ws.cell(disy,12,disy,16,true)

                disy +=1;
            }

        //#endregion

In using NodeJS v10.x and excel4node v1.7.2

Please contact me as soon as possible. It's a work emergency.

Thanks for read.

natergj commented 5 years ago

I am unable to recreate your issue. I tested with the following gist and everything came out as expected. https://gist.github.com/natergj/21266b7f9f7653006d20d15eb45d18b1

image

with wrapText set to false, the output looks like this: image

It may be that you are just not specifying a row height that is greater than the default, so it doesn't appear to be wrapped?

Gryffind96 commented 5 years ago

ok. but the problem is how to determine the height for the row for example I have 50 or n comments list in one row how can I handle the height of the row thinking of the length array of comments.

El mié., 22 de may. de 2019 a la(s) 16:31, Nater (notifications@github.com) escribió:

I am unable to recreate your issue. I tested with the following gist and everything came out as expected. https://gist.github.com/natergj/21266b7f9f7653006d20d15eb45d18b1

[image: image] https://user-images.githubusercontent.com/8051185/58210282-9a83e680-7cae-11e9-8d24-1faa5f3e9dad.png

with wrapText set to false, the output looks like this: [image: image] https://user-images.githubusercontent.com/8051185/58210306-af607a00-7cae-11e9-8b6a-d2da5e598d09.png

It may be that you are just not specifying a row height that is greater than the default, so it doesn't appear to be wrapped?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/natergj/excel4node/issues/288?email_source=notifications&email_token=ADBKFK6UITFKOZXMFP3Z2ETPWW3TLA5CNFSM4HOWQYVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWANDFQ#issuecomment-494981526, or mute the thread https://github.com/notifications/unsubscribe-auth/ADBKFK5GTXL72RRYAFB4DIDPWW3TLANCNFSM4HOWQYVA .