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.
Unfortunately, activation email could not send to your email. Please try again.

Print all full columns of SfDataGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

120186 Sep 9,2015 02:40 AM Apr 5,2018 09:10 AM WPF 11
loading
Tags: SfDataGrid
Martin Tichovsky
Asked On September 9, 2015 02:40 AM

Hello,

i have question about printing SfDataGrid. I can't find out a way, how print full table. I need print full table, with all columns and rows, not at one page. In my case i have table with 30 columns and 50 rows. In this topic i attach example file. Thanks for help!

Jai Ganesh S [Syncfusion]
Replied On September 10, 2015 05:14 AM

Hi Martin,


Thank you for using Syncfusion products.


We have analyzed your query and we could not find any attached example file in your update. We suspect that you want to print all the columns and rows and not at one page. You can achieve this requirement by setting the “AllowColumnWidthFitToPrintPage” as false in print settings.


Code Example:


    syncgrid.PrintSettings.AllowColumnWidthFitToPrintPage = false;


UG Link: http://help.syncfusion.com/wpf/sfdatagrid/printing


If we misunderstood your requirement, then could you please share more information about your query? This would be more helpful for us to analyze further.


Thank you,

Jai Ganesh S


Martin Tichovsky
Replied On September 11, 2015 12:03 AM

Hello, i see now. Attachement file not included, because i put WPF.ZIP with upper case of file type and you web not allowed this. With lower case is everything ok.

Now, i try set "AllowColumnWidthFitToPrintPage" before, its works, but not print all rows. If i set this to false, print obtain all columns, but not all rows. Moreover, with three cases in three different sfDataGrid is print preview bad for all data. Now problem is rows, and in my exmple is now problem wrong columns and missing rows. Please, see that. Thank you

Attachment: wpf_a7686353.zip

Jai Ganesh S [Syncfusion]
Replied On September 14, 2015 04:26 AM

Hi Martin,


Thank you for the update.


We have analyzed your query. You can achieve your requirement to print all the columns and rows in one page by setting the PrintScaleOption as FitViewonOnePage like below,


Code Example:

private void PrintPreview_Click(object sender, RoutedEventArgs e)

   {

            this.SfdataGrid.PrintSettings.PrintScaleOption = Syncfusion.UI.Xaml.Grid.PrintScaleOptions.FitViewonOnePage;

            this.SfdataGrid.PrintSettings.AllowColumnWidthFitToPrintPage = false;

            this.SfdataGrid.PrintSettings.AllowRepeatHeaders = true;

            this.SfdataGrid.ShowPrintPreview();

   }


We have also prepared a sample based on this and you can download the sample from the below location,


Sample Link: http://www.syncfusion.com/downloads/support/directtrac/142012/ze/SfGridPrintDemo-661777861


Please let us know if you need further assistance.


Thank you,

Jai Ganesh S


Martin Tichovsky
Replied On September 14, 2015 04:34 AM

Thank you for update, but if i try your example, VS 2013 fail on build with error 

"'Syncfusion.UI.Xaml.Grid.PrintSettings' does not contain a definition for 'PrintScaleOption' and no extension method 'PrintScaleOption' accepting a first argument of type 'Syncfusion.UI.Xaml.Grid.PrintSettings' could be found (are you missing a using directive or an assembly reference?)"

I using Syncfusion components with version v4.0.30319.

Martin Tichovsky
Replied On September 14, 2015 04:37 AM

Correction... Syncfusion components with version 13.1451.0.21

Martin Tichovsky
Replied On September 15, 2015 01:04 AM

Hello, i download new syncfusion version and projects build without problem, but print is still not ok. 

First, columns headers haven't right text. 
Second, still not all pages in print preview. First four columns are only on one page. Others missing. 

Now i using syncfusion components with version 13.2451.0.34

I need print all pages with reading format. If fit all columns on one page, than data are not readable.

Thank you

