Can I create a RDLC and databind a table at run time without creating dataset in design time?

10,318

Solution 1

You need a Dummy Data Set for the report. You can fill it with you load data on runtime.

Solution 2

Yes it is possible. You can rebind the datatable on the ReportViewer control. You can use any datatable you want, as long as it matches up with the Tablename used in your RDLC file.

Code to do this would look something like this in VB.NET:

  ReportViewer1.Reset()
  ReportViewer1.LocalReport.DataSources.Clear()
  ReportViewer1.LocalReport.LoadReportDefinition(ms)     'Reload your definition (RDLC)

  'Bind dataTables to the report viewer control (This is the 'dataset' it is asking about)
  ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DATANAME", DATATABLE))

ReportViewer1.RefreshReport()

Solution 3

Use Dummy DataSet or You can also use XSLT for runtime report without dataset at design time.

Share:
10,318
Junior Mayhé
Author by

Junior Mayhé

Brazilian Software Engineer graduated in Information Systems. Fluent in English and Spanish. ITIL and SCRUM certificated professional. Solid experience throughout the life cycle of software development. Working for over 15 years designing, building and deploying solutions for areas like Human Resources, Finance, Publishing, Telecommunications, Entertainment, Healthcare, Logistics and Energy. International experience interacting with professionals from several countries like Italy, Belgium, Portugal, Holland, USA, Colombia, Spain and Mexico. 10 years of experience in systems analysis, requirements gathering, object-oriented analysis, data modeling, technical specification. 15 years in systems development, maintenance, testing for national and international companies. 4 years interacting with professionals from different countries, of which 2 years playing technical project leadership role abroad, delegating, and following up tasks. 3 years negotiating with infrastructure and service providers. 2 years defining the IT tools and infrastructure to be implemented and processes to be improved, covering software, hardware, communications needs, to meet the needs of the organization. 2 years organizing and supervising the acquisition and update of computer systems, whether hardware or software (licenses, servers, contracts). Specialties: Systems Analysis, Requirements Analysis, Functional Analysis, Software Development, Project Management, SCRUM Agile methodology, Waterfall methodology, ITIL, Software Testing, Continuous Integration, C# programming language, ASP.NET MVC, Entity Framework, Windows Forms, WPF, WCF, .NET Core, ASP.NET Web API, JavaScript, Angular 6, TypeScript, JQuery, HTML5, CSS3, XML, XSD, XAML, SQL Server, PHP, MySQL, MongoDB, BPM, UML, GIT, Prototyping, Database Modeling and Administration Personal Site | Linkedin profile

Updated on June 05, 2022

Comments

  • Junior Mayhé
    Junior Mayhé almost 2 years

    Just wondering if it's possible to databind a RDLC's table at run time.

    I've created a report, put a table control, but VS compiler says it's necessary to set a dataset.

    But I wanted to load data into this table using a dataset created in C# code, and not creating dataset and table adapter.

    Is it possible?

  • Haseeb
    Haseeb about 2 years
    can you please provide any reference or sample code url for more detail on this?