Solved

Crystal Reports XI Viewer, size to percent or screen ?

Posted on 2006-11-30
7
760 Views
Last Modified: 2012-08-13

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.

0
Comment
Question by:sourcelink
  • 2
  • 2
7 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 18051079
It would probably be better to ask this in the VB.Net TA.

mlmcc
0
 
LVL 8

Expert Comment

by:mhunts
ID: 18062212
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.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18063907
0
 

Author Comment

by:sourcelink
ID: 18069660

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!

0
 
LVL 8

Accepted Solution

by:
mhunts earned 500 total points
ID: 18072242
The server can't know what the client resolution is, unless the client passes it explicitly.

However, if you look at your program, which works, except for the else, you have:

125% mapping to a resolution of 1100 pixels
150% mapping to a resolution of 1400 pixels
else you want to map to 100%

So when you select 125% zoom, you're assuming that 100% resolution is 880 (1100 / 125%), and
when you select 150% zoom, you're assuming that 100% resolution is 933 (1400 / 150%)

Instead of the else statement you have, why don't you use either 880 or 933 as your 100% scaling, and use the pixel measurement. What I mean is:

            Case Else
                Me.crViewer1.Width = System.Web.UI.WebControls.Unit.Pixel(800)
                Me.crViewer1.Height = System.Web.UI.WebControls.Unit.Pixel(800)

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

13 Experts available now in Live!

Get 1:1 Help Now