We help IT Professionals succeed at work.

Data Reports width Error

N_K_venkat
N_K_venkat asked
on
How to change report size in data reports.its giving an error called "Report width is larger than the paper width"
How to solve this problem.
Thanks in advance
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2012
Commented:
Check the article on MSDN at

http://support.microsoft.com/support/kb/articles/Q261/1/93.ASP

and titled:
FIX: Error Message "Report Width is Larger Than the Paper Width" When Showing Data Report in Landscape

SYMPTOMS
When using the Show method of Data Report to preview the report, the page orientation defaults to the default printer settings on the local computer. Therefore, if the orientation of the default printer settings is set to Portrait of standard Letter paper and your report width is more than 8.5 inches wide, the following error occurs:

Report Width is Larger than the Paper Width

CAUSE
This error occurs because the width of your report exceeds the maximum width specified by the default printer settings. The width of the report is determined by taking the sum of the RightMargin, LeftMargin, and ReportWidth properties.

When a report prints or displays, the default printer settings in the Printers Folders are used to determine the layout of the report. If your default printer orientation is set up to be Portrait of standard Letter paper and you design a report that extends beyond 8.5 inches wide, the preceding error occurs.

NOTE: The LeftMargin, RightMargin, and ReportWidth properties are denoted in twips, and 1440 twips equate to 1 inch.



RESOLUTION
Microsoft Visual Studio 6.0 Service Pack 4 introduces a new property called Orientation for Data Report. The value for this property is:

rptOrientDefault = 0
rptOrientPortrait = 1
rptOrientLandscape = 2
With this property, you are able to tell the Data Report not to use the orientation setting of the default printer in the Printers Folders. Following is the syntax for implementing the Orientation property:

DataReport1.Orientation = rptOrientLandscape
DataReport1.Show
When you use this new Orientation property in Visual Studio 6.0 Service Pack 4, you may encounter the error below:
Compiler Error
Method or Data member not found.
To fix this error, delete the values for DataMember and DataSource properties of the Data Report and reassign these two properties with the original values.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual Studio 6.0 Service Pack 5.

For additional information about Visual Studio service packs, click the article numbers below to view the articles in the Microsoft Knowledge Base:

Q194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why
Q194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed
You can download Visual Studio Service Pack 5 from the following Microsoft Web site:
Visual Studio Product Updates



MORE INFORMATION

Steps to Reproduce Behavior
Locate the default printer settings in Printers Folders on Windows. Make sure that the page orientation is set to Portrait of standard Letter paper.


Create a new Visual Basic Standard EXE project. Form1 is created by default.


Add a Command button to Form1.


Paste the following code into Form1's code window:



Option Explicit

Private Sub Command1_Click()
  DataReport1.Show
End Sub
From the Project menu, select Add Data Environment. DataEnvironment1 is added by default.


In DataEnvironment1, right-click on Connection1 and choose Properties. Set the properties of Connection1 to be the following:


On the Provider tab, set Provider to Microsoft Jet 4.0 OLE DB Provider.


Click Next.


On the Connection tab, set the database name to NWIND.MDB, which should be in the folder where Visual Basic 6.0 is installed.


Click on Test Connection to make sure you are connected to the database, and then click OK.


Right-click on Connection1 and choose Add Command. Command1 is added by default.


Right-click on Command1 and select Properties. Set the properties of Command1 to be the following:


On the General tab, change the Database object to Table.


On the Object Name combo box, select Employees, and then click OK.


From the Project menu, select Add Data Report. DataReport1 is added by default.


Set the properties of DataReport1 to be the following:


Set the DataSource property to DataEnvironment1.


Set the DataMember property to Command1.


Set the ReportWidth property to 11520 (8 inches).


Set the LeftMargin property to 1440 (1 inch).


Set the RightMargin property to 1440 (1 inch).


If you add ReportWidth, LeftMargin and RightMargin, you can see that the total report width is 10 inches, which is wider than 8.5 inches. So the Data Report should be placed on Landscape orientation of a standard Letter paper.


Press the F5 key to run the program.


Click on Command1, and note that the error message in the "Symptoms" section of this article occurs.


Steps to Fix the Problem in Visual Studio 6.0 Service Pack 4
Open the preceding project in Visual Studio 6.0 Service Pack 4.


Replace the code in Form1's code window with the following:



Option Explicit

Private Sub Command1_Click()
  DataReport1.Orientation = rptOrientLandscape
  DataReport1.Show
End Sub
Delete the values for the DataMember and DataSource properties of DataReport1.


Reassign the DataMember and DataSource properties of DataReport1 to be the following:


Set the DataSource property to DataEnvironment1.


Set the DataMember property to Command1.


Press F5 to run the program.


Click the Command1 button and note that DataReport1 is shown in Landscape orientation.





REFERENCES
This article fixes the problem addressed in the following article:

Q197915 PRB: Report Width is Larger than the Paper Width
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20106428.html
http://www.experts-exchange.com/questions/Q.20162135.html
http://www.experts-exchange.com/questions/Q.20164399.html
http://www.experts-exchange.com/questions/Q.20165106.html
http://www.experts-exchange.com/questions/Q.20193420.html
http://www.experts-exchange.com/questions/Q.20262325.html
http://www.experts-exchange.com/questions/Q.20267916.html
http://www.experts-exchange.com/questions/Q.20281031.html
http://www.experts-exchange.com/questions/Q.20285275.html
http://www.experts-exchange.com/questions/Q.20291239.html
http://www.experts-exchange.com/questions/Q.20292191.html
http://www.experts-exchange.com/questions/Q.20292203.html



*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
Thanks for returning and finalizing these questions, however the few I've viewed are "C" grades and no comments from you as to why.  Can you please tell us?  If this was graded in error, I can correct this for you.

More about grading here:
http://www.experts-exchange.com/new_users/Q_20310437.html

Moondancer - EE Moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.