in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Sizing screwed up

Last post 05-21-2008 10:46 AM by C1_Dima. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 04-19-2008 4:50 PM

    Sizing screwed up

     I have a very complex form that I have worked on for weeks.  I had not touched it in a few weeks until today.  I have a lot of hard coded number parameters to put things exactly where I needed them to go.  Today everything was scrunched up taking up about half as much space as it had before.  I've downloaded some Microsoft upgrades and installed a new printer on my machine.  Perhaps one of those activities messed up my scaling.  Right now this is tottally screwed. up.  What dictates the scaling?   In looking at the numbers, it appears that perhaps I went from 300 dpi to 600 dpi.  (new printer driver??)  What can I do to reset that?   Anyone have a clue on what is going on here? 

    This application is going to another site so if the scaling is printer dependent, I could be in deep doo-doo.

  • 04-19-2008 11:34 PM In reply to

    Re: Sizing screwed up

    I'm not sure what you mean by scaling. If you specify a size of a render object as "10mm" for instance, it should not be printer dependent. It is hard to say more without being able to look at your code (or knowing which version of preview you're using, for that matter). Please provide more details or  better yet a sample. Thanks. 

    Cheers,
    Dima.
  • 04-21-2008 1:35 PM In reply to

    Re: Sizing screwed up

    My build and version numbers

    2.0.20073.42109

    v2.0.50727

     

        a sample of code is very helpful when you have a narrow  problem.  This is is a broad sweeping problem.  Bottom line is that one day it worked and then it didn't work without the code changing.  Please apply logic to that situation to see if anything makes sense.  When I said scaling, perhaps resolution was a better word. 

     

    Here are two pieces of code that might be relevant. 

                    rt.Cols[0].Width = new Unit(35, UnitTypeEnum.Pixel);

    this printed only half as wide as it did before. 

     

                              SizeD tableHeight = rt.CalcSize(Unit.Auto, Unit.Auto);

                             _currentY = _currentY + tableHeight.Height) ;

    This does not calculate the tableheight as it should..  I doubled it and that makes it works ok. 

  • 04-21-2008 4:08 PM In reply to

    Re: Sizing screwed up

    From the docs/intellicense on "UnitTypeEnum.Pixel":

    >> Specifies a device pixel as the unit of measure. 

    IOW, pixel is the only unit that DOES depend on the device resolution by definition. If you want device-independent rendering, do not use pixels, or scale them programmatically by C1PrintDocument.MeasurementDpi.
     

    Cheers,
    Dima.
  • 04-21-2008 7:39 PM In reply to

    Re: Sizing screwed up

     OK.  Saved my sanity Dima!!!  Thanks.  I just set a multiplication factor for all the numbers and my report looks pretty again. 

     

  • 04-29-2008 8:18 PM In reply to

    Re: Sizing screwed up

    Now I'm really messed up.  I tried to print to our new 11 by 17 inch printer.  The document looked great in the preview form and printed out with a size of 6.25 high by 9.5 inches wide.  I thought it must have to do with the pixels thing still, so I replaced the pixels with millimeters.  It still prints out the small size. Is this a problem with the printer?  Am I doing something wrong.  SHouldn't I have WYSIWYG using millimeters?   Also the calcsize method is returning values that are too high.  I don't think those are resolving to millimeters.  I set  this property

    _doc.ResolvedUnit = UnitTypeEnum.Mm;

    which I thought would take care of the problem - but the height of the table is reported about 10 times higher than it actually is. Am I missing something here??

  • 04-30-2008 1:29 AM In reply to

    Re: Sizing screwed up

    Re the 1st problem (your document printing 6x9 instead of 11x17 inches) - I do not have enough info to diagnose it. If (as I think you implied) you set all your sizes to some calculated absolute values in your code - then it sounds like your document is made to not depend on the paper size. In that case, the behavior you describe would seem to be the correct one. Same with the other problem, in fact - there's simply not enough info for me to say anything useful. I do not understand what you mean by "SHouldn't I have WYSIWYG using millimeters?"...

    If you can make a small sample that I could build and run showing the problems I'll look into it.

    Thanks. 

    Cheers,
    Dima.
  • 05-12-2008 2:16 PM In reply to

    Re: Sizing screwed up

     

     After making the adjustments that I was given for using renderdirect and startdoc - enddoc, the report is now printing out in the correct proportions.  So no need to answer this one again.  Thanks!!!!

     

     

  • 05-21-2008 10:46 AM In reply to

    Re: Sizing screwed up

    Great, thanks for letting me know.
    Cheers,
    Dima.
Page 1 of 1 (9 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.