Link to home
Start Free TrialLog in
Avatar of sourcelink
sourcelink

asked on

Crystal Reports XI Viewer, size to percent or screen ?


Hello, I have a vb .net 2003 application using CR XI viewer to display reports.  when the user increases the magnification, I increase the viewer width with the code below.  

I can only get it to work with the units in pixels: Me.crViewer1.Width = System.Web.UI.WebControls.Unit.Pixel(800)
This will not work: Me.crViewer1.Width = System.Web.UI.WebControls.Unit.Percentage(100)

If I use the percentage it sizes to 100 pixels instead of 100%.  Ive tried .Percentage(100) and .Percentage(100%)

Here's the code:  Every thing works but the case else.

    Private Sub crViewer1_ViewZoom(ByVal source As Object, ByVal e As CrystalDecisions.Web.ZoomEventArgs) Handles crViewer1.ViewZoom

        Me.crViewer1.BestFitPage = False

        Select Case e.NewZoomFactor

            Case 100
                Me.crViewer1.BestFitPage = True

            Case 125
                Me.crViewer1.Width = System.Web.UI.WebControls.Unit.Pixel(1100)
                Me.crViewer1.Height = System.Web.UI.WebControls.Unit.Pixel(1100)

            Case 150
                Me.crViewer1.Width = System.Web.UI.WebControls.Unit.Pixel(1400)
                Me.crViewer1.Height = System.Web.UI.WebControls.Unit.Pixel(1400)

            Case Else
                Me.crViewer1.Width = System.Web.UI.WebControls.Unit.Percentage(100)
                Me.crViewer1.Height = System.Web.UI.WebControls.Unit.Percentage(100)

        End Select

    End Sub

this is the link that I used:
http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2016117&sliceId=&dialogID=10458781&stateId=1%200%2010460751

Thanks for any help.

Avatar of Mike McCracken
Mike McCracken

It would probably be better to ask this in the VB.Net TA.

mlmcc
You could write a user function that takes the percentage as an input parameter, and converts it to pixels, then use the WebControls.Unit.Pixel technique.
Avatar of sourcelink

ASKER


Thanks mhunts for your response,

This is probably a dumb question, but how do I know on the server side, what the client resolution is?

Thanks!

ASKER CERTIFIED SOLUTION
Avatar of mhunts
mhunts

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial