Displaying date range.

Stimulsoft Reports.NET discussion
Post Reply
Jim Kitterman
Posts: 4
Joined: Thu Aug 23, 2007 9:52 pm
Location: US

Displaying date range.

Post 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
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Displaying date range.

Post 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.
Jim Kitterman
Posts: 4
Joined: Thu Aug 23, 2007 9:52 pm
Location: US

Displaying date range.

Post by Jim Kitterman »

This was perfect, thank you.

JimK
Post Reply