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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing data report in landscape

Status
Not open for further replies.

RiverGuy

Programmer
Jul 18, 2002
5,011
US
Does anyone know how to print a data report in landscape from code? Using syntax similar to datareport1.printreport. But I would like it to default to landscape every time.

Thanks
 
This should set the Orientation to Portrait/Landscape. After it's set, just print/preview your report as normal.

Portrait:

Code:
DataReport1.Orientation = 0

Landscape:

Code:
DataReport1.Orientation = 1
--
Jonathan
 
Are you sure its not a property within a propert? I get member not defined when I use "Orientation"

Thanks Jonathan
 
I'm sorry, I did make a mistake there.

Portrait:
Code:
DataReport1.Orientation = 1

Landscape:
Code:
DataReport1.Orientation = 2

I'm sure it's not a property within a property. Just for grins, make sure Orientation is a property when you do
Code:
DataReport1.
in your code. Orientation should be listed in the "List Properties/Methods" list that pops up.

I have tested this, with success, on my own Data Reports built inside of Visual Basic. There was a bug with Visual Basic resetting itself to Portrait Orientation at one point; however, if you're using the latest Service Pack, you won't have that problem. If you're not running the latest SP, I would suggest downloading it.

VS6 SP5: --
Jonathan
 
I don't have that property listed at all. Maybe the latest service pack will have it. Unless there are other Data Report components I need to reference.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top