So zeigen Sie ein Bild aus der Datenbank im RDLC-Bericht anC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 So zeigen Sie ein Bild aus der Datenbank im RDLC-Bericht an

Post by Anonymous »

Mein RDLC-Design:

Image


Ich möchte in meinem Report Viewer ein Bild aus meiner Datenbank anzeigen. Mein Report Viewer funktioniert einwandfrei. Ich brauche nur ein Bild für jede Auswahl und ich habe bereits Bilder in meiner Datenbank für jeden Patienten, den ich nur zeigen möchte dass ich hier in meiner .aspx-Seite auch den folgenden Code angehängt habe.

Meine Aspx-Seite:

Code: Select all







    





















Meine CS-Datei:
Ich möchte ein Bild aus meiner Datenbank im Report Viewer anzeigen

Der Code hinter der ASPX-Seite ist hier

Code: Select all

public partial class PatientReport : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
populateDropDownPat();
}
}
private void populateDropDownPat()
{
try
{
patientCollection pcal = (new patientBAL()).GetAllDetailspatient();
DropDownPat.DataSource = null;
DropDownPat.DataSource = pcal;
DropDownPat.DataTextField = "patientName";
DropDownPat.DataValueField = "PatientID";
DropDownPat.DataBind();
DropDownPat.Items.Insert(0, new ListItem("--Select Patient--"));
}
catch(Exception ex)
{
}
}
protected void DropDownPat_SelectedIndexChanged(object sender, EventArgs e)
{
string name = DropDownPat.SelectedItem.Text;
patientCollection pcal = (new
patientBAL()).GetDetailsByPatientName(name);
ReportViewer1.Visible = true;
this.ReportViewer1.LocalReport.EnableExternalImages = true;
this.ReportViewer1.LocalReport.ReportPath = "Report1.rdlc";
ReportViewer1.LocalReport.DataSources.Clear();
ReportDataSource rds = new ReportDataSource("DataSet1", pcal);
this.ReportViewer1.LocalReport.DataSources.Add(rds);
this.ReportViewer1.LocalReport.Refresh();
}
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post