how to fill stored procedure to generate report?

Stimulsoft Reports.NET discussion
Post Reply
mosini
Posts: 4
Joined: Sat Apr 17, 2010 2:56 am

how to fill stored procedure to generate report?

Post by mosini »

hi,
I have a sp which has parameters and i want my report to be filtered by this sp which will contain different values each time.
how to write the code in c#?
mosini
Posts: 4
Joined: Sat Apr 17, 2010 2:56 am

how to fill stored procedure to generate report?

Post by mosini »

I found the answer.
If you have written a Stored Procedure which hase N Parameter and you want to give these parameters a value at your Visual Studio side then you should perform the task below:
suppose you have a sp with 4 pararmeters.and suppose you have design your report with this sp(that is you have chosen a table or DataBand and selected the sp and arranged the return fields of the sp in the table or databand as you wish)
Ok now you create a windows form in Visual studio.you drag and drop 4 textbox on your form and a button on it.
the name of textboxs and buttons are as below:
txtParam1
txtParam2
txtParam3
txtParam4
and a button(btnSendParam)

suppose you stored procedure's name is: selectDaftarRuzname

so you write these codes in btnSendParam's Click Event:
selectDaftarRuznameTableAdapter.Fill(accountingDB_1389DataSet.SelectDaftarRuzname,txtParam1.Text, txtParam2.Text, long.Parse(txtParam3.Text), long.Parse(txtParam4.Text));
stiReport1.Show();
stiReport1.Render(true);

What you dont have to forget is first Fill the Stored Procedure and second Render the report
(that is write stiReport1.Render(true))

Thats it.
Post Reply