We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

position datagrid on a page while exporting to pdf

Thread ID:

Created:

Updated:

Platform:

Replies:

142011 Jan 14,2019 07:51 PM UTC Jan 20,2019 08:51 PM UTC Xamarin.Forms 1
loading
Tags: SfDataGrid
Ilya
Asked On January 14, 2019 07:51 PM UTC

Hello,

i am trying to find a way to 
1. position datagrid in a specific part of the page
2. to fit it in this part.
3. how to prevent stretching of the datagrid with options.FitAllColumnsInOnePage = true

for instance, let's say we have page a4 splitted on 4 equal  parts with 1 vertical and 1 horizontal line
how can i output pdf to the rightmost part (right bottom corner )

and is there is some method to fit output in this part 

tia 

ish

Pradeep Kumar Balakrishnan [Syncfusion]
Replied On January 20, 2019 08:51 PM UTC

Hi Ilya, 
  
Thanks for contacting Syncfusion Support. 
  
We have checked your query and prepared a sample based on your requirement. You can download the same from the below link. 
  
  
Code Snippet: 
  
DataGridPdfExportOption dataGridPdfExportOption = new DataGridPdfExportOption(); 
//To Fit all the columns in one page. 
dataGridPdfExportOption.FitAllColumnsInOnePage = true; 
  
PdfDocument document = new PdfDocument(); 
//To Place the grid the grid where we want. 
document.PageSettings.SetMargins(250, 350,0,0); 
  
PdfGrid grid = new PdfGrid(); 
grid = pdfExport.ExportToPdfGrid(dataGrid, this.dataGrid.View, dataGridPdfExportOption, document); 
grid.Style.AllowHorizontalOverflow = false; 
  
PdfPage pdfPage = document.Pages.Add(); 
grid.Draw(pdfPage, new RectangleF(0, 0, 0, 0)); 
  
  
Also refer the below UG link for Pdf Document Customization. 
  
  
Please let us know if you need further assistance on this.  
  
Regards, 
Pradeep Kumar B 



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;