Last post Aug 12, 2019 01:55 AM by samwu
Aug 06, 2019 05:43 PM|rkrex|LINK
I was wondering when you use the report viewer control in a visual studio web application to render reports locally, you will add the control to a web form and then you will see the Report Data window and in there you will create a Data source and datasets.
My question is, after you have created a data Source, is there a way to go back and view it or edit it? Thank You !!!
Aug 07, 2019 05:22 AM|AddWeb Solution|LINK
please refer below link how to add,edit,delete fields in the report data pane
Aug 07, 2019 10:51 AM|samwu|LINK
after you have created a data Source, is there a way to go back and view it or edit it
According to your description, I couldn’t understand your requirement clearly.
Do you mean you want to change the reportviewer control content?
if so, you need to change the report.rdlc. because the content of reportviewer determined by report.rdlc.
If I misunderstand your requirement, please post more details information about your requirement.
Here is a video about how to use the reportviewer in web form.https://www.youtube.com/watch?v=QMWB5lBamuY
Aug 07, 2019 02:04 PM|rkrex|LINK
Sorry for the misunderstanding. I tried to be as clear as possible regarding what the issue is that I am trying to resolve. Anyway, maybe I should preface my question with I have to maintain a preexisting system that is using local reports or rdlc files.
Obviously the person that designed the reports has created a Data Source, and I was just wondering how do I "open this Data Source to find out the stored procedure, sql statement, or table the data is coming from. The rdlc file does show me where the data
is coming from that the datasets are using, but it doesn't show anything in regards to the Data Source. Thanks for your help !!!!
Aug 09, 2019 10:39 AM|samwu|LINK
open this Data Source to find out the stored procedure, sql statement, or table the data is coming from
It depends on the code in your project to see which database you're linking to and what sql statement did you use.
You can look for connection strings, some database queries in your project.
Aug 09, 2019 02:43 PM|rkrex|LINK
How would a connection string tell me what the source of the report data is, in regards to a sql ststement, stored procedure, or a table? It is my understanding that a connection string would only tell me what database the report is using.
Aug 12, 2019 01:55 AM|samwu|LINK
Since I don't know your code, I can only give you an example.
such as this Report viewer control demo:https://www.aspsnippets.com/Articles/ASPNet-Report-Viewer-control-Tutorial-with-example.aspx
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="600">
protected void Page_Load(object sender, EventArgs e)
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report.rdlc");
Customers dsCustomers = GetData("select top 20 * from customers");
ReportDataSource datasource = new ReportDataSource("Customers", dsCustomers.Tables);
private Customers GetData(string query)
string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
SqlCommand cmd = new SqlCommand(query);
using (SqlConnection con = new SqlConnection(conString))
using (SqlDataAdapter sda = new SqlDataAdapter())
cmd.Connection = con;
sda.SelectCommand = cmd;
using (Customers dsCustomers = new Customers())
The connection string tells you which database to connect to, and the query command tells you which table(or stored procedure) in the database to query.
If you haven't solved the problem, please post all your code.