This is a migrated thread and some comments may be shown as answers.

GridView print

3 Answers 190 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sirwan
Top achievements
Rank 1
Sirwan asked on 07 Mar 2015, 05:55 PM
Hi
I have tow question 
1: when i use radgridview.print the cells content truncated is there a way to set "can grow" property to eliminate this.
2: is there a way to add a picture at the top of printed document?? or i must build a report to print a table?.

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 11 Mar 2015, 02:18 PM
Hi Sirwan,

Thank you for writing.

1. You should make sure that there is enough space on the page for all columns (if not you can change page orientation or use smaller fonts). In addition make sure that FitWidthMode of the print style is set to FitPageWidth. More information is available in the following articles:
2. You can create a RadPrintDocument and use its PrintPage event to draw the image:
private void radButton1_Click(object sender, EventArgs e)
{
    RadPrintDocument doc = new RadPrintDocument();
    doc.AssociatedObject = this.radGridView1;
    doc.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(30, 30, 50, 30);
 
    doc.PrintPage += doc_PrintPage;
 
    RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(doc);
    dialog.Show();
 
}
 
private void doc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
    Image img = Image.FromFile(@"C:\img\delete.png");
    e.Graphics.DrawImage(img, e.MarginBounds.X, e.MarginBounds.Y - 20);
 
}

Please let me know if there is something else I can help you with. 

Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Max
Top achievements
Rank 1
answered on 26 Jun 2017, 01:05 PM

Hi Dimitar!

I have a doubt about this solution:
https://feedback.telerik.com/Project/154/Feedback/Details/214367-fix-radgridview-incorrect-row-height-when-the-rows-are-auto-sized-and-the-font

I used your implementation from this link in test project and that solution works perfectaly! Thanks!

But, When I click on "Print Settings" button and I choose the landscape orientation option and I click on "Preview", the issue occurs again. It seems like preview it loses the initial configurations made in MyPrintStyle class...

You can reproduce the issue using the same attached project in link.

Could you help me?

How I can to use a workaround for this issue?


Best regards,
Max

0
Dimitar
Telerik team
answered on 27 Jun 2017, 06:57 AM
Hi Max,

Which version of the suite are you using? I have tested this and on my side and it works correctly. I have attached a video that shows what I am doing.

I am looking forward to your reply.
 
Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Sirwan
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Max
Top achievements
Rank 1
Share this question
or