C# .NET - How to customize a size of crystal report

Asked By Daniel on 06-Mar-12 02:10 PM
Hi!I want to customize my crystal report or crystal report viewer by giving it the a small size.Please help fixing this.
let me give u an exemple then tell me if I have to resize a crystal report or crystal report viewer that support the crystal report.
see the report below and tell me how I can do the same:

kalpana aparnathi replied to Daniel on 06-Mar-12 02:25 PM

Try below code for size:

string printerName = GetPrinterName();
  if (printerName != null)
    cr.PrintOptions.PaperSource = PaperSource.Auto;
    cr.PrintOptions.PaperSize = PaperSize.DefaultPaperSize;
   CrystalDecisions.Shared.PageMargins edges = new CrystalDecisions.Shared.PageMargins(1, 1, 1, 1);
   crystalReportViewer1.ReportSource = cr;
   cr.PrintOptions.PrinterName = printerName;
   cr.PrintToPrinter(1, false, 0, 0);

Somesh Yadav replied to Daniel on 07-Mar-12 12:21 AM


Please refer following




hope this helps
Reena Jain replied to Daniel on 07-Mar-12 12:42 AM

To set height programatically you have to set it in pixels

Set the width and height in code like this

CrystalReportViewer2.Width = new Unit("2000px");
CrystalReportViewer2.Height = new Unit("2000px");

The default setting for the CR Viewer is BestFitPage=true, and that could be overriding your setting

or check this link