Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Wednesday, March 28, 2012

How do I lose the exponential display in Query Analyzer?

I have a SQL Server 2000 database with a table with a
field defined as simply [float]. I inserted several
values into the table for this field such as 0.0024.
My question is that when I query the table as follows:
select rcf from tableX
I get such values as 2.3999999999999998E-3. Is there
any reason why SQL Server simply does not display
0.0024? How can I prevent exponential display? Thanks!
GusFloat is an approximate data type and some values cannot be precisely
stored. QA is showing the actual value stored in the database. You can
cast the value to an exact type for display purposes:
DECLARE @.x float
SET @.x = 0.0024
SELECT @.x
SELECT CAST(@.x AS decimal(10,4))
See 'Approximate numeric data' in the SQL Server 2000 Books Online
<createdb.chm::/cm_8_des_04_82ic.htm> for more information.
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"Gus" <gcoll@.yahoo.com> wrote in message
news:be7512a6.0309241846.4892c7ff@.posting.google.com...
> I have a SQL Server 2000 database with a table with a
> field defined as simply [float]. I inserted several
> values into the table for this field such as 0.0024.
> My question is that when I query the table as follows:
> select rcf from tableX
> I get such values as 2.3999999999999998E-3. Is there
> any reason why SQL Server simply does not display
> 0.0024? How can I prevent exponential display? Thanks!
> Gus

Wednesday, March 21, 2012

How do I hide a table in a report programatically?

Hi,
I have 2 tables in a report and, depending on which value a user picks in a
particular parameter, I want to display only one of the tables. Is there any
way to do something like, "IIF(parameters!param_A.value = "Y", visible = true, visible = false)" or something like that for a table?
--
Thanks,
JeffSet the table's Hidden property to an expression. For example:
=CBool(Parameters!HideTheTable.Value)
The Hidden property can be accessed by expanding Visibility... in the
Properties window.
HTH
On Oct 1, 3:39 pm, Jeff Stroope
<JeffStro...@.discussions.microsoft.com> wrote:
> Hi,
> I have 2 tables in a report and, depending on which value a user picks in a
> particular parameter, I want to display only one of the tables. Is there any
> way to do something like, "IIF(parameters!param_A.value = "Y", visible => true, visible = false)" or something like that for a table?
> --
> Thanks,
> Jeff|||On Oct 1, 5:39 pm, Jeff Stroope
<JeffStro...@.discussions.microsoft.com> wrote:
> Hi,
> I have 2 tables in a report and, depending on which value a user picks in a
> particular parameter, I want to display only one of the tables. Is there any
> way to do something like, "IIF(parameters!param_A.value = "Y", visible => true, visible = false)" or something like that for a table?
> --
> Thanks,
> Jeff
The best way to accomplish this is to control the data populating the
table controls at the stored procedure/query level that is sourcing
the report. For example, pass the parameter value back to the stored
procedure(s)/query(ies) and if it is a certain value, return an empty
resultset to the report. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Thanks Chris!
--
Thanks,
Jeff
"Chris Durkin" wrote:
> Set the table's Hidden property to an expression. For example:
> =CBool(Parameters!HideTheTable.Value)
>
> The Hidden property can be accessed by expanding Visibility... in the
> Properties window.
>
> HTH
>
> On Oct 1, 3:39 pm, Jeff Stroope
> <JeffStro...@.discussions.microsoft.com> wrote:
> > Hi,
> >
> > I have 2 tables in a report and, depending on which value a user picks in a
> > particular parameter, I want to display only one of the tables. Is there any
> > way to do something like, "IIF(parameters!param_A.value = "Y", visible => > true, visible = false)" or something like that for a table?
> > --
> > Thanks,
> >
> > Jeff
>
>|||Thanks Enrique!
--
Thanks,
Jeff
"EMartinez" wrote:
> On Oct 1, 5:39 pm, Jeff Stroope
> <JeffStro...@.discussions.microsoft.com> wrote:
> > Hi,
> >
> > I have 2 tables in a report and, depending on which value a user picks in a
> > particular parameter, I want to display only one of the tables. Is there any
> > way to do something like, "IIF(parameters!param_A.value = "Y", visible => > true, visible = false)" or something like that for a table?
> > --
> > Thanks,
> >
> > Jeff
>
> The best way to accomplish this is to control the data populating the
> table controls at the stored procedure/query level that is sourcing
> the report. For example, pass the parameter value back to the stored
> procedure(s)/query(ies) and if it is a certain value, return an empty
> resultset to the report. Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>

Monday, March 12, 2012

How do I get decimal set to 2 in a column?

