Showing posts with label value. Show all posts
Showing posts with label value. Show all posts

Thursday, March 29, 2012

Basic Question: Setting a varaiable to a datasource.select value

Hi!


I am trying to do something that I would think should be rather simple.

I have a SQLDataSource that has a simple select statement.

I have a String Variable st_temp

I know my SQLDataSource returns only one value, and it's a string.

HOW DO I DO somehitng like st_temp=SQLDataSource.Select;

I am getting nothing but errorrs

Thanks in advance

Dan

What errors are you getting?|||

If you are using just a single value then there is no need for SQLDataSource object. You can directly use SQLCommand.ExecuteScalar() method.

|||

2 things:

1. sorry to be so dense but how do I use SQLCommand.ExecuteScalar() method. in C#?

2. Errors are

":CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement" when I call SDSSelect.Select;

and

":CS0428: Cannot convert method group 'Select' to non-delegate type 'string'. Did you intend to invoke the method?" when I call Label1.Text= SDSSelect.Select;



Thanks again for the help...i shouldda stayed in Java land!|||

Thanks for all the HELP!!!

Dan

Tuesday, March 27, 2012

basic question for sp

Hi,
I need to write a sp. In the sp first I do a select statement (select cycle
from table where ... ) it only returns a single value. and the rest of the s
p
will do different select based the value. how can assign the result to a
varable? ThanksJen,
Try:
DECLARE @.MYVAR INT --OR CHAR OR VARCHAR OR...DEPENDING ON VALUE
SELECT @.MYVAR = COL FROM...
HTH
Jerry
"Jen" <Jen@.discussions.microsoft.com> wrote in message
news:CB644854-6C94-48BC-8E45-9DC9A959F0C5@.microsoft.com...
> Hi,
> I need to write a sp. In the sp first I do a select statement (select
> cycle
> from table where ... ) it only returns a single value. and the rest of the
> sp
> will do different select based the value. how can assign the result to a
> varable? Thanks|||Something along the lines of:
SET @.var = ( SELECT ... ) ;
You will have to make sure the select statement returns a single value or
you will get an error.
Anith|||DECLARE @.Variable <type>
SELECT @.Variable = cycle FROM table WHERE ...
John Scragg
"Jen" wrote:

> Hi,
> I need to write a sp. In the sp first I do a select statement (select cycl
e
> from table where ... ) it only returns a single value. and the rest of the
sp
> will do different select based the value. how can assign the result to a
> varable? Thankssql

Thursday, March 22, 2012

Bar Visibility

I am trying to toggle the visibility of a simple bar by the value of a
parameter named DETAIL.
This is the expression used =IIF(Parameters!DETAIL.Value=true,false,true)
When I view the report in .NET IDE it displays fine, when deployed to the
target server I recieve the following error
Reporting Services Error
----
--
a.. Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException was
thrown. (rrRenderingError) Get Online Help
a.. Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException was
thrown.
a.. Object reference not set to an instance of an object.
----
--
Microsoft Reporting Services
Any help would be greatly appreciated.
-SteveNot sure, but probably this is happening because you are getting a type
mismatch. Try this:
=(Parameters!DETAIL.Value.ToString()="false")
Note that you don't really need to use the IIf statement here, because your
expression evaluates to a Boolean anyway...
"Steven Bennett" <Steven.Bennett@.newsgroup.nospam> wrote in message
news:eYwdp0R7EHA.1204@.TK2MSFTNGP10.phx.gbl...
>I am trying to toggle the visibility of a simple bar by the value of a
> parameter named DETAIL.
> This is the expression used =IIF(Parameters!DETAIL.Value=true,false,true)
> When I view the report in .NET IDE it displays fine, when deployed to the
> target server I recieve the following error
> Reporting Services Error
> ----
> --
> a.. Exception of type
> Microsoft.ReportingServices.ReportRendering.ReportRenderingException was
> thrown. (rrRenderingError) Get Online Help
> a.. Exception of type
> Microsoft.ReportingServices.ReportRendering.ReportRenderingException was
> thrown.
> a.. Object reference not set to an instance of an object.
> ----
> --
> Microsoft Reporting Services
>
> Any help would be greatly appreciated.
> -Steve
>|||Hello Sophie,
The ability to toggle visibility works with the text box but not with a
line. Both preview correctly in Visual Studio and both deploy with no errors
and no warnings. When I access the report it throws a rendering error (see
original post).
Please try the following to re-create the error.
Create a blank report.
Add a line to the report.
Create a boolean parameter named DETAIL with a default value of False and a
prompt.
Add the statement "=(Parameters!DETAIL.Value=false)" to the Visibility
property of the line.
Preview the report in Visual Studio.
Toggle the DETAIL parameter to True and then click View Report.
Toggle the DETAIL parameter to False and then click View Report.
Deploy the report to the ReportServer
Access the ReportServer using IE
(http://ReportServerName/ReportServer?/ReportServerFolder/ReportName&rs:comm
and=render)
This is the point where I recieve the exception. Please let me know if you
were succesfull in recreating the error.
-Steve
"Sophie Guo [MSFT]" <v-sguo@.online.microsoft.com> wrote in message
news:C65hYCX7EHA.2600@.cpmsftngxa10.phx.gbl...
> Hello Steve,
> I recommend you perform the following steps to narrow down the issue:
> 1. Create a new sample report file which includes a text box.
> 2. Set the Visibility property of the text box to the following
expression:
> =IIF(Parameters!DETAIL.Value=true,false,true)
> Note: you need create a report parameter called DETAIL, please refer to
the
> attachment i upload to set the properties of DETAIL.
>
> 3. Try to preview the report.
> If it can be previewed successfully, deploy the new created report. If you
> can deploy the report successfully, it indicates that the problem is not
> related to the expression.
> If you are unable to deploy the new created report successfully, send me
> the Reporting Services Log Files for research. If Reporting Services is
> installed in the 'Program Files' folder, you can find the logfiles in the
> following folder:
> C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\LogFiles
> Note: please compress the log files before you send it to me.
> If anything is unclear, get in touch. I look forward to hearing from you.
>
> Sophie Guo
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> =====================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================> This posting is provided "AS IS" with no warranties, and confers no
rights.|||Hello Steve,
Thanks for your reply.
I have reproduced this issue on my side and received the exact same error.
I believe you have found a new bug in Reporting Service.
I have forwarded this issue to the appropriate folks to catch their
immediate attention. They will investigate this issue and determine if it
is a bug at the urgent level.
Thank you for all your feedback on RS. I believe that all customers'
feedback will enhance our products.
Have a nice day!
Sophie Guo
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
=====================================================When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Bar Graph's Y Axis as 10k, 20k, 30k

