Click here to Skip to main content
14,383,854 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,
a bill project, have a form with listbox to fill it with items and every item have a price, button to caluctate the sum, Discount and Total.
then there is a reportview in the same form it filers(i've done it with parametar)
in report design, ive add a page footer, 3 textBox's.
i want to pass the sum, Discount and total value to the textbox's in the report?
any idea!.
www.mediafire.com/view/vth084te37hv7
Posted
Updated 9-Mar-16 23:20pm
v2
Comments
Surendra Adhikari SA 17-Jun-13 6:39am
   
show your report load code then we can help
Sunasara Imdadhusen 17-Jun-13 6:57am
   
Why you want to pass sum as parameter? you can calculate sum using formula in report and this is correct way..

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 2

1.At first add 3 parameters on report (go to report >>add parameters give name as 'sum','discount' and 'total'.
2.On report right click on text box and go to expression >> click on parameters (in category)
>> double click on parameters which you want to display in your textbox .
it gives expression as
'=Parameters!sum.Value'

3. apply code below before loading report

ReportParameter[] allPar = new ReportParameter[3]; // create parameters array
ReportParameter parSum = new ReportParameter("sum", "195");
ReportParameter parDiscount = new ReportParameter("discount", "19");
ReportParameter parTotal = new ReportParameter("total", "176");

allPar[0] = parSum; //assign parameters to parameter array
allPar[1] = parDiscount;
allPar[2] = parTotal;

reportViewer1.LocalReport.SetParameters(allPar); // set parameter array
this.reportViewer1.RefreshReport();
   
v2
Comments
Maged E William 17-Jun-13 11:56am
   
THanQ Sooooo much
Surendra Adhikari SA 17-Jun-13 21:22pm
   
... welcome man

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100