Aleniko29139


I have a report which has a dynamic number of columns. I need to print it in landscape or portrait depending on the number of columns. Anyone can suggest how I would programatically set the report to print in landscape

Thanks.



Re: Programatically set report to print in landscape

CDFAUX


if the report is saved previously, try this code: (1=landscape)

UPDATE YourReport.frx set expr = STRTRAN(expr,"ORIENTATION=0","ORIENTATION=1") WHERE objtype = 1

USE &&close report table






Re: Programatically set report to print in landscape

dni

The most of printers ask automatically to ajust paper orientation, depending on printer driver.





Re: Programatically set report to print in landscape

Aleniko

I need to set the report to landscape / portrait without user intervention.

Also, editing the FRX file is not a good idea because we're in a multi user environment and I don't think this is a good solution.

Isn't there a way to do this programatically

Thx.




Re: Programatically set report to print in landscape

Don Higgins

He already gave you an answer. There is only one way to do this, other than asking the end user to click a few options, which you said you did not want.






Re: Programatically set report to print in landscape

CChalom

Have a new look at what CDFAUX suggested in a previous message.

You can exclude the report files (FRX and FRT) from your project.

Before printing, copy both files to some temp new copies. Open the copy of the FRX as table, something like

USE MyTempReport.frx

UPDATE MyTempReport.frx set expr = STRTRAN(expr,"ORIENTATION=0","ORIENTATION=1") WHERE objtype = 1

USE &&close report table

* After that, all you need is done

* Call your Temporary copy of the report like this

REPORT FORM MyTempReport.frx PREVIEW

Enjoy !





Re: Programatically set report to print in landscape

Aleniko

I thank you all for you help. I did know I can edit the report file and same goes for making a temporary report file. For some reason I thought there must be a more direct way to do this. But creating / updating a temp report should do it.

Thank again.