473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ReportViewer - Add a dropdown or checkbox to the content

I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing
an .RLDC report in local report.

The columns for the report are essentially:

Month Item #1 Item#2 Item#3

I would like to add a checkbox or dropdown control to the .RLDC and have
Item #1, Item #2, or Item #3 display conditionally based on a checkbox being
clicked or a dropdown value being selected.

Is there a way to do this?

Oct 29 '08 #1
5 10311
Hi,

From your description you want to group or filter the data shown on the
ReportViewer, right? If so I'd lilke to demonstrate how to do this step by
step using a DropDownList on the page.

1. Prepare a test data table in your database. The data table has two
columns:
theID PK int
theName nvarchar

Insert arbitrary records into this table, such as:

theID theName
19 Allen
20 Peter
21 Marry
44 Linda
444 Jerry
666 Tom
667 Jack
668 Steven

2. Drag and drop a ReportViewer control on the page. In design view, right
click the control and select "Show Smart Tag". On the popup window click
the "Design a new report". Follow the instructions provided by the wizard
to link the report to the datatable.

3. Double click the created rdlc file in the solution explorer window to
open it. In the properties window find the "ReportParameters" property,
click the value field in this item and click the "¡*" button on the right
side to open the "Report Properties" window.

4. Click the "Add" button on the left bottom side to add a new parameter to
this report. Set the Name "theID" as the Name, "Integer" as Data Type and
"theID" as Prompt. Uncheck the "Null" checkbox on the window to allow
default value to this parameter. Then input "=20" in the textbox beside the
checkbox. Click "OK" button.

5. In the design view of the rdlc file, select the "table1" Table, right
click it and click "Properties" to open the "Table Properties" window.
Select the "Filters" tab. Set "=Fields!theID.Value" as the Expression, "<"
as the operator and "=Parameters!theID.Value" as the Value. Cllick "OK"
button.

6. Shift to the design view of the page, right click the ReportViewer
control, click "Show Smart Tab", choose the newly created rdlc file as the
report.

7. Start debugging to test. If everything is normal we can only see the "19
Allen" record in the report.

8. In the source view of the page, add following code:

<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True"
onselectedindexchanged="DropDownList3_SelectedInde xChanged">
<asp:ListItem Text="20" Value="20"></asp:ListItem>
<asp:ListItem Text="500" Value="500"></asp:ListItem>
<asp:ListItem Text="1000" Value="1000"></asp:ListItem>
</asp:DropDownList>
In the aspx.cs of the page, add following code:
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs
e)
{
Microsoft.Reporting.WebForms.ReportParameter[] p = new
Microsoft.Reporting.WebForms.ReportParameter[1];
p[0] = new Microsoft.Reporting.WebForms.ReportParameter("theI D",
this.DropDownList3.SelectedValue);
this.ReportViewer1.LocalReport.SetParameters(p);
}

Here the "ReportViewer1" is the ID of the ReportViewer control.

9. Start debugging to test. When the selected item in the DropDownList get
changed we'll see different records in the report.

Please have a try and let me know if it works. If it's not what you need
please clarify your requirement.
Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Thread-Topic: ReportViewer - Add a dropdown or checkbox to the content
| thread-index: Ack563il5nDFokv7RBe6ypk+Hx7X6Q==
| X-WBNR-Posting-Host: 65.55.12.11
| From: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ==?=
<ch*********@community.nospam>
| Subject: ReportViewer - Add a dropdown or checkbox to the content
| Date: Wed, 29 Oct 2008 10:26:26 -0700
| Lines: 15
| Message-ID: <4B**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:78886
| NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have a VS 2008 ASP.NET webform that has a reportview tag on it,
accessing
| an .RLDC report in local report.
|
| The columns for the report are essentially:
|
| Month Item #1 Item#2 Item#3
|
| I would like to add a checkbox or dropdown control to the .RLDC and have
| Item #1, Item #2, or Item #3 display conditionally based on a checkbox
being
| clicked or a dropdown value being selected.
|
| Is there a way to do this?
|
|
|
|