Hi,
The Y-axis value on my Bar Graph displays as 10000, 20000, 30000 . . not good aesthetics and not legible when figure goes beyond 6 in size
I need to show it as 10k, 20k, 30k, like Crystal Reports does by default...
How can i do this ?
ThanksRight-click on the chart to open the chart properties dialog. Go to the
Y-axis tab, and use the following formatcode:
0,k
This will give you 10k, 20k, etc. Further information is available on MSDN:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"push" <push@.discussions.microsoft.com> wrote in message
news:D6FF9A5C-8350-434D-A80D-7977F35D5614@.microsoft.com...
> Hi,
> The Y-axis value on my Bar Graph displays as 10000, 20000, 30000 . . not
good aesthetics and not legible when figure goes beyond 6 in size
> I need to show it as 10k, 20k, 30k, like Crystal Reports does by
default...
> How can i do this ?
> Thanks

Bar chart target value

Hi, I need to create a bar chart with values for quality indicators. Is there
a way to draw a horizontal line to indicate target or min/max value in RS
2000 (2005)?You could just add another data series and plot that series as line (select
the "plot data as line" checkbox on the appearance tab). Set the data value
expression a "constant" value e.g. =150 and set the BorderColor property
accordingly.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Mattsson" <Mattsson@.discussions.microsoft.com> wrote in message
news:1EBA6156-A090-455E-A348-9FB40F344CD9@.microsoft.com...
> Hi, I need to create a bar chart with values for quality indicators. Is
> there
> a way to draw a horizontal line to indicate target or min/max value in RS
> 2000 (2005)?
>sql

Bar chart report(grouping datetime info yearly, monthly, etc...)

hello,

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

One possible solution is to create two separate graphs. For the first graph, you can use years as the increments. For the second graph, you can use months as the increments. Then, create a visibility expression using IIF to show one graph when the range between the dates meets the requirements, This will enable you to determine which graph is visible to the user based on the range between the dates.

I understand this isn't the most efficient solution, but it will at least solve your problem.

|||

Hi Joel,

That was not my question. As I mentioned earlier, I want to change the x-axis value based on the parameters value. The main thing is grouping the datetime info based on the parameter condition(yearly, monthly, etc.) as I mentioned earlier. Please refer the highlighted values in the previous post. On the top of that, the two examples that I mentioned earlier are just two conditions, I might need to add another conditions such as weekly, daily and hourly basis reports.

Sincerely,

Amde

|||

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

|||

Hi guys,

Is this question not clear or difficult to answer? Does any body came across this kind of scenario?

Please let me know?

Sincerely,

Amde

sql

Bar chart report

hello,

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

One possible solution is to create two separate graphs. For the first graph, you can use years as the increments. For the second graph, you can use months as the increments. Then, create a visibility expression using IIF to show one graph when the range between the dates meets the requirements, This will enable you to determine which graph is visible to the user based on the range between the dates.

I understand this isn't the most efficient solution, but it will at least solve your problem.

|||

Hi Joel,

That was not my question. As I mentioned earlier, I want to change the x-axis value based on the parameters value. The main thing is grouping the datetime info based on the parameter condition(yearly, monthly, etc.) as I mentioned earlier. Please refer the highlighted values in the previous post. On the top of that, the two examples that I mentioned earlier are just two conditions, I might need to add another conditions such as weekly, daily and hourly basis reports.

Sincerely,

Amde

|||

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

|||

Hi guys,

Is this question not clear or difficult to answer? Does any body came across this kind of scenario?

