473,221 Members | 1,918 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,221 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 10280
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.