?
Solved

Crystal Reports XI Viewer, size to percent or screen ?

Posted on 2006-11-30
7
Medium Priority
?
800 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 101

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 101

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 2000 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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

765 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