Please let me know?

Sincerely,

Amde

bar chart problem, different bar length at same imput value

I have a bar chart, displaying different bar length with same value ( 5
input with exact same value but in different series group ). Please help.
--
SincerelyFrank,
Are you sure you are not mixing data, category, and series fields?
Regards,
Cem
"Frank RS" <FrankRS@.discussions.microsoft.com> wrote in message
news:E708D16C-3261-4993-B1E9-A8A1EE4A7465@.microsoft.com...
> I have a bar chart, displaying different bar length with same value ( 5
> input with exact same value but in different series group ). Please help.
> --
> Sincerely|||It is a tabular table with two columns, ProductID and
SalesAmountPercentageChange.
I put the SalesAmountPercentageChange in the "values", and ProductID into
the "Series" field. (If I put the ProductID into the "group", the bars are
displayed in same color, which I want it different)
Thanks in advance for any further help.
"Cem Demircioglu" wrote:
> Frank,
> Are you sure you are not mixing data, category, and series fields?
> Regards,
> Cem
> "Frank RS" <FrankRS@.discussions.microsoft.com> wrote in message
> news:E708D16C-3261-4993-B1E9-A8A1EE4A7465@.microsoft.com...
> >
> > I have a bar chart, displaying different bar length with same value ( 5
> > input with exact same value but in different series group ). Please help.
> >
> > --
> > Sincerely
>
>

Bar Chart hiding final Data Label

Hi All,
I have a Bar Chart that displays the Point Labels for the data.
Unfortunately the final value (the one nearest the x-axis) is not being
displayed. Can anyone tell me why and/or how to turn this off?
Thanks in advance
CathieDid you turn off margins to see it helps?
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Cathie Hagen" <cathie@.bob.com> wrote in message
news:Oj9$coPrEHA.376@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I have a Bar Chart that displays the Point Labels for the data.
> Unfortunately the final value (the one nearest the x-axis) is not being
> displayed. Can anyone tell me why and/or how to turn this off?
> Thanks in advance
> Cathie
>sql

Tuesday, March 20, 2012

BAFFLED! Why won't this code work?!?!

Hello,
The below code is intended to create a sp, then loop through a set of
values, each time running the sp with the new value. The CREATE PROC
executes fine, but I get an error when attempting the loop: "Invalid
column name 'tblIR_LB_2'."
Your help appreciated!
CREATE PROC sp_CreateIRTables ( @.tbl smallint)
AS
DECLARE @.SQL varchar(999)
SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
[dteDate] [smalldatetime] NULL ,
[sglSTDEV(upper)] [float] NULL ,
[sglSTDEV(lower)] [float] NULL ,
[intMA] [smallint] NULL ,
[dblPL] [float] NULL ,
[dblSTDEV] [float] NULL ,
[dblIR] [float] NULL ,
[intTotalDays] [int] NULL ,
[intExposure] [int] NULL ) ON [PRIMARY]'
EXEC (@.SQL)
DECLARE @.i smallint
SET @.i = 1
WHILE (@.i <= 32)
BEGIN
EXECUTE sp_CreateIRTables @.i
SET @.i = @.i + 1
END> CREATE PROC sp_CreateIRTables ( @.tbl smallint)
DON'T USE sp_ PREFIX!

> SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
Is it @.tbl or @.tblname? Pick one.|||> SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
@.tblname is, for some reason, a SMALLINT, not any kind of string.
First, I suggest not using this kind of unmanageable scheme.
But to solve your issue in the short term, you can convert to a character
type, e.g.
SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + CONVERT(VARCHAR(12), @.tblname)
+ '] (|||You can't have a variable in the table name of a CREATE TABLE unless you use
dynamic SQL to create
the table. Why not create a temp table instead?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Butaambala" <brogers75@.yahoo.com> wrote in message
news:1131645127.077192.239150@.f14g2000cwb.googlegroups.com...
> Hello,
> The below code is intended to create a sp, then loop through a set of
> values, each time running the sp with the new value. The CREATE PROC
> executes fine, but I get an error when attempting the loop: "Invalid
> column name 'tblIR_LB_2'."
> Your help appreciated!
>
> CREATE PROC sp_CreateIRTables ( @.tbl smallint)
> AS
> DECLARE @.SQL varchar(999)
> SET @.SQL = 'CREATE TABLE [dbo].[tblIR_LB_' + @.tblname + '] (
> [dteDate] [smalldatetime] NULL ,
> [sglSTDEV(upper)] [float] NULL ,
> [sglSTDEV(lower)] [float] NULL ,
> [intMA] [smallint] NULL ,
> [dblPL] [float] NULL ,
> [dblSTDEV] [float] NULL ,
> [dblIR] [float] NULL ,
> [intTotalDays] [int] NULL ,
> [intExposure] [int] NULL ) ON [PRIMARY]'
> EXEC (@.SQL)
>
> DECLARE @.i smallint
> SET @.i = 1
> WHILE (@.i <= 32)
> BEGIN
> EXECUTE sp_CreateIRTables @.i
> SET @.i = @.i + 1
> END
>