Quantcast
Channel: C#nedir?com Forum
Viewing all articles
Browse latest Browse all 613

ASP.NET : MVC Controllerdan Web Forma Veri Gönderme

$
0
0
Author: cakewalk
Subject: MVC Controllerdan Web Forma Veri Gönderme
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;

}

}

 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 613

Trending Articles