title: Crystal Reports margins are not changing at run time in Visual Studio 2010
body: <p>I have Visual Studio 2010 Enterprise.</p>
  
  <p>Here is my code that works perfectly for all other things but it does not change margins at runtime. Even if the value of <code>objRpt.PrintOptions.PageMargins.leftMargin</code>, <code>rightmargin</code>, etc. are being changed, it doesn't reflect in <code>CrystalReportViewer</code> nor in <code>Hardcopy</code> output.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>CrystalReport1 objRpt;
  objRpt = new CrystalReport1();
  adepter.Fill(Ds, "Customer");
  objRpt.SetDataSource(Ds);
  MessageBox.Show("Left margin:"+objRpt.PrintOptions.PageMargins.leftMargin.ToString()); //Here it shows 1440 
  
  objRpt.PrintOptions.PrinterName = "HP LaserJet 1020";
  PageMargins margins = objRpt.PrintOptions.PageMargins;
  
  margins.bottomMargin = 350;
  margins.leftMargin = 350;
  margins.rightMargin = 350;
  margins.topMargin = 350;
  objRpt.PrintOptions.ApplyPageMargins(margins);
  MessageBox.Show("Left margin:"+objRpt.PrintOptions.PageMargins.leftMargin.ToString()); 
  
  //Here it shows 350 BUT no use.
  </code></pre>
  
  <p>I managed to set the margins at design time by right clicking on Report>Design>Page Setup. If I set here, margins work perfectly and they reflect in both reportviewer and hardcopy. But this does not happen when I use above code.</p>