views:

20

answers:

2

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
+1  A: 

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";
kubal5003
Thank you. In my case I don't have direct C# code counterpart though and the CommandText in RDL is given.
macias
+1  A: 

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

Mazhar Karimi
As I understand, the text I am seeing is the 4th type -- expression, right? So to get it work, when executing this report the expression is defined and that's how it works. Let's say the expression is "expr1" -- now I have to define some method expr1 in C# code?
macias