This is a migrated thread and some comments may be shown as answers.

c# asp.net -> Filter BETWEEN DateStart and DateEnd

1 Answer 230 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sven
Top achievements
Rank 1
sven asked on 13 Jun 2008, 03:11 PM
Hello,

i'm new to c# and asp.net and i'm trying to build a report with the parameters UserID, DateStart, DateEnd.

Filtering by the currently logged in User via UserID works:

(ReportViewer1.Report

as Report1).ReportParameters[0].Value = Page.User.Identity.Name;


For DateStart and DateEnd i created Parameters and set the UI visible to true, so the user gets prompted for the values. So far it's ok.

But how should the Filter Expression look like?
Date BETWEEN DateStart and DateEnd? But how can i do this in Filter - Edit Expressions?

I also tried to setup the DateStart and DateEnd Parameters in the TableAdapter Query and if i pass the two values via code in the Report1.cs it works, but how can i pass the two Values from the UI Parameter Fields to the Tableadapter Fill Query ?


Thanks!

1 Answer, 1 is accepted

Sort by
0
Milen | Product Manager @DX
Telerik team
answered on 19 Jun 2008, 09:47 AM
Hi sven,

The between operator has three operands, so at this time it is not possible (and therefore it is not exposed) to be used directly as Filter operator.

However, it is still possible to achieve the same functionality by adding two filter operators: >= and <= to compare the DateStart and DateEnd with the Date field.

About your second question there is a KB article you will find very useful, it shows how to use parameterized stored procedure as datasource.

Give it a try and let us know if you have additional questions.

Greetings,
Milen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
sven
Top achievements
Rank 1
Answers by
Milen | Product Manager @DX
Telerik team
Share this question
or