I am getting frustrated that I can't force a column to display .50 or .00
thus allowing numbers (double) to line up properly? now I have units in the
column NEXT to this one so I don't want to apply formatting to all columns
:)
This is a C# form based report if that means anything different in the
answer.
Thanks.Select the textbox that you want to format, right click, go to properties,
select custom format and type N2
"SRussell" wrote:
> I am getting frustrated that I can't force a column to display .50 or .00
> thus allowing numbers (double) to line up properly? now I have units in the
> column NEXT to this one so I don't want to apply formatting to all columns
> :)
> This is a C# form based report if that means anything different in the
> answer.
> Thanks.
>
>|||"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:922D10BD-EE7E-40BD-93FA-7274C71700AE@.microsoft.com...
> Select the textbox that you want to format, right click, go to properties,
> select custom format and type N2
Thanks!

How do i get a count for one value and a different count from the same value?

I have a field, that display either Yes or no. I want to be able to put in a text box or in a table the count for the yes's and the count for the No's for that one column or various columns. Is this possible?

use a matrix or table

group by the yes/no field

in the value cell put Count(Fields!yes_no.Value)

How do I format zeros (0) to display as dashes (-)?

I am using the current formula and it works. #,###,;(#,###,) How do change
this formula to display the zeros as dashes?
Thanks in AdvanceUse the below expression
=Iif(Fields!Measures_TxnCount.Value=0,'-',
Fields!Measures_TxnCount.Value)
I hope this should solve u r problem
OriginalStealth wrote:
> I am using the current formula and it works. #,###,;(#,###,) How do
change
> this formula to display the zeros as dashes?
>
> Thanks in Advance

How do I format mailing address fields for display in reports

I am very new to development with SQL Server but I have lots of
experience with Access. I am producing a report in VB.Net using
CrystalReports that will display a company's address differently
depending on the contents of the data. For example, if the second
address line is NULL then I don't want it to display at all or if the
customer is not from the US then I want the country field displayed. My
database design is your typical address line 1, line 2, city, state,
postal code, country with lookup tables providing the full text for
state/provinces and countries. There's nothing fancy with the data.
My learning curve is both with Crystal and with SQL Server. I think
I'm better off trying to write a function in Transact SQL that I
could call from the query that VB.Net will use to create the XML that
will drive the report. I simply want to send a completely formatted
string to VB.Net, including commas, spaces and carriage returns and
line feeds. Please let me know if I'm nuts. I'm basing this
decision on the fact that Crystal is not the easiest tool to deal with
and that I probably have a better chance doing it on the server end.
I also have to believe that I'm not the first one who's ever wanted
to do this and am hoping that this code is out there somewhere for me
to legally pilfer and modify. I'm posting because my searches have so
far been unsuccessful.
Now, if anyone in Redmond is listening, those VB developers need to
walk down the hall and talk to the Access developers! I REALLY miss the
Access report writer and query builder. Their functionality and
productivity are superb. I find myself often linking Access to my SQL
Server databases, going into Access to build my query and then cutting
and pasting the SQL into Enterprise Manager. Now, if I could just write
my user-defined functions in VB or C then the world would then be a
much prettier and productive place.I kind of understand where you are coming from here, but you are probably
best served by doing this kind of formatting within crystal rather than in
T-SQL. This really is a presentation issue rather than a data issue.
"Foofs" <marta@.mindcrafted.com> wrote in message
news:1132331118.184758.42090@.g43g2000cwa.googlegroups.com...
>I am very new to development with SQL Server but I have lots of
> experience with Access. I am producing a report in VB.Net using
> CrystalReports that will display a company's address differently
> depending on the contents of the data. For example, if the second
> address line is NULL then I don't want it to display at all or if the
> customer is not from the US then I want the country field displayed. My
> database design is your typical address line 1, line 2, city, state,
> postal code, country with lookup tables providing the full text for
> state/provinces and countries. There's nothing fancy with the data.
> My learning curve is both with Crystal and with SQL Server. I think
> I'm better off trying to write a function in Transact SQL that I
> could call from the query that VB.Net will use to create the XML that
> will drive the report. I simply want to send a completely formatted
> string to VB.Net, including commas, spaces and carriage returns and
> line feeds. Please let me know if I'm nuts. I'm basing this
> decision on the fact that Crystal is not the easiest tool to deal with
> and that I probably have a better chance doing it on the server end.
> I also have to believe that I'm not the first one who's ever wanted
> to do this and am hoping that this code is out there somewhere for me
> to legally pilfer and modify. I'm posting because my searches have so
> far been unsuccessful.
> Now, if anyone in Redmond is listening, those VB developers need to
> walk down the hall and talk to the Access developers! I REALLY miss the
> Access report writer and query builder. Their functionality and
> productivity are superb. I find myself often linking Access to my SQL
> Server databases, going into Access to build my query and then cutting
> and pasting the SQL into Enterprise Manager. Now, if I could just write
> my user-defined functions in VB or C then the world would then be a
> much prettier and productive place.
>|||There is a *crystal* related microsoft newsgroup.
"Foofs" <marta@.mindcrafted.com> wrote in message
news:1132331118.184758.42090@.g43g2000cwa.googlegroups.com...
>I am very new to development with SQL Server but I have lots of
> experience with Access. I am producing a report in VB.Net using
> CrystalReports that will display a company's address differently
> depending on the contents of the data. For example, if the second
> address line is NULL then I don't want it to display at all or if the
> customer is not from the US then I want the country field displayed. My
> database design is your typical address line 1, line 2, city, state,
> postal code, country with lookup tables providing the full text for
> state/provinces and countries. There's nothing fancy with the data.
> My learning curve is both with Crystal and with SQL Server. I think
> I'm better off trying to write a function in Transact SQL that I
> could call from the query that VB.Net will use to create the XML that
> will drive the report. I simply want to send a completely formatted
> string to VB.Net, including commas, spaces and carriage returns and
> line feeds. Please let me know if I'm nuts. I'm basing this
> decision on the fact that Crystal is not the easiest tool to deal with
> and that I probably have a better chance doing it on the server end.
> I also have to believe that I'm not the first one who's ever wanted
> to do this and am hoping that this code is out there somewhere for me
> to legally pilfer and modify. I'm posting because my searches have so
> far been unsuccessful.
> Now, if anyone in Redmond is listening, those VB developers need to
> walk down the hall and talk to the Access developers! I REALLY miss the
> Access report writer and query builder. Their functionality and
> productivity are superb. I find myself often linking Access to my SQL
> Server databases, going into Access to build my query and then cutting
> and pasting the SQL into Enterprise Manager. Now, if I could just write
> my user-defined functions in VB or C then the world would then be a
> much prettier and productive place.
>

