cancel
Showing results for 
Search instead for 
Did you mean: 

Zoom report from javascript?

Former Member
0 Kudos

Hey guys,

Is there any way to zoom the report from javascript/jquery?


Other functions like print, export or search can be called by "clicking" the button from javascript like this:

<script type ="text/javascript">

  function ExportReport()

  {

     document.getElementById('CRViewer_toptoolbar_export').click();

  }

</script>

And I want to use the zoom control from javascript/jquery. The value can be changed with that:

$('input[name="text_CRViewer_toptoolbar_zoom"]').val("125%");

But I have no idea to "confirm" or "submit" this input field.

Any ideas?

Kind regards

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Andy,

I moved you post to the Java SDK forum.

Have you tried looking at the SDK Doc's? Should be a link on the Overview Tab. If not the latest are always on help.sap.com

Don

Former Member
0 Kudos

Hey Don,

thanks for moving but I develop in C# .NET

Okay, I forgot these information in my first post.

However I cant find anything about Javascript in the .NET or java documentation.

I know the "Zoom"-method and the "PageZoomFactor"-property in C# but this is not what I am looking for... I just want to perform a zoom with Javascript-Code.

You know what I mean?

Andy

0 Kudos

Hi Andy,

I moved you post back to .NET Forum. Would be handy to know what Version of CR SDK you are using also, kind of important to know also....

So you are looking for a trigger event or click event on the CR viewers Zoom button?

Have you tried clicking on the Lightning bolt on the viewer properties?

And rather than guessing as to why you want to use Java to do the same or why you need to use Java or why you can't use the Viewers Event, please explain what the end result is...

In the ViewZoom event you could hook into your Java script that way, I think....

Don

Former Member
0 Kudos

Hey Don,

I use CR SDK 13.0.10.1385.

And yes, I am looking for a trigger for the Zoom function.

Look at this screenshot how I handle other functions:

http://fs1.directupload.net/images/150828/ldeo95lu.png

With the Javascript-code inside the purple box I can change the value of the input-field (e.g. from 100% to 175%). But this will not trigger the "submit" or "change" function. I will need to click inside this input field and press Enter to submit the new zoom factor.

I have no chance to handle the zoom function from C# code behind... I have to handle it client side with Javascript (jQuery, ...)

Andy

0 Kudos

Hi Andy,

So what you want to do is when the user submits a search you want to zoom the page?

In VS if you click on the CR Viewer and then the lightening bolt to see the list of events you can catch can you use the Search and Zoom events?

Those should be client side.

So in the Search event add this line:

CrystalReportViewer1.Zoom(120); // will zoom to 120%

Is that what you are trying to do?

Don

Answers (0)