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.
-
- Posts: 4
- Joined: Thu Aug 23, 2007 9:52 pm
- Location: US
Displaying date range.
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:
I forgot to mention that you can drag the Variables you create onto the Report Page then so that they will be displayed.
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();
-
- Posts: 4
- Joined: Thu Aug 23, 2007 9:52 pm
- Location: US
Displaying date range.
This was perfect, thank you.
JimK
JimK