
Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
Charles,
First I am using ReportViewer in local mode. This is new to me so there are
large shares that I do not understand. I will place my questions and
comments below in the areas where I need clarificaton. I will remove
sections that do not apply.
> Did you mean that you would like to display the user criteria selection in
> text on the fact of your report once it is made by the user?
> If I have misunderstood, please let me know.
Yes I want to dispaly user criteria selection in a text box on the face of
the report.
> You can work around this issue by using a report parameter.
What is a report parameter?
> If you are
> developing a web application, you can first save the user criteria
> selection in a session variable.
I am currently storing it in a hidden unbound list box so that I can remove
a line for each step backwards if the user backs up through the menu to make
a change. At the render report button I would pull out the contents to a
session variable ~ I guess.
> Every time you make a criteria selection,
> first read the former selection from the session and then combine the
> current selection with the former selections and save it to the session,
I will do this as described above.
> and then set the new value for your report parameter and refresh your
> report in your reportviewer.
I am using a multi view which will not expose the ReportViewer until all the
criteria is selected and the user clicks a button.
Explain aobut the report paramter, what it is and seeting values to it. (I
am using local mode).
> In your report, you need to drag a TextBox to the place where you want to
> display the criteria selection on your report, create a report parameter
> named "SelectionCriteria" and set the value to
> "=Parameters!SelectionCriteria.Value".
How do I create a report parameter? Is that a data control? I don't see it.
> For example:
> ===================================================
[quoted text clipped - 5 lines]
>
> reportViewer1.ProcessingMode = ProcessingMode.Remote;
I am using ProcessingMode.Local. Does andy of this change?
> List<ReportParameter> paramList = new List<ReportParameter>();
>
[quoted text clipped - 8 lines]
> // Process and render the report
> reportViewer1.RefreshReport();
Please explain the above lines. All of them.
Thank you,
Doug
Charles Wang [MSFT] - 24 Jun 2008 12:48 GMT
Hi Doug,
My above code is for server report. I had thought that you were using a
server report. Anyway for creating a report parameter in a local report,
you can first open your local report, click Report menu at the top of the
menu bar, click "Report Parameters...", click Add to add a parameter which
name is assumed to be "CRETERIA", select the Data type as String, check
Allow blank value, input a space to the Default values and then click OK.
After that you can drag a textbox to your report and set the value to
"=Parameters!CRETERIA.Value". Then in your web page, you can write your
code like the following when you add a criteria:
=============================================================
//add a new creteria
strCreteria += strNewCreteria;
// set the report parameter
List<ReportParameter> paramList = new List<ReportParameter>();
paramList.Add(new ReportParameter("CRETERIA",strCreteria));
this.ReportViewer1.LocalReport.SetParameters(paramList);
//render the report
this.ReportViewer1.LocalReport.Refresh();
=============================================================
Hope this helps. If you have any other questions or concerns, please feel
free to let me know.
Best regards,
Charles Wang
Microsoft Online Community 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: msdnmg@microsoft.com.
=========================================================

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
dbuchanan - 25 Jun 2008 06:20 GMT
Charles,
In my effort to populate the text box in the report I am using StringBulder
to collect text entered in a ListBox.
Remainder & background: The reason I used the list box was so that I could
remove as well as add data in the event the user chose to go back to a
previous menu in the MultiView.
I am using the following code to retreave the data from the ListBox:
private void RecordGetCriteriaDescription()
{
StringBuilder sb = new StringBuilder("Descripton of the Criteria:");
foreach (ListItem li in lst0Selections.Items)
{
sb.AppendLine(li.Value.ToString());
}
CriteriaDescriptionLabel.Text = sb.ToString();
}
What I am receiving in the intermediate label is run-on text rather than new
lines for each entry.
How can I resolve this?
Thanks,
Doug
Charles Wang [MSFT] - 26 Jun 2008 09:13 GMT
Hi Doug,
If CriteriaDescriptionLabel is a web control, please append "<br>" to the
end of each item:
sb.AppendLine(li.Value.ToString()+"<br>");
If you want to display the criteria in your report, you need to replace
"<br>" by "\r\n".
Hope this helps. Please feel free to let me know if you have any other
questions or concerns.
Best regards,
Charles Wang
Microsoft Online Community 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: msdnmg@microsoft.com.
=========================================================

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
dbuchanan - 27 Jun 2008 05:16 GMT
Charles,
Thank you for your reply.
As it ultimately worked out once I was able to construct the parameter -
even though the carrage returns did not render correcty in the label on the
form and even though I did not use "\n" they actually rendered correctly in
the report itself. (?!)
Thanks.
Doug
Charles Wang [MSFT] - 27 Jun 2008 08:02 GMT
Hi Doug,
Thank you for your response.
Anyway it is good to see that you figured your problem out. Congratulations!
Best regards,
Charles Wang
Microsoft Online Community 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: msdnmg@microsoft.com.
=========================================================

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
dbuchanan - 26 Jun 2008 09:44 GMT
Charles,
> // set the report parameter
> List<ReportParameter> paramList = new List<ReportParameter>();
> paramList.Add(new ReportParameter("CRETERIA",strCreteria));
> this.ReportViewer1.LocalReport.SetParameters(paramList);
What you had would not work,but I found this to be helpful which you
supplied to someone in May
ReportParameter p = new
ReportParameter("year",this.txtProductKey.Text);
this.reportViewer1.ServerReport.SetParameters(new
ReportParameter[] { p });
Thanks,
Doug
Charles Wang [MSFT] - 26 Jun 2008 10:59 GMT
Hi Doug,
There must be something different between our codes. Per my test, it worked
fine. Actually there is no much difference between a generic list and a
normal array here. They should be both working. May you elaborate the not
working scenario?
Best regards,
Charles Wang
Microsoft Online Community 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: msdnmg@microsoft.com.
=========================================================

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
dbuchanan - 27 Jun 2008 05:23 GMT
Charles,
I have no explaination. It may have to do with the using statements, but
your fist code, except for the first line was totally unrecognized by
intellisense in Visual Web Developer 2005 77626-009-0000007-41465 (Visual
Studio 2005 )
Here are my using statements:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Text;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Reporting.WebForms;
The main point is that your May code to another user did work
Thanks,
Doug
Charles Wang [MSFT] - 27 Jun 2008 08:07 GMT
Hi Doug,
Thank you for your response.
Yes, you got the point. If the namespace "System.Collections.Generic" was
referenced, it would work at your side. Sorry for not mentioning it
earlier. I had thought that you knew it.
If you have any other questions or concerns, please feel free to let me
know. Have a nice day!
Best regards,
Charles Wang
Microsoft Online Community 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: msdnmg@microsoft.com.
=========================================================

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================