Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do Microsoft reports (RDL) query the data?

I am not creating RDL from scratch so maybe this is a problem -- I work on already prepared files.

MSDN states that CommandText in RDL file can contain T-SQL query. Ok, this I understand, but what else it can contains?

I am asking because the phrasing clearly indicates you can put some other expression there So if I understand correctly, I can look at RDL code (in Visual Studio, RMB on RDL file, "view code") and the interesting parts would be...?

  • DataSourceName -- this is a "link" to database via definitions of data sources
  • CommandText -- I thought this is the place to put query, like SELECT... but from what I see there are no queries used
like image 305
greenoldman Avatar asked Mar 10 '26 19:03

greenoldman


2 Answers

Reporting service, loads the rdl file into it, and starts parsing and reading the command according to their sections like

data source, report params, etc.

gets the values of params (if any). start using the data source database connection. execute the query/ sp command. get the data, and store in seperate data fields which are also mentioned in rdl. binds their values with controls (text box, grid columns etc), if there is any expression written into it, execute them as well.

Generate the output (html/ pdf).

And there you Go.

I just tried to explain in short and simple words. you can check out msdn for complete detail.

Regards,

Mazhar Karimi

You can create reports manually and fill them with any data that you would like to.

Sth like:

ReportDataSource reportDataSource = new ReportDataSource();
reportViewer.Reset();
reportDataSource.Name = "DataSetOdczyty_klienci_adresy";
reportDataSource.Value = klienciadresyBindingSource;
reportViewer.LocalReport.DataSources.Add(reportDataSource);
reportViewer.LocalReport.ReportEmbeddedResource = "Wodociagi.Reports.ReportListaKlientow.rdlc";
like image 29
kubal5003 Avatar answered Mar 12 '26 07:03

kubal5003