12

If possible, I would like to do this with a simple button. The users are not terribly comfortable with computers, which is why I haven't just told them to print screen or use the snipping tool.

I know it can be done in Mozilla-based browsers with <canvas> and drawWindow(). But this application is running on Internet Explorer 7 and 8.

The page shows some graphs (generated by a ReportViewer control) based on the input of a couple of dropdowns. Does that mean a client-side script is the only option? Or could I do it in the ASP.NET back end somehow? Perhaps re-generating an image any time the dropdowns are changed?
(I've been a desktop dev for so long that I don't quite "get" what you can and can't do in web apps yet.)

Community
  • 1
  • 1
Michael Myers
  • 188,989
  • 46
  • 291
  • 292
  • 1
    I haven't used the reportviewer control, so I won't post this as an answer...but a quick google search suggests that there is a PDF export capability built in. I would think you can just get the combobox values and generate the PDF server-side for them. – Ocelot20 May 03 '11 at 15:30
  • Good idea. But I would like for some of the surrounding area of the page to be visible in the image also; perhaps I can do some manipulation server-side with it. – Michael Myers May 03 '11 at 15:34
  • 1
    Iframes should be the way to go, you can also use a javascript based library that creates its own canvas for your grpah, e.g. [Raphael](http://raphaeljs.com) – Chibueze Opata Sep 01 '12 at 09:14

1 Answers1

4

From what I understand you've got some drop downs and you're generating a graph based on the input of those drop downs by the user?

So if I was doing this with PHP (just trying to give you ideas here, dunno whats possible and what's not in ASP) I would create an image magic or gdb library script that builds a jpeg based on the variables input in a querystring.

For instance this would output a jpeg image of a simple graph with 3 points on it:

http://mydomain.org/image.php?value1=10&value2=20&value3=30

Then for the front end of my script I would probably use jquery/ajax to call that script and show the image as the user is changing the values.

Then you have an image that you can potentially force download or instruct users to right click and choose "save as".

Anyway, this is just an idea, not a solution. I don't know about ASP.NET, but this is how I would do it in PHP.

Thomas Clayson
  • 29,657
  • 26
  • 147
  • 224