I'm trying to format a PDF document that is created by ExportToPdf in a Syncfusion Blazor Datagrid.
I'm attaching copies of the razor page and the PDF document.
I'm having the following problems. Blazor is a new technology for me so some or all of the problems could be caused by a lack of knowledge.
Repeat Heading - I want to display the header only on the first page so I set ExportProperties.IsRepeatHeader to false. But this didn't work.
Page Number - The page number is shown as a single number on the left of the page. I want to centre the page number and format it so it says Page 1 of 3. I set HAlign = PdfHorizontalAlign.Center in the FooterContent but this didn't work. I don't know how to set the page number to Page 1 of 3.
Adjust Column Widths - All the columns in the report are the same width. I want to make the Description column wider and the other columns narrower. The code that I added isn't working. I don't know how to do this.
Any help will be welcome
Greetings from Syncfusion support.
We would like to inform that in DataGrid we don’t have inbuilt support to render customized header and footer. Instead we suggest you to render draw the pdf using pdf library. Kindly check the attached sample and documentation for your reference.
Please let us know if you have any concerns.
Thanks for your reply.
I'm going to try your suggestion and then I'll get back to you.
I had a look at your suggestion to create a PDF using the PDF Library and decided that it was too complicated for me at the moment.
I decided to keep it simple and stick to DataGrid's inbuilt support. I made the following changes:
Firstly, i decided to drop the page number.
Secondly, I discovered that I could adjust the column widths in the report after adding ExportProperties.DisableAutoFitWidth = true;
I'm attaching two copies of the report. The first one is before I made the above changes and the second one is after making the changes.
Thank you for the help you gave me with this problem. I really appreciate it.
Welcome. We are glad to hear that you have resolved the reported query on your own. Kindly get back to us if you have further queries. As always we will be happy to assist you.