Sunday, February 19, 2012

How do I display/upgrade SQL license Info

In SQL 2000 you went to Control Panel and SQL Licensing to view licensing mode and qty. I have searched everywhere for the equivelant in 2005 including books online, knowledge base but can't find anything.

Anybody know where it is hidden as I need to check this server is set up for per processor and check how many processors?

Thanks

Richard

This does not exist in SQL Server 2005, it works by the honour system

How do I display the day name instead of the day #

Hi,

I created a Time Dimension and ended up with the following (as shown in the attached image). The problem is that when I go to the Day level, I see numbers e.g. 1, 2, ..., 31. Instead I want to display the Weekday Name e.g. Monday, Tueday and so on (i.e. what we get with the datename(dw,<date>) function. Right?)

However I am not sure what to change and where in order to get the desired results. Can someone kindly guide me.

Thanks.use:
datename(dw,"dbo"."TimeDimension"."TheDate")

ie

select datename(dw,getdate())|||use:
datename(dw,"dbo"."TimeDimension"."TheDate")


Hi hirshal.

I tried entering the above in the Member Name Column and the Member Key column but did not get the desired effect :(

Can you kindly guide? Do I need to enter the above quoted formula in both fields (Member Name Column and Member Key column) or in only one of these?

Thanks.

How do I display SQL Server 1/1/1900 dates as blank in Access?

Is there an easy way to tell Access (2000 or 2003) to display the "1/1/1900"
that SQL Server 2005 considers a blank date as blank rather than as
"1/1/1900"? I know I can create a function like that shown below to do it.
Public Function BlankDate(datInputDate)
If datInputDate < #1/2/1900# Then
BlankDate = ""
Else
BlankDate = datInputDate
End If
End Function
I'm just hoping there's a simpler more universal way to do it, either on the
Access side or the SQL Server 2005 side.
Thanks!
Michael
I thought that blank date was null.
You could try in your query using:
nullif(FieldName, '1/1/1900') as FieldName
Note that this will not be updatable.
Russel Loski, MCSD.Net
"Michael Nagan" wrote:

> Is there an easy way to tell Access (2000 or 2003) to display the "1/1/1900"
> that SQL Server 2005 considers a blank date as blank rather than as
> "1/1/1900"? I know I can create a function like that shown below to do it.
> Public Function BlankDate(datInputDate)
> If datInputDate < #1/2/1900# Then
> BlankDate = ""
> Else
> BlankDate = datInputDate
> End If
> End Function
> I'm just hoping there's a simpler more universal way to do it, either on the
> Access side or the SQL Server 2005 side.
> Thanks!
> Michael
>
>

How do I display SQL Server 1/1/1900 dates as blank in Access?

Is there an easy way to tell Access (2000 or 2003) to display the "1/1/1900"
that SQL Server 2005 considers a blank date as blank rather than as
"1/1/1900"? I know I can create a function like that shown below to do it.
Public Function BlankDate(datInputDate)
If datInputDate < #1/2/1900# Then
BlankDate = ""
Else
BlankDate = datInputDate
End If
End Function
I'm just hoping there's a simpler more universal way to do it, either on the
Access side or the SQL Server 2005 side.
Thanks!
MichaelI thought that blank date was null.
You could try in your query using:
nullif(FieldName, '1/1/1900') as FieldName
Note that this will not be updatable.
--
Russel Loski, MCSD.Net
"Michael Nagan" wrote:
> Is there an easy way to tell Access (2000 or 2003) to display the "1/1/1900"
> that SQL Server 2005 considers a blank date as blank rather than as
> "1/1/1900"? I know I can create a function like that shown below to do it.
> Public Function BlankDate(datInputDate)
> If datInputDate < #1/2/1900# Then
> BlankDate = ""
> Else
> BlankDate = datInputDate
> End If
> End Function
> I'm just hoping there's a simpler more universal way to do it, either on the
> Access side or the SQL Server 2005 side.
> Thanks!
> Michael
>
>

How do I display SQL Server 1/1/1900 dates as blank in Access?

Is there an easy way to tell Access (2000 or 2003) to display the "1/1/1900"
that SQL Server 2005 considers a blank date as blank rather than as
"1/1/1900"? I know I can create a function like that shown below to do it.
Public Function BlankDate(datInputDate)
If datInputDate < #1/2/1900# Then
BlankDate = ""
Else
BlankDate = datInputDate
End If
End Function
I'm just hoping there's a simpler more universal way to do it, either on the
Access side or the SQL Server 2005 side.
Thanks!
MichaelI thought that blank date was null.
You could try in your query using:
nullif(FieldName, '1/1/1900') as FieldName
Note that this will not be updatable.
--
Russel Loski, MCSD.Net
"Michael Nagan" wrote:

> Is there an easy way to tell Access (2000 or 2003) to display the "1/1/190
0"
> that SQL Server 2005 considers a blank date as blank rather than as
> "1/1/1900"? I know I can create a function like that shown below to do it
.
> Public Function BlankDate(datInputDate)
> If datInputDate < #1/2/1900# Then
> BlankDate = ""
> Else
> BlankDate = datInputDate
> End If
> End Function
> I'm just hoping there's a simpler more universal way to do it, either on t
he
> Access side or the SQL Server 2005 side.
> Thanks!
> Michael
>
>

How do I display SQL info. in a VB textbox?

I need to find out how to display, edit and save SQL information using Visual Basic. I can create an SQL database and spreadsheet, but do not know how to incroporate it into my project, and make certain pieces of the information (certain cells) appear in the labels or textboxes that I designate in my VB Project.

Thanks.

You should check out the information in the VB.NET help files. Take a look at the topics at http://msdn2.microsoft.com/en-us/vbasic/ms789183.aspx and the help files at http://msdn2.microsoft.com/en-us/library/zh26sed6(VS.80).aspx.

Mike

|||

I don't understand what the links show.

This problem is also related to MSDN Forums>SQL Server>SQL Express>How can VB look something up in an SQL Table?

How do I display lables outside Chart area of a Pie Chart

How do I display the labels outside of the chart area of a pie chart? The
Point Labels properties tab of the Chart Value does not show a setting to
display labels outside of the chart area. Am I missing something?
PPNote: you will need SP1 installed for this to work. The SP1 readme contains
a section about outside labels in pie charts:
http://download.microsoft.com/download/7/f/b/7fb1a251-13ad-404c-a034-10d79ddaa510/SP1Readme_EN.htm#_chart_enhancements
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"B. Mark McKinney" <BMarkMcKinney@.discussions.microsoft.com> wrote in
message news:D2C14B13-3314-4553-AF82-41039BFE60F2@.microsoft.com...
> On the Point Labels tab uncheck the Auto checkbox n the Position secition.
> "msnews.microsoft.com" wrote:
> > How do I display the labels outside of the chart area of a pie chart?
The
> > Point Labels properties tab of the Chart Value does not show a setting
to
> > display labels outside of the chart area. Am I missing something?
> >
> > PP
> >
> >
> >

How do I display info on the report parameters on the face of the report ?

I have several parameters used to constrain which data to select from the database.
Examples of prompts for these parameters ;
"Include accesstype:"
"Include activationdate:"
"Include speed data:"
The user chooses Yes or No to each of these.

On the face on the report I want to put some textboxes to display all the parameters with the prompt (as stated above) and the actual value chosen by the user (Y/N). For clarity, I'm not talking about the report parameter area, but about what you will see on a report print-out.

However, working with a parameter in the expression editor, I can only select members Value, Label, Count and IsMultivalue. I would have expected to be able to select "Prompt", but that is not a member of ReportObjectModel.Parameter.

Anyone have a clue ?

BTW - has anyone been able to display a single checkbox for this kind of paramteres ? (Y/N or True/False. A boolean parameter displays as 2 radiobuttons, labelled True and False)

Thanks !

Parameters!ParameterName.Label should give you the value the user selected.

-Geoff

|||

As I stated in my post, I'm aware of the "Label" member. However I want to access the text I wrote in the report parameter form, in the field labelled "Prompt" (in the opper right part of the form) , not the field labelled "Label" (in the "Available values" part of the form) as you suggest .

Consider that there are in fact 3 elements in play for a parameter displayed with a dropdownlist, namely the text which precedes the dropdownlist (this is the one I want to access), the labels displayed in the dropdown and the corresponding values.

Wally :-)

