I have a product table id int and name varchar 50 I also have a picture table id int productid int buyukyol varchar 50
product id -------------- the picture is very related to the product id 1 to 1
product id=1 image productid=1 bigpath=/images/1.jpg
product id=1 image productid=1 bigpath=/images/2.jpg
product id=1 image productid=1 bigpath=/images/3.jpg
Now I created a mydataset.xsd file and created two datatables with datatable add.
There are two variables named id and name, one in datatable1, and the other in datatable2, there are 3 variables called id, product, id, buyukyol. I did not use a dataadaptor here. I will do everything in action.
Now I created a report with add, I called its data source mydataset, I brought the id and name names under the name of Onurur in the dataset, I associated it with datatable1, again with add I brought the names of id, urunid, bigpath under the name of picturem, I did not add a field to show the picture, there are 3 fields in total, all four columns, I associated them with datatable2.
Then I placed 2 table elements in the report, I added id to the first column and name to the second column.
I added id to the first column of the 2nd table, productid to the second, and buyukyol to the third.
I added an image element to the 4th, then I said external to the image data source of the image element. use this image with expr in the field header = "~ /pictures/" + Fields!buyukyol.Value I said this because there is a folder called images in my project, the images are kept in it, not in the image table that is the database, there is only a path in the bigpath variable, line by line as 1.jpg 2.png in the variable named bigyol of the image table.
My aim is to list the id selected in the product table and the records and images related to it.
In short, all the records appear fine, the relationship is perfect, but the image element appears empty, however, according to this logic = "~/images/" + Fields!buyukyol.Value
This sentence sounds like this: Fields!buyukyol.Value=1.jpg,
meaning these pictures/1jpg, I checked but for some reason the picture cannot come from the pictures folder.
Yes, I checked, but for some reason the picture cannot come from the pictures folder.
action
deger = Request.QueryString["bulid"];
if (!Page.IsPostBack)
{
string connectionString = @"Data Source=DESKTOP-1B3OQRL;Initial Catalog=ibroz;Integrated Security=True";
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlDataAdapter da = new SqlDataAdapter("SELECT urun.*, resim.* FROM urun INNER JOIN resim ON urun.id = resim.urunid WHERE urun.id='" + deger + "'", connection);
DataTable dtUrun = new DataTable();
DataTable dtResim = new DataTable();
da.Fill(dtUrun);
da.Fill(dtResim);
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = Server.MapPath("report1.rdlc");
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("onururun", dtUrun));
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("resimm", dtResim));
ReportViewer1.LocalReport.EnableExternalImages = true;
ReportViewer1.LocalReport.Refresh();
}