This is a migrated thread and some comments may be shown as answers.

dynamically Showing image in asp .net mvc telerik reporting

0 Answers 94 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
rafi asked on 09 Dec 2010, 06:34 PM
hi there,
i am consuming the telerik reporting in an ASP .NET MVC. Earlier i was showing a static image in the report.Now i want to show it dynamically. This image is located in the location "/Content/images/ReportImages" of ASP .NET MVC project.

in the asp .net mvc i have some(the view ) thing like this
  <div style="width: 700px; margin-left: auto; margin-right: auto;">
    <a href='/Patients/Show/<%= ViewData["PatientId"] %>' class="button">Current User</a><br />
    <br />
    <script runat="server">                      
      //protected override void OnPreRender(EventArgs e) {
      //  ReportViewer1.Report = new Report1();
      //  base.OnPreRender(e);
      public override void VerifyRenderingInServerForm(Control control) {
        // to avoid the server form (<form runat="server">) requirement
      protected override void OnLoad(EventArgs e) {
        // bind the report viewer
        var priliminaryReport = new PatientPriliminaryReport();
        priliminaryReport.ReportParameters["patientId"].Value = ViewData["PatientId"];
        priliminaryReport.ReportParameters["userId"].Value = ViewData["UserId"];
        ReportViewer1.Report = priliminaryReport;
    <form id="Form1" runat="server">
    <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="1100px" Width="700px">

And Here is the reporting class

namespace Faq.Reports {
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;
    /// <summary>
    /// Summary description for PatientPriliminaryReport.
    /// </summary>
    public partial class PatientPriliminaryReport : Telerik.Reporting.Report {
        public PatientPriliminaryReport() {
            // Required for telerik Reporting designer support
            // TODO: Add any constructor code after InitializeComponent call

The report contains a "Picture Box" with name "pictureBox1" .

i have already seen some solutions . But as i only aware of MVC frame work . i could not understand the events stuff. so

Can you please help me with this ,keeping my existing code in mind.


No answers yet. Maybe you can help?

General Discussions
Asked by
Top achievements
Rank 1
Share this question