PageMargins don't work as expected

Hi,
I'm printing a report with the following code:
document.PrintOptions.ApplyPageMargins(new PageMargins(1440, 0, 0, 0));
document.PrintOptions.PrinterName = dialog.PrinterSettings.PrinterName;
document.PrintToPrinter(dialog.PrinterSettings.Copies, dialog.PrinterSettings.Collate, dialog.PrinterSettings.FromPage, dialog.PrinterSettings.ToPage);
However, the margins don't work as expected. If you set thr right or bottom margin, everything is fine. However, if you set left or top, you'll get completely unexpected results.
See this illustration:
http://i33.tinypic.com/2dl8xsi.png
Arrows indicate where whitespace occurs after the margins have been set.
The only margin I want is a margin at the left, but as you can see from my illustration, it's not possible.
Setup: CR2008 SP2, VS2005, C#/.NET 2.0
Regards,
Florian

Thanks, that seems to work much better (even faster).
Here's the code that worked for me:
if (dialog.ShowDialog(this) == DialogResult.OK)
    document.ReportClientDocument.PrintOutputController.ModifyPaperOrientation(pageSettings.Landscape ? ReportDefModel.CrPaperOrientationEnum.crPaperOrientationLandscape : ReportDefModel.CrPaperOrientationEnum.crPaperOrientationPortrait);
    document.ReportClientDocument.PrintOutputController.ModifyPrinterName(dialog.PrinterSettings.PrinterName);
    document.ReportClientDocument.PrintOutputController.ModifyPageMargins(1,1,1,1);
    try
        PrintReportOptions options = new PrintReportOptions();
        switch (dialog.PrinterSettings.PrintRange)
            case PrintRange.CurrentPage:
                options.AddPrinterPageRange(this.GetCurrentPageNumber(), this.GetCurrentPageNumber());
                break;
            case PrintRange.AllPages:
                options.AddPrinterPageRange(1, totalPages);
                break;
            case PrintRange.SomePages:
                options.AddPrinterPageRange(dialog.PrinterSettings.FromPage, dialog.PrinterSettings.ToPage);
                break;
        options.Collated = dialog.PrinterSettings.Collate;
        options.NumberOfCopies = dialog.PrinterSettings.Copies;
        options.PrinterName = dialog.PrinterSettings.PrinterName;
        document.ReportClientDocument.PrintOutputController.PrintReport(options);