Oct 30 '08 #2
Allen,

On this step, you're adding the dropdown control to the page with the
reportviewer on it, so that it appears above or below the report itself. I
want the dropdown or checkbox list to appear in the report itself in the
header section. Is this possible?

Ian
8. In the source view of the page, add following code:

<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True"
onselectedindexchanged="DropDownList3_SelectedInde xChanged">
<asp:ListItem Text="20" Value="20"></asp:ListItem>
<asp:ListItem Text="500" Value="500"></asp:ListItem>
<asp:ListItem Text="1000" Value="1000"></asp:ListItem>
</asp:DropDownList>
"Allen Chen [MSFT]" wrote:
Hi,

From your description you want to group or filter the data shown on the
ReportViewer, right? If so I'd lilke to demonstrate how to do this step by
step using a DropDownList on the page.

1. Prepare a test data table in your database. The data table has two
columns:
theID PK int
theName nvarchar

Insert arbitrary records into this table, such as:

theID theName
19 Allen
20 Peter
21 Marry
44 Linda
444 Jerry
666 Tom
667 Jack
668 Steven

2. Drag and drop a ReportViewer control on the page. In design view, right
click the control and select "Show Smart Tag". On the popup window click
the "Design a new report". Follow the instructions provided by the wizard
to link the report to the datatable.

3. Double click the created rdlc file in the solution explorer window to
open it. In the properties window find the "ReportParameters" property,
click the value field in this item and click the "¡Â*" button on the right
side to open the "Report Properties" window.

4. Click the "Add" button on the left bottom side to add a new parameter to
this report. Set the Name "theID" as the Name, "Integer" as Data Type and
"theID" as Prompt. Uncheck the "Null" checkbox on the window to allow
default value to this parameter. Then input "=20" in the textbox beside the
checkbox. Click "OK" button.

5. In the design view of the rdlc file, select the "table1" Table, right
click it and click "Properties" to open the "Table Properties" window.
Select the "Filters" tab. Set "=Fields!theID.Value" as the Expression, "<"
as the operator and "=Parameters!theID.Value" as the Value. Cllick "OK"
button.

6. Shift to the design view of the page, right click the ReportViewer
control, click "Show Smart Tab", choose the newly created rdlc file as the
report.

7. Start debugging to test. If everything is normal we can only see the "19
Allen" record in the report.

8. In the source view of the page, add following code:

<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True"
onselectedindexchanged="DropDownList3_SelectedInde xChanged">
<asp:ListItem Text="20" Value="20"></asp:ListItem>
<asp:ListItem Text="500" Value="500"></asp:ListItem>
<asp:ListItem Text="1000" Value="1000"></asp:ListItem>
</asp:DropDownList>
In the aspx.cs of the page, add following code:
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs
e)
{
Microsoft.Reporting.WebForms.ReportParameter[] p = new
Microsoft.Reporting.WebForms.ReportParameter[1];
p[0] = new Microsoft.Reporting.WebForms.ReportParameter("theI D",
this.DropDownList3.SelectedValue);
this.ReportViewer1.LocalReport.SetParameters(p);
}

Here the "ReportViewer1" is the ID of the ReportViewer control.

9. Start debugging to test. When the selected item in the DropDownList get
changed we'll see different records in the report.

Please have a try and let me know if it works. If it's not what you need
please clarify your requirement.
Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Thread-Topic: ReportViewer - Add a dropdown or checkbox to the content
| thread-index: Ack563il5nDFokv7RBe6ypk+Hx7X6Q==
| X-WBNR-Posting-Host: 65.55.12.11
| From: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ==?=
<ch*********@community.nospam>
| Subject: ReportViewer - Add a dropdown or checkbox to the content
| Date: Wed, 29 Oct 2008 10:26:26 -0700
| Lines: 15
| Message-ID: <4B**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:78886
| NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have a VS 2008 ASP.NET webform that has a reportview tag on it,
accessing
| an .RLDC report in local report.
|
| The columns for the report are essentially:
|
| Month Item #1 Item#2 Item#3
|
| I would like to add a checkbox or dropdown control to the .RLDC and have
| Item #1, Item #2, or Item #3 display conditionally based on a checkbox
being
| clicked or a dropdown value being selected.
|
| Is there a way to do this?
|
|
|
|

