[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Cannot create ReportViewer with Stored Procedure, as no fields found in report.rdlc table?!

Posted on 2012-09-16
Medium Priority
Last Modified: 2012-09-19
I'm trying to create ReportViewer which will show data select from database with stored procedure. Below is code of stored procedure which works fine if execute it.
I have done next things:
Add new Form1, and ReportViewer control >> add new dataset1 >> drag/drop stored procedure into dataset1 space, so I've got DataTable & TableAdapter. Into DataTable I have manually create columns which are select from stored procedure, like FirstName & SecondName. TableAdapter contain stored procedure query Fill with parameter @TableName. >> In Report1.rdlc I have add table, and add stored procedure GetTables as datasource. >> For ReportViewer control, I have select Report1.rdlc, and by that I've got GetTablesBindingSource & GetTablesTableAdatper. >> then finally want to design columns in Reprot1.rdlc, but no fields found it, like <No Fields> ?!

I have already done a few report, but only with specific table, and not to load report with different tables.
I would be very pleased if someone could help me here, give a tips, etc.

@TableName varchar(50)
declare @GetTables varchar(max)
set @GetTables = 
SELECT FirstName, SecondName
FROM ['+ @TableName +']
exec (@GetTables)

Open in new window

Thanks in advance for help!
Question by:dejandejanovic
1 Comment
LVL 83

Accepted Solution

CodeCruiser earned 2000 total points
ID: 38404781
>In Report1.rdlc I have add table, and add stored procedure GetTables as datasource.

You need to select that data table as the data source of the report.


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question