NetTalk Central

Author Topic: Select different print procedures at run-time  (Read 3577 times)

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Select different print procedures at run-time
« on: June 07, 2016, 12:02:54 AM »
Hi,

I have a browse with a print-button.
This calls a report procedure and generates a pdf report.
Now I need at run time to select between this report in portrait or landscape.
So either I need to be able to select between two reports laid out in either orientation OR I need to be able to change a given reports orientation at runtime based on a condition.

Any thoughts about how to go about this ?

TIA
/Poul

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Select different print procedures at run-time
« Reply #1 on: June 07, 2016, 01:57:05 AM »
Ideally you want 1 report which does both, especially if it's just a "sizing" thing. It's a bit of hand-code to change the landscape property, then adjust all the size properties, and column widths, but at least you only have 1 report to maintain.

If the 2 reports are different, ie have different columns, then I would probably use a normal Clarion Source procedure (let's call this the "report") which takes the p_web parameter. Then some decision code in here to select which one of 2 report procedures (passing p_web onto them.)

cheers
Bruce

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Re: Select different print procedures at run-time
« Reply #2 on: June 08, 2016, 07:18:59 AM »
Thanks Bruce,

I ended up doing two report procedures and then having two print buttons, where one or the other button was shown based on a condition.

Cheers
/Poul