Oct 30 '08 #3
Hi Lan,

Unfortunately as far as I know the ReportViewer control doesn't support
this natively. What I can suggest is to use absolute position to let
DropDownList float over the report. This is the only way I can think of.

Please feel free to ask if you have other questions.

Regards,
Allen Chen
Microsoft Online Support

--------------------
| Thread-Topic: ReportViewer - Add a dropdown or checkbox to the content
| thread-index: Ack6sRZste9TyqVWQ+q8RDAKtCqVEQ==
| X-WBNR-Posting-Host: 65.55.12.11
| From: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ==?=
<ch*********@community.nospam>
| References: <4B**********************************@microsoft.co m>
<Ki*************@TK2MSFTNGHUB02.phx.gbl>
| Subject: RE: ReportViewer - Add a dropdown or checkbox to the content
| Date: Thu, 30 Oct 2008 10:01:01 -0700
| Lines: 173
| Message-ID: <53**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3168
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:78954
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Allen,
|
| On this step, you're adding the dropdown control to the page with the
| reportviewer on it, so that it appears above or below the report itself.
I
| want the dropdown or checkbox list to appear in the report itself in the
| header section. Is this possible?
|
| Ian
|
| 8. In the source view of the page, add following code:
| >
| <asp:DropDownList ID="DropDownList3" runat="server"
AutoPostBack="True"
| onselectedindexchanged="DropDownList3_SelectedInde xChanged">
| <asp:ListItem Text="20" Value="20"></asp:ListItem>
| <asp:ListItem Text="500" Value="500"></asp:ListItem>
| <asp:ListItem Text="1000" Value="1000"></asp:ListItem>
| </asp:DropDownList>
|
| "Allen Chen [MSFT]" wrote:
|
| Hi,
| >
| From your description you want to group or filter the data shown on the
| ReportViewer, right? If so I'd lilke to demonstrate how to do this step
by
| step using a DropDownList on the page.
| >
| 1. Prepare a test data table in your database. The data table has two
| columns:
| theID PK int
| theName nvarchar
| >
| Insert arbitrary records into this table, such as:
| >
| theID theName
| 19 Allen
| 20 Peter
| 21 Marry
| 44 Linda
| 444 Jerry
| 666 Tom
| 667 Jack
| 668 Steven
| >
| 2. Drag and drop a ReportViewer control on the page. In design view,
right
| click the control and select "Show Smart Tag". On the popup window
click
| the "Design a new report". Follow the instructions provided by the
wizard
| to link the report to the datatable.
| >
| 3. Double click the created rdlc file in the solution explorer window
to
| open it. In the properties window find the "ReportParameters" property,

