Print Page | Close Window

MVC Controllerdan Web Forma Veri Gönderme

Printed From: C#nedir?com
Category: ASP.NET
Forum Name: ASP.NET
Forum Description: ASP.NET
URL: http://forum.csharpnedir.com/forum_posts.asp?TID=81999
Printed Date: 07 Aralık 2021 at 13:07
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: MVC Controllerdan Web Forma Veri Gönderme
Posted By: cakewalk
Subject: MVC Controllerdan Web Forma Veri Gönderme
Date Posted: 10 Nisan 2020 at 14:23
Controllerda oluşturduğum bu 3 datatable' ı web formdaki reportviewer ile ilişkilendirmek ve rdlc göstermek istiyorum.
Aslında şu an çalıştırıyorum fakat datable ı controllerda oluşturup web forma göndermek istiyorum.
Çünkü datayı dropdownlistler ile filtreleyip göstermek isteyebilirim.
 
Bunu nasıl yaparım. Yardımınızı rica ederim.
 
CONTROLLER (cs)

public DataTable Sorgu_PuanCetveli()

{

baglanti2.Open();

SqlDataAdapter adap = new SqlDataAdapter("select * from TakimTurnuvaPuanCetveliView", baglanti2);

DataTable tbl3 = new DataTable();

adap.Fill(tbl3);

baglanti2.Close();

Response.Redirect("TakimTurnuvaAnaSayfa.aspx");

return tbl3;

}

public DataTable Sorgu_MusabakaSonuclari()

{

baglanti2.Open();

SqlDataAdapter adap = new SqlDataAdapter("select * from MusabakaSonuclariView", baglanti2);

DataTable tbl3 = new DataTable();

adap.Fill(tbl3);

baglanti2.Close();

return tbl3;}

public DataTable Sorgu_Fikstur()

{

baglanti2.Open();

SqlDataAdapter adap = new SqlDataAdapter("select * from TakimTurnuvaFiksturView", baglanti2);

DataTable tbl3 = new DataTable();

adap.Fill(tbl3);

baglanti2.Close();

return 

 tbl3;}

 
**********************
 
WEB FORM (aspx.)

void Page_Load(object sender, EventArgs e)

{       

if (!IsPostBack)

{

SQL_Takimlar baglanti = new SQL_Takimlar();

ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/RPTReports/TakımTurnuvaReport.rdlc");

ReportViewer1.LocalReport.DataSources.Clear();

ReportDataSource rdc1 = new ReportDataSource("MasTesDBPuanCetveliDataSet", baglanti.Sorgu_PuanCetveli());

ReportDataSource rdc2 = new ReportDataSource("MasTesDB_MusabakaSonuclariDataset", baglanti.Sorgu_MusabakaSonuclari());

ReportDataSource rdc3 = new ReportDataSource("MasTesDBFiksturDataSet", baglanti.Sorgu_Fikstur());

ReportViewer1.LocalReport.DataSources.Add(rdc1);

ReportViewer1.LocalReport.DataSources.Add(rdc2);

ReportViewer1.LocalReport.DataSources.Add(rdc3);

ReportViewer1.LocalReport.Refresh();

ReportViewer1.AsyncRendering = false;

}

}

 

 

 

 

 

 

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk