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!

data report creation

Status
Not open for further replies.

oluwa

Programmer
Aug 29, 2002
12
CA
Hi, i will like to know how to create a data reports in landscape format using data reports
 
Portrait:
Code:
DataReport1.Orientation = 1

Landscape:
Code:
DataReport1.Orientation = 2

Then adjust your report's dimensions to accomodate for the different print area. --
Jonathan
 
Hi,
i have already tried that and it didn't work. What am i still doing wrong?
Thanks.
 
I seem to recall that you need to set the printer orientation as well, as the Datareport looks at default printer orienttation to decide if the layout is within the printer bounds.

I think I had to use

Printer.Orientation = 2
Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Hi,

It didn't work. What am i still doing wrong.
Thanks.
 
What does your code look like?

I use this in the calling module:
Code:
'first setup up your recordset as rst - then 
Printer.Orientation = 2
Set dr1.DataSource = rst
dr1.Show
Then in the Datareport code:
Code:
Private Sub DataReport_Initialize()
Me.Orientation = 2
End Sub


As Suraklyn says, you still have to setup your report to the right dimensions. I've found that Datareport.Width = 15360 works for me to get full width on A4 landscape
Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Hi,
DataReports have no orientation property.
How do i set paper size.
DataReport1.width
affects DataReport object and not the paper width.

Thanks.
 
Although the documentation for datareport doesn't show an orientation property doesn't mean that it doesn't work.

If I rem out the line shown in DataReport_Initialize()
event, then my app gives error msgbox 'Report width is larger than paper width'.

If you have actually tried this code and it doesn't work then we may have a different problem Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Hi,
My code is similar to yours,I even tried out yours but it didn't solve the poblem.

What else am i suppose to do.

Thanks.

 
I found the same thing - the code had apparently been working and now it's just stopped!


I found the following site, and the explanation and code there has solved my problem.
Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
I've had another look and remembered that I've just re-installed VB6 and hadn't got round to the SP5 install.

When I did SP5 the Datareport.Orientation works again.
Apologies for my stupidity! Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Hi, Thanks for sticking by me all the while, the code that was at the link you gave me work, but i wont mind doing it your way which seems shorter.

I am new to VB6 and dont know what the sp5 it. Could you please explain and tell me how to go about it
 
Go to this website:

and download the service pack Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top