में डेटा स्रोत "उत्पाद_Detail" के लिए डेटा स्रोत उदाहरण प्रदान नहीं किया गया है, मैं एक रिपोर्ट में रिकॉर्ड प्रदर्शित करने की कोशिश कर रहा हूं। डेटा डेटासेट में है। लेकिन यह उनके लिए बाध्य नहीं है। फॉर्म लोड होने पर यह रिपोर्ट लेआउट दिखाता है। लेकिन जब मैं बटन पर क्लिक करता हूं तो यह त्रुटियां दिखाता है। नीचे मेरा कोड है।माइक्रोसॉफ्ट रिपोर्टिंग सेवा
using Microsoft.Reporting.WinForms;
//------------------------------------------------------------------
// <copyright company="Microsoft">
// Copyright (c) Microsoft. All rights reserved.
// </copyright>
//------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ReportsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.reportViewer1.RefreshReport();
}
private void button1_Click(object sender, EventArgs e)
{
System.Data.DataSet ds = GetDataSet();
//reportViewer1.LocalReport.ReportPath = "Report1.rdlc";
ReportDataSource rds = new ReportDataSource("ProductsDataSet", ds.Tables[0]);
this.reportViewer1.LocalReport.DataSources.Clear();
this.reportViewer1.LocalReport.DataSources.Add(rds);
this.bindingSource1.DataSource = rds;
this.reportViewer1.RefreshReport();
}
private System.Data.DataSet GetDataSet()
{
System.Data.SqlClient.SqlConnection sqlConn = new System.Data.SqlClient.SqlConnection("Data Source=DELL;Initial Catalog=Products;Integrated Security=True");
sqlConn.Open();
string sql= string.Format (@"select o.[User], o.OrderDate, o.Quantity, o.OrderDetail, c.ShopName, c.[Address], c.City, c.Ph, p.* from dbo.Clients c,dbo.Product_Service o,Product_D p,Junction j where o.ClientId = c.ClientId
and o.ProductId = j.ProductId
and j.PCode = p.PCode
and o.ClientId = 41
and o.OrderDate='11/9/2012';");
System.Data.SqlClient.SqlDataAdapter ad = new System.Data.SqlClient.SqlDataAdapter(sql, sqlConn);
System.Data.DataSet ds = new System.Data.DataSet();
ad.Fill(ds);
sqlConn.Close();
return ds;
}
}
}
मेरे डेटा सेट में मेरे पास 3 टेबल हैं। मैं रिपोर्टव्यूवर के शीर्ष पर बाइंड स्रोत का चयन करता हूं जहां एक छोटा तीर दिखाता है।
धन्यवाद। अब माइक्रोसॉफ्ट ने अपने त्रुटि संदेश में यह सुझाव क्यों नहीं लगाया। –