| click the value field in this item and click the "¡Â*" button on the
right
| side to open the "Report Properties" window.
| >
| 4. Click the "Add" button on the left bottom side to add a new
parameter to
| this report. Set the Name "theID" as the Name, "Integer" as Data Type
and
| "theID" as Prompt. Uncheck the "Null" checkbox on the window to allow
| default value to this parameter. Then input "=20" in the textbox beside
the
| checkbox. Click "OK" button.
| >
| 5. In the design view of the rdlc file, select the "table1" Table,
right
| click it and click "Properties" to open the "Table Properties" window.
| Select the "Filters" tab. Set "=Fields!theID.Value" as the Expression,
"<"
| as the operator and "=Parameters!theID.Value" as the Value. Cllick "OK"
| button.
| >
| 6. Shift to the design view of the page, right click the ReportViewer
| control, click "Show Smart Tab", choose the newly created rdlc file as
the
| report.
| >
| 7. Start debugging to test. If everything is normal we can only see the
"19
| Allen" record in the report.
| >
| 8. In the source view of the page, add following code:
| >
| <asp:DropDownList ID="DropDownList3" runat="server"
AutoPostBack="True"
| onselectedindexchanged="DropDownList3_SelectedInde xChanged">
| <asp:ListItem Text="20" Value="20"></asp:ListItem>
| <asp:ListItem Text="500" Value="500"></asp:ListItem>
| <asp:ListItem Text="1000" Value="1000"></asp:ListItem>
| </asp:DropDownList>
| In the aspx.cs of the page, add following code:
| protected void DropDownList3_SelectedIndexChanged(object sender,
EventArgs
| e)
| {
| Microsoft.Reporting.WebForms.ReportParameter[] p = new
| Microsoft.Reporting.WebForms.ReportParameter[1];
| p[0] = new
Microsoft.Reporting.WebForms.ReportParameter("theI D",
| this.DropDownList3.SelectedValue);
| this.ReportViewer1.LocalReport.SetParameters(p);
| }
| >
| Here the "ReportViewer1" is the ID of the ReportViewer control.
| >
| 9. Start debugging to test. When the selected item in the DropDownList
get
| changed we'll see different records in the report.
| >
| Please have a try and let me know if it works. If it's not what you
need
| please clarify your requirement.
| >
| >
| Regards,
| Allen Chen
| Microsoft Online Support
| >
| Delighting our customers is our #1 priority. We welcome your comments
and
| suggestions about how we can improve the support we provide to you.
Please
| feel free to let my manager know what you think of the level of service
| provided. You can send feedback directly to my manager at:
| ms****@microsoft.com.
| >
| ==================================================
| Get notification to my posts through email? Please refer to
| >
http://msdn.microsoft.com/en-us/subs...#notifications.
| >
| Note: MSDN Managed Newsgroup support offering is for non-urgent issues
| where an initial response from the community or a Microsoft Support
| Engineer within 2 business day is acceptable. Please note that each
follow
| up response may take approximately 2 business days as the support
| professional working with you may need further investigation to reach
the
| most efficient resolution. The offering is not appropriate for
situations
| that require urgent, real-time or phone-based interactions. Issues of
this
| nature are best handled working with a dedicated Microsoft Support
Engineer
| by contacting Microsoft Customer Support Services (CSS) at
| http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
| ==================================================
| This posting is provided "AS IS" with no warranties, and confers no
rights.
| >
| --------------------
| | Thread-Topic: ReportViewer - Add a dropdown or checkbox to the content
| | thread-index: Ack563il5nDFokv7RBe6ypk+Hx7X6Q==
| | X-WBNR-Posting-Host: 65.55.12.11
| | From: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ==?=
| <ch*********@community.nospam>
| | Subject: ReportViewer - Add a dropdown or checkbox to the content
| | Date: Wed, 29 Oct 2008 10:26:26 -0700
| | Lines: 15
| | Message-ID: <4B**********************************@microsoft.co m>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | Path: TK2MSFTNGHUB02.phx.gbl
| | Xref: TK2MSFTNGHUB02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:78886
| | NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | I have a VS 2008 ASP.NET webform that has a reportview tag on it,
| accessing
| | an .RLDC report in local report.
| |
| | The columns for the report are essentially:
| |
| | Month Item #1 Item#2 Item#3
| |
| | I would like to add a checkbox or dropdown control to the .RLDC and
have
| | Item #1, Item #2, or Item #3 display conditionally based on a
checkbox
| being
| | clicked or a dropdown value being selected.
| |
| | Is there a way to do this?
| |
| |
| |
| |
| >
| >
|

Oct 31 '08 #4
Hi,

Do you have any further questions?

