Solved

Adjust Paper width and printer option in VB6 DataReport

Posted on 2009-06-30
5
1,671 Views
Last Modified: 2013-11-26
How can I change the page width of the DataReport and also make it print directly to the printer instead of the screen first?

At this point we have problem that we can' increase the width to print it Landscape and keeps giving me error:

---------------------------
Error
---------------------------
Report width is larger than the paper width
---------------------------
OK  
---------------------------
0
Comment
Question by:rayluvs
  • 3
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
3_S earned 500 total points
ID: 24756645
To print directly instead of display on screen
do not use datareport.show
but

datareport.PrintReport
While datareport.AsyncCount > 0
      DoEvents
Wend

The loop with the doevents must be added else if you print other reports directly after, you will get missing pages. (some pages will not be printed) So add the loop directly after the printreport.

To avoid you report width error, try setting the printer you want to use as default printer before calling the report.
0
 

Author Comment

by:rayluvs
ID: 24756699
ok

What about the Page Width?
0
 
LVL 10

Assisted Solution

by:3_S
3_S earned 500 total points
ID: 24756993
Check your service pack of VB
http://support.microsoft.com/kb/261193 or http://support.microsoft.com/kb/253555 for additional info
latest sp can be downloaded from microsoft filename : Vs6sp6B.exe
0
 

Author Comment

by:rayluvs
ID: 24762724
I have the lates SP6.

Thanx "DataReport1.Orientation = rptOrientLandscape" worked.

Is that the only option for width, just the orientation?  

I mean what if I need to print to a receipt printer which is 4", that is 40 column.  Is there a way to work with that?
0
 

Author Comment

by:rayluvs
ID: 24766489
I'll close this question

Thanx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now