Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, I'm developing a windows forms application using c#.net, in my application i want to enter start date and end date using a date time picker in form1 and need to open a crystal report with data between selected dates on form2 as a new window I've already designed crystal report and the report works fine. then designed form2 with crystal report viewer to view the report. but i don't know how to pass dates (parameters) from form1, to form2 which contain crystal report viewer. please someone can help me to do this.

Tried with following code, but nothing happened

What I have tried:

myDataSet ds = new myDataSet();
frm_ReportViewer viewForm = new frm_ReportViewer();
viewForm.Owner = this;

rpt_myreport report = new rpt_myreport();
report.Load("Reports\\rpt_myreport.rpt");

report.SetDataSource(ds);
viewForm.crv_common.ReportSource = report;
viewForm.ShowDialog(this);
Posted
Updated 7-May-17 4:07am

1 solution

@OriginalGriff has written a series of Tips on how to pass information between forms. The first one is here Transferring information between two forms, Part 1: Parent to Child[^] - links to the others appear in that article
 
Share this answer
 

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