Regards,
Allen Chen
Microsoft Online Support
--------------------
| Thread-Topic: ReportViewer - Add a dropdown or checkbox to the content
| thread-index: Ack6sRZste9TyqVWQ+q8RDAKtCqVEQ==
| X-WBNR-Posting-Host: 65.55.12.11
| From: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ==?=
<ch*********@community.nospam>
| References: <4B**********************************@microsoft.co m>
<Ki*************@TK2MSFTNGHUB02.phx.gbl>
| Subject: RE: ReportViewer - Add a dropdown or checkbox to the content
| Date: Thu, 30 Oct 2008 10:01:01 -0700
| Lines: 173
| Message-ID: <53**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3168
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:78954
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Allen,
|
| On this step, you're adding the dropdown control to the page with the
| reportviewer on it, so that it appears above or below the report itself.
I
| want the dropdown or checkbox list to appear in the report itself in the
| header section. Is this possible?
|
| Ian
|
| 8. In the source view of the page, add following code:
| >
| <asp:DropDownList ID="DropDownList3" runat="server"
AutoPostBack="True"
| onselectedindexchanged="DropDownList3_SelectedInde xChanged">
| <asp:ListItem Text="20" Value="20"></asp:ListItem>
| <asp:ListItem Text="500" Value="500"></asp:ListItem>
| <asp:ListItem Text="1000" Value="1000"></asp:ListItem>
| </asp:DropDownList>
|
| "Allen Chen [MSFT]" wrote:
|
| Hi,
| >
| From your description you want to group or filter the data shown on the
| ReportViewer, right? If so I'd lilke to demonstrate how to do this step
by
| step using a DropDownList on the page.
| >
| 1. Prepare a test data table in your database. The data table has two
| columns:
| theID PK int
| theName nvarchar
| >
| Insert arbitrary records into this table, such as:
| >
| theID theName
| 19 Allen
| 20 Peter
| 21 Marry
| 44 Linda
| 444 Jerry
| 666 Tom
| 667 Jack
| 668 Steven
| >
| 2. Drag and drop a ReportViewer control on the page. In design view,
right
| click the control and select "Show Smart Tag". On the popup window
click
| the "Design a new report". Follow the instructions provided by the
wizard
| to link the report to the datatable.
| >
| 3. Double click the created rdlc file in the solution explorer window
to
| open it. In the properties window find the "ReportParameters" property,