Similar Messages

  • Second Level Subdomains | wildcard domains on Azure don't work as expected

    Hi,
    We're having issues with the Custom Domain functionality of Azure Websites.
    In short, a wildcard CNAME record has been set up to point to the Azure Website instance:
    *.mydomain.com -> mydomain.azurewebsites.com
    In Azure portal, in the custom domains section, the wildcard is also set up with a valid entry
    e.g. *.mydomain.com (record in custom domains section).
    Problem:
    visiting www.level2.mydomain.com results in a 404 error from Azure 'Error 404 - Web Site not found!' etc.
    Every other single-level subdomain gets through fine e.g. level1.mydomain.com is fine.
    Question:
    Are we doing something unsupported here?
    Thanks in advance,
    H

    Hi Petr,
    Many thanks for your response!
    With the knowledge that double wildcard certificates are not supported with Azure Websites, I set up a simple test to see if second-level subdomains would work on Azure Websites
    without SSL.
    Test:
    - a template MVC5 app, no SSL endpoint binding and a single custom domain *.mydomain.com.
    - Home controller index action with a simple redirect to another site
    - published to a Shared Azure Website instance
    - DNS entry from *.mydomain.com to <azurewebsitename>.azurewebsites.net
    - wait for everything to propogate
    Result:
    - 'Error 404 - Web Site not found!' on Azure when navigating to www.secondlevel.mydomain.com
    - Successful redirect when navigating to random.mydomain.com (where random is
    not an explicitly mapped subdomain in the DNS service: therefore, wildcard catchall is working as expected for single-level wildcard subdomains)
    Assessment:
    The non-support of second-level subdomains is not restricted to the fact that Azure Websites don't support double wildcard certificates? The issue extends to Azure Website's non-support of double wildcard Custom Domains?
    Thanks,
    H

  • FLV Playback controls don't work as expected

    Hi
    I have a FLVPlayback component that I feed with flv through
    the url paramterer.
    The movie loads and play fine, but I the controls do not work
    as expected.
    Eg. If the movie has ended I can not rewind and play it again
    (without reloading the host page)
    Does anyone know whats wrong here?
    Thanks in advance
    T

    Hi
    I have a FLVPlayback component that I feed with flv through
    the url paramterer.
    The movie loads and play fine, but I the controls do not work
    as expected.
    Eg. If the movie has ended I can not rewind and play it again
    (without reloading the host page)
    Does anyone know whats wrong here?
    Thanks in advance
    T

  • Http cache don't work as expected in an applet

    Hi, everyone!
    I write an applet which dynamic connect a http server and fetch content from it. I wish the content could be cached in browser's cache system.
    Here is my code, it's work well in MS JVM, but when I turn to sun plugin, the cache system don't work. Every time I get a Response code 200 ( wish to be 304)
    ==================My code================================
    URLConnection conn=(URLConnection)url.openConnection();
    conn.setUseCaches(true);
    conn.setAllowUserInteraction(false);
    conn.connect();
    java.io.ObjectInputStream ois=null;
    Object o=null;
    try
    ois=new ObjectInputStream
    (new java.util.zip.InflaterInputStream(conn.getInputStream()));
    return ois.readObject();
    finally
    if(ois != null)
    ois.close();
    ==================My code================================
    I tested on sun JDK 1.42 and IE6.
    My Http Server is Jetty ,and I do have add a last_modified tag in http response.
    I look into the Java plugin control panel ,only the jar file is cached.

    Sorry for the confusion, of course you are right and it seems to be a bug.
    I ment that the method name setUseCaches itself might be confusing because it does not force caching, it just allows it when available.
    There are several bugs about the plugin caching (4912903, 5109018, 6253678, 4845728, ...) even if they might not fit 100% to your problem they show that plugin caching is an issue which sun really should improve.
    You might have a look at them and vote for them or submit a new bug.

  • Albums don't work as expected

    New to itunes and am importing my CDs...
    1) An album like Actually where the artist is always Pet Shop Boys groups as one album as expected.
    2) An album like Into The Woods, various artists, does not group at all (all individual songs are not in same album).
    3) Some albums with various artists do group together under the same album correctly (not many).
    Question 1) Particularly for #2 above, how do you get albums to group together correctly?
    Questions 2) What does the 2nd column (after the art work) mean? It has a number in it, and for albums that group correctly, it makes sense, track 1, 2 etc. For for albums that don't droop, I will have a long song that says 15 for that number. There is a number column for track #. Additionally, the 2nd column cannot be hidden.
    Thanks!
    bob

    See this: Why aren't songs with the same album art grouped together? http://support.apple.com/kb/TS1468

  • TS3048 "Mouse buttons don't work as expected"

    When I consulted the troubleshooting page, the fix was identical to the fix listed for tracking problems, and that won't fix my problem.. Probably won't fix other peoples problems either
    When my Magic mouse is connected, it acts like the left button is constantly being held (selecting, dragging, and not allowing left click), except it's not.
    I have checked that the button hasn't warped for some reason, and also done a peliminary scan of other internet forums. There was a similar problem with the trackpad, but that occured after a firmware update, and was fixed by a firmware update.
    Could anybody help?

    Hello n:
    Just a bit of information from someone who has been using Apple products for well over 15 years (including a couple of warranty issues).  Also, as an aside, the little purple dots indicate that I have helped a lot of people here in the past. 
    1.  I suggest you follow my original suggestion.  As far as I know, there is no "deep-seated" problem with Apple mice.  Extrapolating from what you read in these forums and deciding there are big problems is roughly akin to visiting a hospital and deciding everyone in the world is sick.  If you are near an Apple store and it is convenient, take the mouse in for replacement.  If not, call Applecare for a warranty replacement.  Be sure you specify that you feel the mouse has failed.
    2.  This post is completely idiotic:
    It doesn't make sense to me to call this into Apple Care... since even if they do send you a new one, they'd also have to request that not only do you send yours back in to them, but they would STILL have to charge you a holding fee. And if the r-depot finds out that there is nothing wrong with the mouse you returned (as far as they can see), then that's even more lost $$$.
    If you call Applecare and they send you a replacement mouse, you do return the failed one within 14 days.  Apple pays the shipping cost both ways.  There is NO SUCH THING as a "holding fee." The so-called r-depot (there is no such thing) certainly does not waste time trying to debug a failed mouse.  The mouse goes to, I am sure, recycling.
    My original post was to keep your from wasting time debugging a problem that is not debuggable.
    Barry
    P.S.  In the years I have been using Apple products, I had two warranty issues.  One was an iMac that was DOA.  That was replaced (through Applecare) at no cost to me.  The other was a keyboard that was acting oddly.  Applecare replaced the keyboard and paid shipping both ways.  I do not work for Apple, but I can attest to the fact that their warranty service is first class.
    Message was edited by: Barry Hemphill

  • SetPreferredSize() & setSize() of JPanel don't work as expected.

    http://myhome.cari.com.my/attachment/201002/1/195233_1265032535pmPA.jpg
    Above link show what i want to do,but it doesn't show as expected after i run the code below.
    //-----------START-----------
    import javax.swing.*;
    import java.awt.*;
    public class Testing extends JPanel
    public Testing()
    {   setLayout(new GridLayout(1,2));
    JPanel leftPanel=new JPanel();
    leftPanel.setPreferredSize(new Dimension(224,768));
    leftPanel.setBorder(BorderFactory.createLineBorder(Color.black));
    JPanel rightTopPanel=new JPanel();
    rightTopPanel.setPreferredSize(new Dimension(800,576));
    rightTopPanel.setBorder(BorderFactory.createLineBorder(Color.blue));
    JPanel rightBottomPanel=new JPanel();
    rightBottomPanel.setPreferredSize(new Dimension(800,192));
    rightBottomPanel.setBorder(BorderFactory.createLineBorder(Color.red));
    JPanel rightPanel=new JPanel(new GridLayout(2,1));
    rightPanel.setPreferredSize(new Dimension(800,768));
    rightPanel.setBorder(BorderFactory.createLineBorder(Color.yellow));
    rightPanel.add(rightTopPanel);
    rightPanel.add(rightBottomPanel);
    add(leftPanel);
    add(rightPanel);
    public static void main(String[] args)
    {   JFrame frame=new JFrame("Testing!!");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setResizable(false);
    frame.setContentPane(new Testing());
    frame.getContentPane().setPreferredSize(new Dimension(1440,800));
    frame.pack();
    frame.setVisible(true);
    //--------------END-------------------
    Edited by: ImMax on Feb 2, 2010 3:56 PM
    Edited by: ImMax on Feb 2, 2010 3:57 PM

    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    db

  • Prelude Ingest don't work as expected with P2 material.

    Hi!
    I try to ingest my footage from P2 card and this is what's happening.
    If I just use Ingest dialog windows with P2 mode like just clicking the card, it shows only less than half of the footage as you can see in 2 images of below.
    Ok. So tryed to solve the problem and got to the "folder mode" and marking all clip parts and ofcourse check "stitch clips together mark" and choose Transcode to h264. After that, Media Encoder tells me multiple errors. It shows error box "One or more errors occured during ingest.Please check the..." And event window tells "Transcode task failed. Reason: AME unknown error!" and "Concatenate task failed. Reason: AME unknown error!". Adobe mediaencoder errorlog tells "
      - Encoding Time: 00:00:15
    02/06/2014 06:50:36 PM : Encoding Failed
    Export Error
    Error compiling movie.
    Unknown error.
    So... what can I try next or forget the using Prelude?
    Sami

    Hi,
    Thank you for your post.
    The two images you posted represent the different views of Prelude interprets P2 clips. On the 'File Directory" view, it shows much more footages than the 1st image under the same folder, because there are spanned clips for the two shots. When a shot or take is recorded requiring more than the file size limit of a medium, a file-based camcorder starts another file, and continues recording the shot to that file without interruption.
    So, you could do the ingest from either view. For P2 clip, prelude imports all of the spanned clips within a single shot or take as a single clip. No need to transcode.
    To import a group of spanned clips, select one of them to import all of them. If you select more than one spanned clip, you will import duplicates of the whole group of spanned clips as duplicate clips in the Project panel.
    Hope this helps.
    Best regards,
    Ada

  • Safe Margins - how come they don't work as expected ?

    Hello everyone,
    Ok, so I have put a title on the lower left area of my footage, and have my "safe margins" ON. I placed the text title right up against the outer safe margin border.
    When I export this to .vobs and play it on the TV, the logo is not anywhere near the bottom corner of my TV screen, but up and to the right of the bottom corner, and this is not good, and it's very puzzling why it is doing this.
    Does anyone have any suggestions ?
    Thanks,
    Dave.

    David,
    Depending on the design of your logo, you might consider some "bleed" in the graphic itself, just like in printing to get the graphic to end beyond the page perimeter. If you've got a bug, then a graphic field behind it (say a rectangle with Opacity to 20% maybe even with a gradient from 20% to 0% to the right of the bug), that bleeds off of the screen, even beyond the Action Safe Area, will insure that the whole graphic is about where you want it, and then place the bug inside the Title Safe Area. Visually, it will appear that the logo does go off screen, but your bug will be where you placed it.
    Hunt

  • I am running SSH in Terminal window and my function keys don't work.

    Hi all,
    The company I am working in is using mainly Windows and they are running a database on Putty.exe
    I managed to set up the SSH in Terminal on Mac OSX and I can see the database well and fine. Certain "commands" within the database are executed by numbers 1, 2, 3 etc while other "commands" are executed by function keys F1, F2 - F16 etc. However, when I press the F1 - F12 keys on my keyboard, they don't work as expected.
    If any one has any expert advice, I would greatly appreciate it, thanks!

    FInd out from your database administrator what terminal type the database application supports. Examples of terminal types are vt100 and ansi. Now go back to the Mac's Terminal Preferences and set the terminal to the matching type.

  • Macbook pro 13inch,mid2010 qwertyu keys don't work after upgrade os x Yosemite

    macbook pro 13inch,mid2010 qwertyu keys don't work after I upgrade os x 10.10 Yosemite. but it works on keyboard viewer. I'm not sure if it's hardware or software problem, how can I fix it?

    Hello there, kipolo.
    Great job using the Keyboard viewer to troubleshoot your issue so far. The following Knowledge Base article provides a great checklists of steps to pinpoint the issue a bit further:
    One or more keys on the keyboard do not respond - Apple Support
    Some keys don't work as expected
    From the Apple menu, choose System Preferences.
    From the View menu, choose Speech.
    Click the Text to Speech tab.
    If "Speak selected text when the key is pressed" is enabled, the key or key combination set to speak text cannot be used for other purposes or used to type text--click Set Key and change it to a less-commonly used key combination (try to use modifier keys such as Shift, Command, Option, and Control). Or, disable the "Speak selected text when the key is pressed" option.
    Click the Accessibilty or Universal Access pane in System Preferences, then click the Keyboard tab.
    Make sure that Slow Keys is turned off. With Slow Keys on, you need to press a key for a longer period of time for it to be recognized.
    In the Accessibilty or Universal Access pane, click the Mouse tab, and make sure Mouse Keys is turned off. With Mouse Keys enabled, you cannot use the Numeric Keypad to enter numbers--instead the keypad moves the pointer (cursor). (There is an option to enable Mouse Keys with five presses of the Option key; you may want to turn that option off to avoid accidentally enabling it.) If Mouse Keys is enabled and you are using a keyboard with no numeric keypad or Num Lock function, see Unable to type while Mouse Keys is enabled in Mac OS X.
    If the function keys on the top row of the keyboard are not working as expected, see Mac OS X: How to change the behavior of function keys.
    If the issue persists, use Keyboard Viewer to help isolate the issue:
    Click the Language & Text pane (Mac OS X v10.6) or International pane (Mac OS X v10.5.8 or earlier) in System Preferences.
    Click the Input Sources tab (or Input Menu tab in Mac OS X 10.5.8 or earlier).
    Click the Keyboard & Character Viewer "On" checkbox to select it (click the Keyboard Viewer "On" checkbox in Mac OS X 10.5.8 or earlier).
    From the Input (flag) menu, choose Show Keyboard Viewer.
    If the keyboard is connected and detected by OS X, the keys you type will highlight in the Keyboard Viewer window. Open TextEdit (or any text application), and try to type something using the keys that were previously not responding to see if they highlight in Keyboard Viewer.
    Start from the Mac OS X Install Disc, choose Terminal from the Utilities menu and test the keys which were previously not working.  If the keys work while started from the Install disc, then the keyboard itself is working correctly.  Use How to troubleshoot a software issue to isolate the software issue that may be causing the keys to not respond.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Keyboard not working as expected

    I woke up this morning and suddenly found a few problems with my keyboard:
    The caps lock light is reversed so that the caps is off when the light is on and vice versa
    The placement of some of the symbols are moved around. The @ is to the right of the P button and Shift-2 produces a ". Shift-9 is ), shift-8 is ( and many other switched like this.
    Resetting PRAM or the computer doesnt fix this

    Hello there, morris152.
    The following Knowlede Base article provides some great information for troubleshooting your issue with the keyboard:
    One or more keys on the keyboard do not respond
    http://support.apple.com/kb/ts1381
    Particularly:
    Some keys don't work as expected
    From the Apple menu, choose System Preferences.
    From the View menu, choose Speech.
    Click the Text to Speech tab.
    If "Speak selected text when the key is pressed" is enabled, the key or key combination set to speak text cannot be used for other purposes or used to type text--click Set Key and change it to a less-commonly used key combination (try to use modifier keys such as Shift, Command, Option, and Control). Or, disable the "Speak selected text when the key is pressed" option.
    Click the Accessibilty or Universal Access pane in System Preferences, then click the Keyboard tab.
    Make sure that Slow Keys is turned off. With Slow Keys on, you need to press a key for a longer period of time for it to be recognized.
    In the Accessibilty or Universal Access pane, click the Mouse tab, and make sure Mouse Keys is turned off. With Mouse Keys enabled, you cannot use the Numeric Keypad to enter numbers--instead the keypad moves the pointer (cursor). (There is an option to enable Mouse Keys with five presses of the Option key; you may want to turn that option off to avoid accidentally enabling it.) If Mouse Keys is enabled and you are using a keyboard with no numeric keypad or Num Lock function, see Unable to type while Mouse Keys is enabled in Mac OS X.
    If the function keys on the top row of the keyboard are not working as expected, see Mac OS X: How to change the behavior of function keys.
    If the issue persists, use Keyboard Viewer to help isolate the issue:
    Click the Language & Text pane (Mac OS X v10.6) or International pane (Mac OS X v10.5.8 or earlier) in System Preferences.
    Click the Input Sources tab (or Input Menu tab in Mac OS X 10.5.8 or earlier).
    Click the Keyboard & Character Viewer "On" checkbox to select it (click the Keyboard Viewer "On" checkbox in Mac OS X 10.5.8 or earlier).
    From the Input (flag) menu, choose Show Keyboard Viewer.
    If the keyboard is connected and detected by OS X, the keys you type will highlight in the Keyboard Viewer window. Open TextEdit (or any text application), and try to type something using the keys that were previously not responding to see if they highlight in Keyboard Viewer.
    Start from the Mac OS X Install Disc, choose Terminal from the Utilities menu and test the keys which were previously not working.  If the keys work while started from the Install disc, then the keyboard itself is working correctly.  Use How to troubleshoot a software issue to isolate the software issue that may be causing the keys to not respond.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • After installing "Java for OS X 2013-004" update, Java apps don't work anymore as expected

    After installing "Java for OS X 2013-004" update, Java apps don't work anymore as expected.
    Windows of Swing apps don't display all GUI elements.
    After replacing System/Library/Java from a Time MAchine Backup, everything works normal again.
    Is this update corrupted?

    "avoid using Java in a web browser at all,..."
    Good advice.
    "...old Java apps/applets that aren't written to modern specs ..."
    The stand-alone Java Swing applications, that don't display their GUI elements after installing this update, have been written according to modern standards. With Oracle Java7, and with Java6 from Apple prior to this update, they run absolutely flawlessly.
    This is absolutely Apple's fault.

  • Safari is slowly getting more buggy.  Actions, such as clicking on a field, don't give the expected results.  I may have to click on the red exit button 5 times to get it to work.  I get unwanted dropdown menus.  I have version 5.1.7 on OS 10.6.8

    Safari is slowly getting more buggy.  Actions, such as clicking on a field, don't give the expected results.  I may have to click on the red exit button 5 times to get it to work.  I get unwanted dropdown menus.  I have version 5.1.7 on OS 10.6.8.  System is 3 years old.

    Are you running low on RAM..?
    see > Using Activity Monitor
    Is your Hard Drive getting full...?
    see > Freeing space on your Mac OS X startup disk
    Have you tried Repair Disk Permissions after upgrading Safari...?
    see > About Disk Utility's Repair Disk Permissions feature
    Reset Safari...?

  • Help!(confused face) I'm new with flash and don't know why the timers don't work like i would expect

    I'm new with flash and don't know why the timers don't work like i would expect.  In VB.NET timers are how you move stuff, but it doesn't look like they are ideal for moving stuff in flash at all (really slow).  I'm making a game in which you throw a ball around the screen. i am using a timer to get the ball to move. this doesn't work well for 2 reasons; 1: the ball jumps alot, and 2: the timer should eventually run out of time.  If anyone can help, i'd be thrilled cus this is my first post here, so yeah

    Timing for movement would be more often dealt with using something that operates at the frame rate of the file.  The ENTER_FRAME event is usually selected for this purpose.
    stage.addEventListener(Event.ENTER_FRAME, moveBall);
    function moveBall(evt:Event):void {
         // your positioning code
    You could use a Timer to control when to stop the listener from being active.

Maybe you are looking for

  • How to use standard Search Input Help (return 2 data code and desc) ?

    Hi, Please advise how to use standard Input Help provided by SAP and return 2 data (code and description) ? because the standard Input Help only return the code only ? Thank You and Best Regards Fernand

  • Cannot upload data to serial device using x-on, x-off in Labview but works OK in Hyperterminal

    Hello, I'm trying to write a Labview 7.1 App that will upload a motorola .S28 file to a custom designed piece of hardware. The serial port on the hardware device requires the serial port settings be set to 9600, 8,N,1, none, for general operation and

  • Chase Southwest Rapid Rewards-APPROVED

    I found these boards so helpful in deciding whether or not I should apply, so I thought I'd share my experience for any others who may be interested in this card.  All 3 of my scores are right around 650.  I have a 4 year old car repo, and a few 6 ye

  • Programmatically add steps to a VI

    I am writing a code to control a bank of valves via cDAQ/DAQmx. I need to figure out how to allow the user to build a macro or something similar that will allow them to programmatically change the order and number of the steps in a sequence. For exa

  • MacBook Air and D-link router

    Hi! I do need help, guys. Seriously. I have a brand new MacBook Air and love it. Sadly, I couldn't get it connected to the Internet. My network is like this: Telephone service provider   -------   Modem   -------   Dlink router   -------   PC      Th