on 09-12-2008 2:59 PM
I have a report that is 20 inches wide. When I open the viewer, the right side is cut off. Is there a way to change the page width in the viewer?
Thanks....Linda
Hi, Linda;
Can you provide a bit more information? What version of Crystal Reports are you working with? Is this a web or windows based application? What language are you developing your application in?
Regards,
Jonathan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sample code that calls the viewer:
Public Overloads Sub ShowReport(ByVal path As String, _
ByVal parameters As ArrayList, _
Optional ByVal formCaption As String = "Report Viewer")
Dim splashScreen As Csg.Reporting.CrystalManager.frmSplash = New Csg.Reporting.CrystalManager.frmSplash
Try
splashScreen.Show()
System.Windows.Forms.Application.DoEvents()
Dim myReport As ReportDocument = New ReportDocument
myReport.Load(path, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)
'create a new report database table object
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
'create a new logon info object
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
'Note: this code loops through each table in the report, but Customers.rpt
'was designed off of only one table, the Customers table. Therefore, this
'loop is not really needed, and one could reference
'rdCustomers.Database.Tables(0). The loop is provided for flexibility,
'if a report created off of more than one table was used.
'for each table in the tables collection of the report
For Each tbCurrent In myReport.Database.Tables
'get the logon info
tliCurrent = tbCurrent.LogOnInfo
'with the logon info's ConnectionInfo object
With tliCurrent.ConnectionInfo
'change the connection info to point to the Xtreme_small.mdb
'Access database located in the current application directory
'Note: for Access databases, the .ServerName property points
'to the .mdb file and the .DatabaseName property is blank.
'(UserID is "Admin" with a blank password for this database.)
'For SQL Server and other databases, the .ServerName property
'is the database server name and the .DatabaseName is the name
'of the database. .UserID and .Password are the userID and password
'needed to connect to the database.
.DatabaseName = DatabaseName
.UserID = ""
.Password = ""
.ServerName = ServerName
End With
'apply changes made to the TableLogonInfo object
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
If Not (parameters Is Nothing) Then
SetCurrentValuesForParameterField(myReport, parameters)
End If
Dim frm As New ReportDisplay
frm.CrystalReportViewer1.ReportSource = myReport
frm.CrystalReportViewer1.ShowRefreshButton = False
frm.Text = formCaption
frm.StartPosition = Windows.Forms.FormStartPosition.CenterScreen
frm.Show()
splashScreen.Close()
Catch ex As Exception
splashScreen.Close()
Throw New ApplicationException(ex.Message, ex.InnerException)
End Try
End Sub
Hi Linda,
Is the printer with the customer paper size your default printer? If not then you have a few options, check off Use Default printer in the report menu File, Page Setup and test again.
Or
It may be possible the problem is the permissions or user your app is running under, it may not be able to see the printer you installed. Microsoft has kbase articles that explain how to configure printers so all users including the local system account has access to them.
By default if CR cannot find a default printer or the default printer the report was used when designed we use Microsoft's Generic Print driver and reset the orientation to 8 1/2 x 11.
Thank you
Don
Hi Linda,
That's odd, it may be the custom paper size enum is incorrect. I'm going to attach a test app that is based on micosoft's printer kabase article. Search for DEVCAP on MS's site if this doesn't work. Thi sis all MS API's, one of guys here simply wrote the app to verify the issues.
Run the app and select your printer, the custom paper size should be seen, if not there is an issue with the printer driver.
If you print this from the viewer using our print button and selecting the custom paper size does that work?
Thank you
Don
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.