How do I display info on the report parameters on the face of the report ?

I have several parameters used to constrain which data to select from the database.
Examples of prompts for these parameters ;
"Include accesstype:"
"Include activationdate:"
"Include speed data:"
The user chooses Yes or No to each of these.

On the face on the report I want to put some textboxes to display all the parameters with the prompt (as stated above) and the actual value chosen by the user (Y/N). For clarity, I'm not talking about the report parameter area, but about what you will see on a report print-out.

However, working with a parameter in the expression editor, I can only select members Value, Label, Count and IsMultivalue. I would have expected to be able to select "Prompt", but that is not a member of ReportObjectModel.Parameter.

Anyone have a clue ?

BTW - has anyone been able to display a single checkbox for this kind of paramteres ? (Y/N or True/False. A boolean parameter displays as 2 radiobuttons, labelled True and False)

Thanks !

Parameters!ParameterName.Label should give you the value the user selected.

-Geoff

|||

As I stated in my post, I'm aware of the "Label" member. However I want to access the text I wrote in the report parameter form, in the field labelled "Prompt" (in the opper right part of the form) , not the field labelled "Label" (in the "Available values" part of the form) as you suggest .

Consider that there are in fact 3 elements in play for a parameter displayed with a dropdownlist, namely the text which precedes the dropdownlist (this is the one I want to access), the labels displayed in the dropdown and the corresponding values.

