0

All:

Here is the information about my Web Application development environment:

-Microsoft Visual Studio Professional 2013

-.NET Framework 4.0

I've installed the following:

-Microsoft Report Viewer 2012 Runtime

-Microsoft Report Viewer 2010 SP1 WebForms

-jqPlot Charts version: 1.0.8 revision: 1250

For the application that we develop at work, we are able to generate a Graph using jqPlot.

jqPlot will place the graph that is generated in the following div section within an ASPX page:

<div id="chartdiv" ></div>

However, one of the requirements for the project is to ensure that the graph can also be placed in PDF file if the user wants to generate a pdf using Microsoft ASP.NET Report Definition Language Client-side (rdlc) and Microsoft ReportViewer technology.

1) Would it be possible to some how directly you get the jqPlot graph as an image into a pdf file?

If no, I have figured out how to make use of jqPlot's API to create an image in another div section of the same ASPX page.

I just wanted to briefly describe the code:

  <div id="chartdiv" ></div>


  var imgelem = $('#chartdiv').jqplotToImageElem();

2) Is it possible to send the imgelem variable which references an image to the Microsoft ReportViewer rdlc file? If yes, could someone please give me a high-level stepy-by-step plan as to how I should go about implementing such a feature?

4

1 回答 1

1

看看这篇文章:

http://www.aspsnippets.com/Articles/Dynamically-add-and-display-external-Image-in-RDLC-Report-from-code-behind-in-ASPNet.aspx

可以通过将reportParameter 传递给您的报表查看器来注入图像:

    ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report.rdlc");
    ReportViewer1.LocalReport.EnableExternalImages = true;
    string imagePath = new Uri(Server.MapPath("~/images/Mudassar.jpg")).AbsoluteUri;
    ReportParameter parameter = new ReportParameter("ImagePath", imagePath);
    ReportViewer1.LocalReport.SetParameters(parameter);
    ReportViewer1.LocalReport.Refresh();
于 2015-12-09T16:48:58.597 回答