Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i am tryaing to create rdlc report for print, i can't find existing datasource namespace in forms,

The Error is error The name 'itemsbindingsource' does not exist in the current context

What I have tried:

step1: I created Items Cass

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace test_project
{
public class Items
{
public int ID { get; set; }
public int Item_Group { get; set; }
public string Item_Name { get; set; }
public int Price { get; set; }
}
}

step2 : created Form1 to add data and view data in gridview tabel.

in this form Datagridview data source i have choosen through Object and get fields from Items class, by defualt "itemsBindingSource" name is gearated.

step3 : created Report1.rdlc for to print which i have add items in Form1

step4 : created Form2 for report1 view


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 test_project
{
public partial class frmPrint : Form
{

List<items> _list;
string _total;

public frmPrint(List<items> datasource, string total)
{
InitializeComponent();
_list = datasource;
_total = total;

}


private void frmPrint_Load(object sender, EventArgs e)
{
// hear i can't find existing datasource name
itemsBindingSource.Datasource = _list;
this.reportViewer1.RefreshReport();
}
}

}



pls help. me

i was following this video link

"https://www.youtube.com/watch?v=JoiLvAmksco"

i was spend 15days time to solve this, but i coudn't..

even crystal report also i was tried in that also same problem

these are my aplication configuration details

Visual Studio 2013 Ultimate

OS is windows 8.1
Posted
Updated 13-Dec-17 5:19am

1 solution

Stop wasting time on Youtube and look at the documentation: BindingSource.Item Property (Int32) (System.Windows.Forms)[^].
 
Share this answer
 
Comments
Member 11917879 22-Dec-17 2:27am    
i got solution
just i did change the gridview-properties-design-modifier and change from pravate to public..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900