Jai Ganesh S [Syncfusion]
Replied On September 15, 2015 08:26 AM

Hi Martin,


Thank you for the update.


We have analyzed your queries and please find the responses for your queries as below,


Query 1: (Columns headers haven't right text)

We cannot understand your requirement clearly. Could you please share more details about your query? This would be more helpful for us to proceed further.


Query 2: (Still not all pages in print preview. First four columns are only on one page. Others missing)

We suspect that you have set the AllowColumnWidthFitToPrintPage as false in your application. Hence only the first four columns are viewed in the page. You can show all columns in a page by setting AllowColumnWidthFitToPrintPage as true,


Code Example [C#]:

private void PrintPreview_Click(object sender, RoutedEventArgs e)

 {

       this.SfdataGrid.PrintSettings.AllowColumnWidthFitToPrintPage = true;

       this.SfdataGrid.PrintSettings.AllowRepeatHeaders = true;

       this.SfdataGrid.ShowPrintPreview();

 }


Query 3 :( I need print all pages with reading format. If fit all columns on one page, than data are not readable)


I need print all pages with reading format:

We already mentioned in our last update, you can print all the columns and rows in one page by setting the PrintScaleOption as FitViewonOnePage.


If fit all columns on one page, than data are not readable:

If we have more columns in a Grid, then it will compress and fit in one page. You can view these columns by increasing the zooming level or increasing the page size. This is the default behavior of our Grid.


Please let us know if you need further assistance.


Thank you,

Jai Ganesh S


Martin Tichovsky
Replied On September 16, 2015 12:47 AM

Hello,

1. Table in print preview haven't right text. In MainWindow i have Title 2, Title 3, ... and if i print datagrid, all these columns have text Title. I suppose that column header text haven't  nothing common with HeaderText attribute in MainWindow.xml and "GridTextColumn" element.

2. and 3. If i need print all pages with readable format, thats means in print. If i print example with you code, rows and columns are short, not readable. This is not about zoom in print preview. This thread is about print full datagrid = all columns, all rows with readable text on a papers. I don't would like print all data on just one page. I would like print full data on many pages. 

If i set in example and print preview "No Scaling" and print datagrid, than printing data not contains all data in a real table in MainWindow.

And i have one more problem with threading. In attachment i have simple example. I have two threading, this is important and must stay in threading, because i run more that one window in same time. Problem is in MainWindow, in Print Preview. If i now viewing Print Preview and i click on Print, program collapse with error. This error is about thread, i now, but i don't find any possible way to set print in thread. This is now more important. In search solution, please, obeserve threading in App.xaml.cs.

Thank you for help!

Attachment: SfGridPrintDemo_4e9a3a29.zip

Jai Ganesh S [Syncfusion]
Replied On September 17, 2015 09:25 PM

Hi Martin,

We analyzed your queries. A support incident to track the status of this query has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please let me know if you have any questions.

Thank you,
Jai Ganesh S

Rahul Gadhe
Replied On April 4, 2018 06:40 AM

Thank you for update, but if i try your example, VS 2013 fail on build with error 

"'Syncfusion.UI.Xaml.Grid.PrintSettings' does not contain a definition for 'PrintScaleOption' and no extension method 'PrintScaleOption' accepting a first argument of type 'Syncfusion.UI.Xaml.Grid.PrintSettings' could be found (are you missing a using directive or an assembly reference?)"

I using Syncfusion components with version v4.0.30319.

Please let me download

Jai Ganesh S [Syncfusion]
Replied On April 5, 2018 09:10 AM

Hi Rahul, 
 
We have checked our provided sample in VS 2013 with .NetFramework 4 but we are unable to reproduce the issue. Could you please confirm in which Syncfusion version you have used in your application because we have provided the PrintScaleOption in PrintSettings from our 13.2.0.29 version only. If you are using the older version then could you please upgrade any of our latest version using the below link, 
 
 
Regards, 
Jai Ganesh S

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.

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.

;