Print Page | Close Window

Why can NOT get proper margin value in crystal rep

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3590
Printed Date: 25 Apr 2024 at 9:33am


Topic: Why can NOT get proper margin value in crystal rep
Posted By: ryanelee
Subject: Why can NOT get proper margin value in crystal rep
Date Posted: 03 Jul 2008 at 2:15am
hi All,

   I have a crystal report in vs 2008, the top margin is 0.5 inch I pre-setting in page setup, I'd like to reset it in c#, the code sample like this:
       PageMargins margins;

       margins = myReport.PrintOptions.PageMargins;
       margins.topMargin=margins.topMargin+15;
                 
       myReport.PrintOptions.ApplyPageMargins(margins);

   I can get the topMargin which is 720px in vs 2003, but its value is -2147483648 in vs 2008.And it seems the top margin pre-defined is efficient when I preview in design time in vs 2008, why I can NOT get the proper margin value via the same code in vs 2008?
   Anybody encounterred this? Please help.

Thanks in advance!
Ryan Lee



Print Page | Close Window