Wally :-)

How do I display a SSRS report in a web page?

I have developed a web site with Visual Web Developer 2005 Express, and SQL Server 2005. After 18 months I have a reasonable understanding of VB.net and SQL Server programming, but I am a complete newbie with Sql Server Reporting Services. SSRS seems to be pretty easy and mostly intuitive for the simple tasks that I've tried, although so far I haven't progressed beyond developing a report and displaying it in the preview tab.

I am now trying to display my first report from within my web site, so that clicking a button on the prior page displays the report, presumably with Response.Redirect("~/Reportpage?Query") where "ReportPage" is the url of a page to display the report, and Query gives the report parameters in the usual style of a request query. The target page could either be a normal .aspx page with the report embedded in the design, perhaps as an IFrame, or it could be a page produced directly by SSRS. I'd prefer the .aspx approach as it would allow me to use my usual master page with its standard on-entry logic, unless the direct-SSRS approach is much easier.

On clicking around in the HELP trying to find how to do this, the HELP seems to imply that I should embed a reportviewer control in my page? Is this right? If yes, where do I get this from? It is not in the VWD 2005 toolbox, but perhaps I have to import it. I am using SSRS within Visual Studio 2005: have I reached the point where I have to move beyond VWD 2005 Express and upgrade to the full Visual Studio?

Hi,

You can either give the report url, but the best way is to use Report viewer control. Its a microsoft inbuilt control. Include the below name space b4 using it

<%@.RegisterAssembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"Namespace="Microsoft.Reporting.WebForms"TagPrefix="rsweb" %>

Hope this is helpful to u

|||

OK, I've added this into my web page, so that it now starts: -
<%@. Page Language="VB" MasterPageFile="~/GDBMaster_P.master" AutoEventWireup="false"
CodeFile="GDB_PR2des.aspx.vb" Inherits="UploadedDocs_GDB2" Title="GDB2" %>
<%@. Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

and continues with the XML describing the page.

Now what? How do I use the report viewer control? Do I need to add it to the toolbox, or do I code something like "<rsweb parameters/> " into the source of my page.

If toolbox, how do I add it? If source, where do I find out what the properties are?"

|||

Hi,

You can follow the steps below to add your report viewer.

In Solution Explorer, right-click Default.aspx, select View Designer.

Open the Toolbox window. From the Data group, drag a ReportViewer control onto the page.

If it is not already open, open the ReportViewer Tasks smart tag panel by clicking the triangle in the upper right corner of the ReportViewer control on the Web page. In the Choose Report box, select the fully qualified file name for Report.rdlc.

When you select a report, instances of data sources used in the report are created automatically. Code is generated to instantiate each DataTable (and its DataSet container) and an ObjectDataSource control corresponding to each data source used in the report. This data source control is configured automatically.

For more information, see:
http://msdn2.microsoft.com/en-us/library/ms252123(VS.80).aspx

Thanks.

|||

