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.
ALTER PROCEDURE GetTables
declare @GetTables varchar(max)
set @GetTables =
SELECT FirstName, SecondName
FROM ['+ @TableName +']
Thanks in advance for help!