Click here to Skip to main content
15,891,780 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys~ how can i show active directory table on report viewer (rdlc)? i spend alot times to did some research but report viewer must have data sources or database to query. Is there anyway to display active directory results on report viewer (rdlc)? Wish can get some idea, information or sample from you guys~
Posted
Updated 26-Nov-13 23:18pm
v2
Comments
bluesathish 29-Nov-13 1:45am    
Have you tried to get your active directory records into datatable? if you can, assigning that datatable to your rdlc report datasource. But make sure you've create a dataset(xsd) file before.

Since SSRS (SQL Server Reporting Services) are bound to SQL Server, as far as I know there must be some SQL Server database to query.

So there must be a solution, but not a straightforward one as you seem to hope:
0) Create a database according to informations you want to retrieve
1) Query Active Directory and populate your database from that
2) Build your report to display data in your database

I cannot see other way; maybe there exist some products for that but I never had to search for/use one.
 
Share this answer
 
Hi guys i can make AD results display on ReportViewer.
Below is the solutions!

C#
private void ActiveDirectoryRecords_Load(object sender, EventArgs e)
     {
            DataTable dtable = new DataTable();
            DataRow rows;
            dtable.Columns.Add("UserID");
            dtable.Columns.Add("Name");

      foreach (SearchResult sResultSet in mySearcher.FindAll())
          {
            string resultss = GetProperty(sResultSet, "sAMAccountName");
            string strName = GetProperty(sResultSet, "givenName");
            rows = dtable.NewRow();
            rows["UserID"] = resultss;
            rows["Name"] = strName;
            dtable.Rows.Add(rows);
          }

            ReportDataSource rpdata = new ReportDataSource();
            reportViewer1.LocalReport.ReportEmbeddedResource = "SampleReport.ADreport.rdlc";
            rpdata = new ReportDataSource("DataSet1", dtable);
            reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.LocalReport.DataSources.Add(rpdata);
            reportViewer1.LocalReport.Refresh();
            reportViewer1.RefreshReport();

      }
 
Share this answer
 
v2

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