Thank you for your reply, but there is still a problem. Your reply describes exactly the process that I had expected, and so I had searched the toolbox for a ReportViewer control before I posted this question (see my first post of this thread). I had expected that "Data" would be the most likely group, but I checked them all anyway. My data group contains only these controls: -
Pointer
Gridview
DataList
DetailsList
Formview
Repeater
SQLDataSource
AccessDataSource
ObjectDataSource
XMLDataSource
SiteMapDataSource

So the key question is, How do I get a reportviewer control into this group?

Regards, Robert

|||

Hi, If u could not able to find reportviewer in your toolbox add the following references

Microsoft.ReportViewer.Common.dll

Microsoft.ReportViewer.WebForms.dll

u can find these dlls in the path

C:\Program Files\Microsoft Visual Studio 8\ReportViewer

Then u right click the tool box and select new items to add in it. Add Report Viewer (Name Space Microsoft.Reporting.Webforms).

U can c the reportviewer control in ur toolbox now

|||

Thank you! That's put the ReportViewer into the toolbox, and now my test page has a ReportViewer control.

Next problem: selecting the report. This is not going smoothly. When I open the smart tag, options are "Choose Report" and "Design a new report".

If I click "Choose Report" the only option is <Server Report> so I select that. The ReportserverURL appears as http://localhost/reportserver, and I am asked to enter the report name.

