Multiple line PDF Header

Hello,

          How can I export PDF from DataGrid with multiple line header? So far I tried put '\n' in pdfExportPropoties but it causes an 'Uncaught (in promise) t' error. 


          let pdfExportProperties = {
                pageOrientation: 'Landscape',
                header: {
                    fromTop: 0,
                    height: 60,
                    contents: [
                        {
                            type: 'Text',
                            value: 'Line 1' + '\n' + 'Line 2'+ '\n' + 'Line 3',
                            position: { x: 0, y: 20 },
                            style: { textBrushColor: '#000000', fontSize: 10, dashStyle: 'Solid', hAlign: 'Center'},
                        },
                    ]
                }
            }


Thank you very much,
Ray


3 Replies 1 reply marked as answer

SK Sujith Kumar Rajkumar Syncfusion Team December 16, 2020 06:07 AM UTC

Hi Ray, 
 
Greetings from Syncfusion support. 
 
We checked your reported problem but unfortunately were unable to reproduce it from our end as the pdf was exported properly with headers in multiple lines using ‘\n’ tag. You can check the below sample for reference, 
 
 
So please share us the following information to validate further on this, 
 
  • Pictorial or video representation of the problem.
  • Entire Grid code file.
  • Syncfusion NuGet version used.
  • EJ2 script and theme files referred in the application.
  • If possible share us a simple sample to replicate the problem or try reproducing it in the above shared sample.
 
If you are using older Syncfusion packages, then please upgrade them to the latest version, refer the latest EJ2 script and theme files and see if it resolves the problem. 
 
 
Let us know if you have any concerns. 
 
Regards, 
Sujith R 



SN Sirapat Nemidkanam December 17, 2020 11:05 AM UTC

Hello,

        Thank you Sujith R. I solved that by increased height, change position (x,y) and add more contents as shown below. I also attach the sample file.

           let pdfExportProperties = {
                pageOrientation: 'Landscape',
                header: {
                    fromTop: 0,
                    height: 150,
                    contents: [
                        {
                            type: 'Text',
value: 'Line 1',
                            position: { x: 0, y: 20 },
                            style: { textBrushColor: '#000000', fontSize: 10, dashStyle: 'Solid', hAlign: 'Center'},
                        },
                         {
                            type: 'Text',
                            value: 'Line 2',
                           position: { x: 0, y: 40 },
                            style: { textBrushColor: '#000000', fontSize: 10, dashStyle: 'Solid', hAlign: 'Center'},
                        },
                    ]
                }
            }


  Thank you for your help,
  Ray

Attachment: GridPdfExport8710963_b3b3fd6f.zip

Marked as answer

SK Sujith Kumar Rajkumar Syncfusion Team December 18, 2020 10:37 AM UTC

Hi Ray, 

You’re welcome. We are glad to hear that your query has been resolved. 

Please get back to us if you require any further assistance. 

Regards, 
Sujith R 


Loader.
Up arrow icon