Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting custom page sizes for printers? 1

Status
Not open for further replies.

CleoMan

Programmer
Jun 18, 2003
110
ZA
This is just a general question concerning setting up custom page sizes for printers.

When I set the custom page size (in printer properties) and then run a report from Paradox, the custom page size has returnd to back to it's defualt settings.

So now each time I print the specific report I have to set the custom page size.

Is there a way to set the page size and then store the values, so that it is selectable for the user, when running the report and slecting print properties?

ie: How can I save the changes made to the custom page size?

As always your support will be appreciated.
 
CleoMan,

I'd probably do this by prompting the user for the paper they want to use before opening the report and then use that to determine the appropriate values for the report's PageSize property at run-time.

The following code shows one way to change the report page size:

Code:
method pushButton(var eventInfo Event)
var
   rpt  Report
   uio  UIObject
   pt   Point
endVar

const
   LETTER_HT = 15840  ; 11" x 1440
   LEGAL_HT  = 20160  ; 14" x 1440
endConst

   rpt.load( "custlegal.rsl" )
   uio.attach( rpt )

   pt = uio.PageSize

   if pt.y() = LEGAL_HT then
      pt.setY( LETTER_HT )
      uio.PageSize = pt
   endIf

   rpt.DesignModified = FALSE;
   rpt.run()

endMethod

As you can see, PageSize is a property of the Report object. It takes a Point value expressing the new paper size in twips (1 twip = 1/1440 inches). Thus, to set the page size to standard US letter, you'd set the point's y() property to 15840.

Also, note that the code also sets the Report's DesignModified property to FALSE. The keeps Paradox from prompting the user to save the changes. In turn, this lets you create a control document that doesn't change with each use.

Now, to adapt this for your use, I'd create a new form to prompt the user for a page size, determine the appropriate PageSize values from their choices, and assign the results to the report's PageSize property before previewing the report.

Now, I should warn you that this may not work under Runtime, which deactivates the designers. To make this work under runtime, you might need to create sets of reports for each supported page size and then open the appropriate report for the chosen page size.

Hope this helps...

-- Lance
 
I'll have to try it out, to see what happens. But I only need one report as this report will be printed on pre-printed dot matrix paper.

The report self is fine so I just need to set the printers page size , so that the paper stops at the right place.

I'll go and play around with the code.

Thanks Lance.

Point of intrest: How long having you been in programming?
 
CleoMan,

>> Point of intrest: How long having you been in programming?

Well, I became interested in 8th grade (where I had access to a teletype plugged into the mainframe of the local community college), but have been programming professionally for about fifteen years or so. Of course, that includes stints as a tech writer, QA tester, support person, trainer, product manager, and so on. I suppose you could say I've had a pretty checkered career. :)

-- Lance
 
15 years is pretty exstensive (impressive).

Only started learning about 3 years ago. Still learning as it seems. So be patient ;-)

Thanks for your help so far!

 
CleoMan,

Well, it might not be all that impressive when you realize that that ten years ago (yikes!), I worked on the Paradox development team, though not as a programmer. That's how I learned the product so well. Well, that and using it to pay the rent for the first few years after leaving Borland. :)

You tend to pick up a few things when trying to use something in the real world. :-D

-- Lance
 
Does Paradox have a future? I noticed that the new Wordperfect has the same old Paradox and it seems that there is no development going on?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top