I enter C:\Documents and Settings\Robertb.ROBERTB\My Documents\Visual Studio 2005\Projects\GDBReports\GDBReports\GDBReport1.rdl (Nai-Dong Jin's post said to select "report1.rdlc", but there are no .rdlc files).

Now I test my web page, by clicking on

Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: --
  • Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- <html> <head> <title> SQL Server Reporting Services </title><meta name="Generator" content="Microsoft SQL Server Reporting Services 9.00.3042.00" /> <meta name="HTTP Status" content="500" /> <meta name="ProductLocaleID" content="9" /> <meta name="CountryLocaleID" content="1033" /> <meta name="StackTrace" content=" at Microsoft.ReportingServices.Library.ConnectionManager.OpenConnection() at Microsoft.ReportingServices.Library.Global.get_SharePointIntegratedFlagFromCatalog() at Microsoft.ReportingServices.WebServer.Global.RunOnlyOnceStartReportServer() at Microsoft.ReportingServices.WebServer.Global.StartApp() at Microsoft.ReportingServices.WebServer.Global.Application_BeginRequest(Object sender, EventArgs e)" /> <style> BODY {FONT-FAMILY:Verdana; FONT-WEIGHT:normal; FONT-SIZE: 8pt; COLOR:black} H1 {FONT-FAMILY:Verdana; FONT-WEIGHT:700; FONT-SIZE:15pt} LI {FONT-FAMILY:Verdana; FONT-WEIGHT:normal; FONT-SIZE:8pt; DISPLAY:inline} .ProductInfo {FONT-FAMILY:Verdana; FONT-WEIGHT:bold; FONT-SIZE: 8pt; COLOR:gray} A:link {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR:#3366CC; TEXT-DECORATION:none} A:hover {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR:#FF3300; TEXT-DECORATION:underline} A:visited {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; COLOR:#3366CC; TEXT-DECORATION:none} A:visited:hover {FONT-SIZE: 8pt; FONT-FAMILY:Verdana; color:#FF3300; TEXT-DECORATION:underline} </style> </head><body bgcolor="white"> <h1> Reporting Services Error<hr width="100%" size="1" color="silver" /> </h1><ul> <li>The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. (rsReportServerDatabaseUnavailable) <a href="http://links.10026.com/?link=http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsReportServerDatabaseUnavailable&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.3042.00" target="_blank">Get Online Help</a></li><ul> <li>An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)</li> </ul> </ul><hr width="100%" size="1" color="silver" /><span class="ProductInfo">SQL Server Reporting Services</span> </body> </html> --.|||

    Hi,

    and I am asked to enter the report name. I enter C:\Documents and Settings\Robertb.ROBERTB\My Documents\Visual Studio 2005\Projects\GDBReports\GDBReports\GDBReport1.rdl (Nai-Dong Jin's post said to select "report1.rdlc", but there are no .rdlc files).

    Here, what the system is asking your to enter a rdlc file. This file must be created in your website application by adding new items in your previous steps. Now the following are the whole steps for you, which comes from that link in my previous post:

    From the Website menu, select Add New Item.

    From the Add New Item dialog, select the Report template, enter a name for the report file, and then click Add. This creates a report definition file (the default is Report.rdlc), launches the Report Designer, and displays the Website Data Sources pane.

    Thanks.

    |||

    How do I add the report template to the "add new item" dialog?

    Thanks, Robert.

    |||

    Hi,

    Let's see the whole procedure, our aim is to create a report for a Microsoft Visual Studio 2005 ASP.NET Web site and add a ReportViewer control to a Web page so users can view the report.

    1. First, you should create a new Web site, and create a default.aspx page, switch it to the design mode.

    2. You may define a data connection and DataTable by adding a DataSet.

    3. It's an important step Design the report.

    1). From the Website menu, select Add New Item.

    2). From the Add New Item dialog, select the Report template, enter a name for the report file, and then click Add. This creates a report definition file (the default is Report.rdlc), launches the Report Designer, and displays the Website Data Sources pane.

    3). Open the Toolbox. Click on a textbox and then on the report design surface.

    4). Enter a report title in the textbox: # of Employees per Shift per Dept. Expand the textbox if necessary.

    5). From the Toolbox, drag a Matrix report item onto the report below the textbox. The dotted white background is your report page. To adjust the matrix location on the page, click the left corner to select it, and drag or use arrow keys to move the item as needed.

    6). From the Website Data Sources window, expand the DataTable1 node until you see the columns from your query. Drag Dept onto the Rows textbox in the first column, second row of the matrix.

    7). Drag Shift onto the Columns textbox in the second column, first row of the matrix. While the textbox is selected, in the Properties window, set the TextAlign property to Right. Click in the textbox to activate the Report Formatting toolbar, and click the Bold button.

    8). Select the matrix by clicking anywhere in the matrix. Right-click and select the matrix by name (the default is matrix1). An outline will appear around the matrix report item. Right-click the outline and select Properties. Check that the title of the dialog that opens is Matrix Properties.

    9). Click the Groups tab. In the Columns section, click Edit.

    10). In the Sorting and Grouping dialog, click the Sorting tab.

    11). Click in the first box under Expression to activate the textbox. From the drop-down list, choose =Fields!Dept.Value. This ensures the report data will be sorted by Department name. Click OK.

    12). Click OK to close the Matrix Properties dialog.

    13). From the Website Data Sources window, drag the EmployeeID field onto the Data textbox in the second column, second row of the matrix. Right-click this textbox and select Expression.

    14). Edit the default Sum aggregate function and change it to Count. Click OK.

    15). Click OK to close the Textbox Properties dialog.

    16). On the File menu, select Save All.

    4. The last step: Add a ReportViewer control to the application

    1). In Solution Explorer, right-click Default.aspx, select View Designer.

    2). Open the Toolbox window. From the Data group, drag a ReportViewer control onto the page.

    3). If it is not already open, open the ReportViewer Tasks smart tag panel by clicking the triangle in the upper right corner of the ReportViewer control on the Web page. In the Choose Report box, select the fully qualified file name for Report.rdlc.

    Thanks.

    |||

    I have not created a new website, as everything should work the same way on a new page within my existing website. Apart from that difference, I have been trying to follow the procedure above. Where I'm stuck: -

    From the Add New Item dialog,select the Report template, enter a namefor the report file, and then click Add.

    There is no report template within my Add New Item dialog. In my previous post I asked how to add it. I expect that once I have this, it will be easy, but without it I'm stuck.

    Thanks, Robert

  • How do I display a count?

    I want to display the number of records for each state in a database. I'm using a strongly types dataset. In my method, I have the following

    SELECT COUNT(ID) AS iTotal, STATE
    FROM members
    WHERE (Suspend = 0)
    GROUP BY STATE
    ORDER BY STATE

    In the code behind of my page I have

    Dim mateAdapter As New WAPTableAdapters.membersTableAdapter
    Dim mates As WAP.membersDataTable
    Dim mate As WAP.membersRow

    mates = mateAdapter.GetDataState

    For Each mate In mates
    Select Case mate.STATE
    Case "AK"
    LabelAK.Text = mate.ID.
    End Select
    Next

    What shouldLabelAK.Text = mate.ID. be for me to be able to display the number of records that have 'AK' in the state field?

    Diane

    I think if you use

    LabelAK.Text = mate.iTotal

    you'll get what you're looking for.

    |||

    That's what i thought, but it doesn't like it.

    Description:Anerror occurred during the compilation of a resource required to servicethis request. Please review the following specific error details andmodify your source code appropriately.

    Compiler Error Message:BC30456: 'iTotal' is not a member of 'WAP.membersRow'.

    But it is in the dataset, and i can get a preview of the data in the dataset. But it doesn't like it in the page.

    Diane

    |||
    Try mate.iTotal.ToString

    I had some state and zipcode data around so I put this together.

    webform:

    <%@. Page Language="VB" AutoEventWireup="false" CodeFile="Test.aspx.vb" Inherits="Test" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:Label id="LabelMO" runat="server" Text="Label"></asp:Label> </div> </form></body></html>

    code behind:

    Imports WAPTableAdaptersPartialClass TestInherits System.Web.UI.PageProtected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs) _Handles Me.LoadDim mateAdapterAs New ZipcodesTableAdapterDim matesAs WAP.ZipcodesDataTableDim mateAs WAP.ZipcodesRow mates = mateAdapter.GetDataStateFor Each mateIn matesSelect Case mate.StateCase"MO" LabelMO.Text = mate.iTotal.ToStringEnd Select Next End SubEnd Class


    GetDataStat method:

    selectcount(Zipcode)as iTotal, Statefrom ZipcodesGroup by StateOrder by State
    |||

    I have exactly what you do, and I'm getting the error that iTotal is not a member of the row. There must be something I'm overlooking that I've got wrong. But when i compare mine with yours, I don't see a difference.

    Diane

    |||

    That is very odd, I know how you feel though. Sometimes what seems like it should be so easy is infuriatingly difficult.

    Post your code so I can play around with it, or you can send it to me at eterry28 @. gmail . com

    |||

    Thank youeterry28

    I did post my code in the first post.

    Diane

    |||

    I resolved my problem by returning the state field in all rows and changing my code to Inmates.Compute("count(STATE)", "STATE='VT'").ToString

    Thanks for your help

    Diane

    How do i display a checkbox on a report?

    Hi,
    I've been trying to display a checkbox on a report using unicode text eg. ? (U+2616) (Arial Unicode MS). I get the error: BC30037: Character is not valid. I have read somewhere about using html formatting to display it, how could this be done?
    Is there any thing else i could do?

    Thanks,
    Sam.I've managed to fix the error, simple mistake. Why is it there are very few controls in reporting services compared with access? Is it possible to create custom controls for reports?
    Thanks.|||I've been trying to show a boolean value in the database on the report with either a checkbox, Yes/No, or something easyfor a non-technical user to read.(definitely not True/False) Can you please tell me how to put together the expression with the dataset valuse? How to display unicode characters?|||

    I got my solution finally. Stupid me that didn't know I can open up the expression editor to choose functions from, and didn't know I can right-click the field to open up expression editor.

    Thanks anyway.

    |||

    I"m interested in seeing your solution. Can you post as reply to this thread? I'll bet a lot of us report designers could use this little tidbit.

    thanks,

    |||

    please post the code for this issue.

    thanks.

    |||

    textbox
    set properties
    Borderstyle
    Default = Solid
    Font
    FontFamily = Wingdings2

    Expression
    Value =iif( Fields!....Value = "True", "P", "" )

    How do i display a checkbox on a report?

    Hi,
    I've been trying to display a checkbox on a report using unicode text eg. ? (U+2616) (Arial Unicode MS). I get the error: BC30037: Character is not valid. I have read somewhere about using html formatting to display it, how could this be done?
    Is there any thing else i could do?

    Thanks,
    Sam.I've managed to fix the error, simple mistake. Why is it there are very few controls in reporting services compared with access? Is it possible to create custom controls for reports?
    Thanks.|||I've been trying to show a boolean value in the database on the report with either a checkbox, Yes/No, or something easyfor a non-technical user to read.(definitely not True/False) Can you please tell me how to put together the expression with the dataset valuse? How to display unicode characters?|||

    I got my solution finally. Stupid me that didn't know I can open up the expression editor to choose functions from, and didn't know I can right-click the field to open up expression editor.

    Thanks anyway.

    |||

    I"m interested in seeing your solution. Can you post as reply to this thread? I'll bet a lot of us report designers could use this little tidbit.

    thanks,

    |||

    please post the code for this issue.

    thanks.

    |||

    textbox
    set properties
    Borderstyle
    Default = Solid
    Font
    FontFamily = Wingdings2

    Expression
    Value =iif( Fields!....Value = "True", "P", "" )

    How do i display a checkbox on a report?

    Hi,
    I've been trying to display a checkbox on a report using unicode text eg. ? (U+2616) (Arial Unicode MS). I get the error: BC30037: Character is not valid. I have read somewhere about using html formatting to display it, how could this be done?
    Is there any thing else i could do?

    Thanks,
    Sam.I've managed to fix the error, simple mistake. Why is it there are very few controls in reporting services compared with access? Is it possible to create custom controls for reports?
    Thanks.|||I've been trying to show a boolean value in the database on the report with either a checkbox, Yes/No, or something easyfor a non-technical user to read.(definitely not True/False) Can you please tell me how to put together the expression with the dataset valuse? How to display unicode characters?|||

    I got my solution finally. Stupid me that didn't know I can open up the expression editor to choose functions from, and didn't know I can right-click the field to open up expression editor.

    Thanks anyway.

    |||

    I"m interested in seeing your solution. Can you post as reply to this thread? I'll bet a lot of us report designers could use this little tidbit.

    thanks,

    |||

    please post the code for this issue.

    thanks.

    |||

    textbox
    set properties
    Borderstyle
    Default = Solid
    Font
    FontFamily = Wingdings2

    Expression
    Value =iif( Fields!....Value = "True", "P", "" )