| click the value field in this item and click the "¡Â*" button on the
right
| side to open the "Report Properties" window.
| >
| 4. Click the "Add" button on the left bottom side to add a new
parameter to
| this report. Set the Name "theID" as the Name, "Integer" as Data Type
and
| "theID" as Prompt. Uncheck the "Null" checkbox on the window to allow
| default value to this parameter. Then input "=20" in the textbox beside
the
| checkbox. Click "OK" button.
| >
| 5. In the design view of the rdlc file, select the "table1" Table,
right
| click it and click "Properties" to open the "Table Properties" window.
| Select the "Filters" tab. Set "=Fields!theID.Value" as the Expression,
"<"
| as the operator and "=Parameters!theID.Value" as the Value. Cllick "OK"
| button.
| >
| 6. Shift to the design view of the page, right click the ReportViewer
| control, click "Show Smart Tab", choose the newly created rdlc file as
the
| report.
| >
| 7. Start debugging to test. If everything is normal we can only see the
"19
| Allen" record in the report.
| >
| 8. In the source view of the page, add following code:
| >
| <asp:DropDownList ID="DropDownList3" runat="server"
AutoPostBack="True"
| onselectedindexchanged="DropDownList3_SelectedInde xChanged">
| <asp:ListItem Text="20" Value="20"></asp:ListItem>
| <asp:ListItem Text="500" Value="500"></asp:ListItem>
| <asp:ListItem Text="1000" Value="1000"></asp:ListItem>
| </asp:DropDownList>
| In the aspx.cs of the page, add following code:
| protected void DropDownList3_SelectedIndexChanged(object sender,
EventArgs
| e)
| {
| Microsoft.Reporting.WebForms.ReportParameter[] p = new
| Microsoft.Reporting.WebForms.ReportParameter[1];
| p[0] = new
Microsoft.Reporting.WebForms.ReportParameter("theI D",
| this.DropDownList3.SelectedValue);
| this.ReportViewer1.LocalReport.SetParameters(p);
| }
| >
| Here the "ReportViewer1" is the ID of the ReportViewer control.
| >
| 9. Start debugging to test. When the selected item in the DropDownList
get
| changed we'll see different records in the report.
| >
| Please have a try and let me know if it works. If it's not what you
need
| please clarify your requirement.
| >
| >
| Regards,
| Allen Chen
| Microsoft Online Support
| >
| Delighting our customers is our #1 priority. We welcome your comments
and
| suggestions about how we can improve the support we provide to you.
Please
| feel free to let my manager know what you think of the level of service
| provided. You can send feedback directly to my manager at:
| ms****@microsoft.com.
| >
| ==================================================
| Get notification to my posts through email? Please refer to
| >
http://msdn.microsoft.com/en-us/subs...#notifications.
| >
| Note: MSDN Managed Newsgroup support offering is for non-urgent issues
| where an initial response from the community or a Microsoft Support
| Engineer within 2 business day is acceptable. Please note that each
follow
| up response may take approximately 2 business days as the support
| professional working with you may need further investigation to reach
the
| most efficient resolution. The offering is not appropriate for
situations
| that require urgent, real-time or phone-based interactions. Issues of
this
| nature are best handled working with a dedicated Microsoft Support
Engineer
| by contacting Microsoft Customer Support Services (CSS) at
| http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
| ==================================================
| This posting is provided "AS IS" with no warranties, and confers no
rights.
| >
| --------------------
| | Thread-Topic: ReportViewer - Add a dropdown or checkbox to the content
| | thread-index: Ack563il5nDFokv7RBe6ypk+Hx7X6Q==
| | X-WBNR-Posting-Host: 65.55.12.11
| | From: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ==?=
| <ch*********@community.nospam>
| | Subject: ReportViewer - Add a dropdown or checkbox to the content
| | Date: Wed, 29 Oct 2008 10:26:26 -0700
| | Lines: 15
| | Message-ID: <4B**********************************@microsoft.co m>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | Path: TK2MSFTNGHUB02.phx.gbl
| | Xref: TK2MSFTNGHUB02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:78886
| | NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | I have a VS 2008 ASP.NET webform that has a reportview tag on it,
| accessing
| | an .RLDC report in local report.
| |
| | The columns for the report are essentially:
| |
| | Month Item #1 Item#2 Item#3
| |
| | I would like to add a checkbox or dropdown control to the .RLDC and
have
| | Item #1, Item #2, or Item #3 display conditionally based on a
checkbox
| being
| | clicked or a dropdown value being selected.
| |
| | Is there a way to do this?
| |
| |
| |
| |
| >
| >
|

Nov 7 '08 #5
Hi Allen!

Any way of using Check boxes & setting values on run-time?

Cheers...
the_kauboy
Nov 20 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mamun | last post by:
Hi All, I have the following case. I am trying to update a table based on the value of dropdown box and checkbox. Here is what I have in page1.asp <table>
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
4
by: Sevu | last post by:
I am working with ASP.NET.I am using ReportViwer Control to show my report.I like to add dropdownlist with in the reportviewer control. ( Not top to the control some thing like that).I need to...
1
by: Rich | last post by:
Hello, I am trying to use the Reportviewer control. I have been following an example from the web, and the instructions from the help files on set up a ..rdlc and binding it to the reportviewer...
2
markrawlingson
by: markrawlingson | last post by:
Hi guys, I have a bunch of drop down lists on a page, with a checkbox beside each one that relates to each one respectively. When a user selects an option from the drop down, the checkbox is...
1
by: Wendi Turner | last post by:
Configuration Error from Visual Studio 2005 .NET 2.0 This is an ASP.NET Website with a Report Viewer Component - Microsoft.ReportViewer.WebForms & .Common included in project output Trying to...
0
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing an .RLDC report in local report. The columns for the report are essentially: Month Item #1 Item#2 Item#3 ...
1
by: gandhi.vishal | last post by:
Hello, I have an issue. I'm not seeing the reportviewer data at all. The column names come up fine but there is no data in the report table. Here is what I'm doing I created a dataset with the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.