Page 1 of 1
Displaying date range.
Posted: Thu Aug 23, 2007 10:15 pm
by Jim Kitterman
I'm very new to stimulreports. I am sure this is a basic question, if i need to pass in lets say a date range start and end, not really in the dataset but i need to display "startdate To endDate" on the report. How would I go about this? I'm reading documentation now but havent seen that scenario yet. Thanks
Jim K
Displaying date range.
Posted: Fri Aug 24, 2007 3:39 am
by Brendan
You can add 2 variables to your Report Dictionary, lets say "StartDate" and "EndDate". set their types to "datetime" when creating.
Then when you call your report from code you could do the following:
Code: Select all
StiReport report = new StiReport();
report.Load("c:\\reports\\DateStuff.mrt");
report.RegData("MyData", MyDataSet);
report.Compile();
report["StartDate"] = DateTime.Today;
report["EndDate"] = DateTime.Today.AddDays(7);
report.Show();
I forgot to mention that you can drag the Variables you create onto the Report Page then so that they will be displayed.
Displaying date range.
Posted: Fri Aug 24, 2007 5:31 pm
by Jim Kitterman
This was perfect, thank you.
JimK