Here is a snippet of code I'm using in my testing.
var doc = new RadPrintDocument();
doc.HeaderHeight = 20;
doc.FooterHeight = 18;
doc.HeaderFont = new Font("Arial", 10, FontStyle.Bold);
doc.FooterFont = new Font("Arial", 8, FontStyle.Regular);
doc.LeftHeader = "Test Header";
doc.Logo = System.Drawing.Image.FromFile(@"Z:\Home\Kurt\Y&M Logos\ymlogo_63x18.png");
doc.LeftFooter = "[Logo]";
doc.Landscape = true;
doc.AssociatedObject = radGridView1;
doc.Print();
If I had the ability to set the Width of the LeftFooter, or force the size of the Logo, I'd be set, but I can't find a way to do this. Any ideas?
7 Answers, 1 is accepted
Thank you for writing.
By default the footer is divided into three regions (left, middle and right) and each region is filled with the image. This can be easily changed by creating a descendant of RadPrintDocument and overriding the PringLogo method:
class
MyPrintDoc : RadPrintDocument
{
protected
override
void
PrintLogo(Graphics g, Rectangle rect)
{
rect.Width =
this
.Logo.Width;
rect.Height =
this
.Logo.Height;
base
.PrintLogo(g, rect);
}
}
I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
Regards,
Stefan
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.
hi i have a problem plz help me
var document = new RadPrintDocument();
document.HeaderHeight = 30;
document.HeaderFont = new Font("Arial", 22);
document.Logo = System.Drawing.Image.FromFile(@"Z:\Home\Kurt\Y&M Logos\ymlogo_63x18.png");
document.LeftFooter = "[Logo]";
document.LeftHeader = "[Logo]";
document.MiddleHeader = "Middle header";
document.RightHeader = "Right header";
document.ReverseHeaderOnEvenPages = true;
document.FooterHeight = 30;
document.FooterFont = new Font("Arial", 22);
document.LeftFooter = "Left footer";
document.MiddleFooter = "Middle footer";
document.RightFooter = "Right footer";
document.ReverseFooterOnEvenPages = true;
document.AssociatedObject = this.radGridView1;
RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(document);
dialog.Show();
document.Logo is misssed and red
var document = new RadPrintDocument();
document.HeaderHeight = 30;
document.HeaderFont = new Font("Arial", 22);
document.Logo = System.Drawing.Image.FromFile(@"Z:\Home\Kurt\Y&M Logos\ymlogo_63x18.png");
document.LeftFooter = "[Logo]";
document.LeftHeader = "[Logo]";
document.MiddleHeader = "Middle header";
document.RightHeader = "Right header";
document.ReverseHeaderOnEvenPages = true;
document.FooterHeight = 30;
document.FooterFont = new Font("Arial", 22);
document.LeftFooter = "Left footer";
document.MiddleFooter = "Middle footer";
document.RightFooter = "Right footer";
document.ReverseFooterOnEvenPages = true;
document.AssociatedObject = this.radGridView1;
RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(document);
dialog.Show();
Can you please provide more information on the issue you experience? What version of the suite do you use, what is the issue you have and how can I reproduce it?
I am looking forward to your reply.
Regards,
Stefan
Telerik
I am not sure why you are getting an error, nor I am able to see what is the error you get from the attached screen shot. The type resides in the Telerik.WinControl.UI.dll which is assembly for our controls and if you have it referenced you should be able to see and use this type. Using your code on my end I see no errors and I am able to use it with our latest version.
Another possible reason is if you are using older version of the suite where this type did not exist, although it has been around for couple years. Which version are you using?
Should you continue experiencing this error, please open a support ticket where you can attach your project, so we can review it.
Regards,
Stefan
Telerik