Click here to Skip to main content
15,887,869 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone , This is my First participation here, I have been reading from this site for while and i am really impressed by you people, Developers You are The Smartest creatures ever,
I am civil Engineer , However i am one of languages programming fans club
but i am really having a problem in this , I create a windows form application using c# and sql database
at the run time, i was able to add/delete columns in the datagridveiw ,and get that updated so that when I reopen the application the data are saved, i also was able to get a report viewer that i design statically by the wizard, however it only shows the column that was added in the design phase not the run time,
i am having a big fractured problem which is How can I display the modifications that occur to the data ( adding column or delete one ) at the run time in the report viewer

For example ( I designed the report to have three columns Name , LastName, money, and get the report successfully at the runtime,then I add some new columns say (Age,Country)
at the run time but when I tried to get the report I only got 3 columns (Name, LastName,Money) with updated Rows But not column

Please This is SO important
Posted
Updated 28-Sep-14 9:57am
v4
Comments
LLLLGGGG 28-Sep-14 16:31pm    
Please, post whatever you hqve tried. Even if it is incorrect or wrong because we can help you specifically with your problem...

LG
Azzam Alrandi 29-Sep-14 4:52am    
I have tried manythings
some of the post here and on another sites, one of them was converting the report to xml file to modify it and bind it with the data source , this is does not work with me due to lack of the information about doing this , another post was a whole project that does this but could not understand how to connect or to modify it or at least understand the concept since i am not professional developer
here is the link for the project it's on this great site

http://www.codeproject.com/Articles/705248/Generating-RDLC-Dynamically-for-the-Report-Viewer

1 solution

try one simple thing, After adding Age and Country, stop your application, rebind the data source(refresh it, so that it will bring updated data column) and try to run it.
 
Share this answer
 
Comments
Azzam Alrandi 29-Sep-14 4:47am    
First Of All Thank you for replying,
secondly have you tried this ?
I am sure that i am updating the data, ( not sure if it's the same database, or i am updating the dataset ), However when i reopen the application , the modified data appear which means that the data is updated , well if you have tried this would you illustrate more
Best Wishes
Leena 206 29-Sep-14 5:06am    
If you put some piece of code, It will be useful to detect problem.

Leena 206 29-Sep-14 5:05am    
yes .. I have faced same issue ...
In my case , I have updated SP in Database but did not updated content..
so solving this kind of issue, I again did binding of Modified SP with Code.
as u said, u are doing it with Wizard..so simply again bind new(modified) SP thro wizard..
Hope this will help u..
Azzam Alrandi 29-Sep-14 7:14am    
Hello Leena Thank you again for your time
I understand the problem , but still dont know how to start solving it
here is the code
{this.tbl_bankTableAdapter.Fill(this.dataSet1.tbl_bank);
this.reportViewer1.RefreshReport();}
This code is generated automatically by the program itself
i tried
{
//(be advised that "ya" is the name if instant class for form1 which contains the modifying process )

conString = Properties.Settings.Default.BankConnectionString;

SqlConnection con = new SqlConnection(conString);


con.Open();
SqlDataAdapter Adapter = new SqlDataAdapter(@"SELECT * FROM tbl_Bank", con);

System.Data. DataTable dtt = new System.Data.DataTable();
Adapter.Fill(dtt);

Adapter.Fill(ya.bankDataSet);
ya.tblbankBindingSource.DataSource = dtt;


con.Close();
this.reportViewer1.RefreshReport();

}

Leena 206 30-Sep-14 0:04am    
are you able to get updated data (desire data) in dtt?

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