Showing posts with label dataset. Show all posts
Showing posts with label dataset. Show all posts

Sunday, March 25, 2012

Changing the DataType of a Coluumn in an In-Memory Dataset

Here is the issue. I have ReadOnly Access to a database. All of the Columns are set to NVARCHAR(1000) by default. I cannot change them. I want to load the DataSet into memory and change the DataType of the columns from NVARCHAR(1000) to INT(4). The data is in integer (i.e. 4,5,123) format (but stored as a string), but is coming across as strings. The charting software I am using won't implicitly convert these Strings to Int or Double. How can I change an entire column to Int?

You need ANSI SQL ALTER COLUMN, I am not sure if you can do that for read only. Try the url below for your options. Hope this helps.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_aa-az_3ied.asp

Kind regards,

Gift Peddie

|||Or, you could cast in in the SELECT statement. Like so: SELECT someColumn, otherColumn, CAST(thisColumn AS INT) AS thisColumnFROM yourTable...
But really, if you have an NVARCHAR(1000) column that's nothing butintegers, you really *should* change the underlying column in the tableto be the proper type.
|||I know, but this DB is the result of a portal tool, which I have no control over. I will try Casting the column to int on the select statement. Thanks.Big Smile [:D]

Thursday, March 22, 2012

Changing the dataset of a table dynamically

Hi all,

Is there a way to change the dataset being used by a table dynamically ?

Regards,
Neil
Just noticed, a similar post that has just been answer. .. It doesnt seem the same however as I am using a cube and strictly have two distinct datasets.. which I need to call either one..

any help is appreciated..

Neil
|||This is really NB ... please can someone help... I need to set my matrix to read from a different data set depending on a selection made by the user ...

I can not use expressions in the dataset name of the matrix properties... These datasets are similar as in they contain the same number of fields but 1 field contains different info.. these datatsets come from a cube,,

please.. NB...

Regards,
Neil

Tuesday, March 20, 2012

Changing SSRS reports datasource.

I have a web site that has reports stored in two places.The local site, and in SSRS.The local reports get there data from a class that has a dataset method on it.I would like to store all my reports in SSRS.Is this possible?Can I get just the RDL of a report from the SSRS web service, or change the dataset to what my class generates?

You can adopt one to two approaches:

1) store the RDLC you'll use in a report viewer control on the report server as a resouce.

2) store actual RDL in the report server and use the GetReportDefinition method to obtain the RDL.

What is interesting here is that the data source definitions between the RDLC the control expect and the RDL that the server expects is a little different.

Here's the reference for GetReportDefinition:

http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005.getreportdefinition.aspx

-Lukasz

Sunday, March 11, 2012

Changing SelectMethod in SQLDataSource

I have a gridview bound to an ObjectDataSource, which is a dataset populated by SQL queries. The gridview works with the default SelectMethod configured in the ObjectDataSource. I would like to be able to change the SelectMethod based on user input, which would call a different query. I have one textbox for input and several buttons to pick the type of filter.

My gridview populates on with the default selectmethod if I create a button that does nothing but a postback. My other buttons run the following codes which returns nothing. Any ideas what I'm doing wrong?

If

e.CommandArgument ="Last_Name"Then

EmployeeData.SelectMethod =

"GetDataByLastName"EndIfIf e.CommandArgument ="First_Name"Then

EmployeeData.SelectMethod =

"GetDataByFirstName"EndIf

gvPhoto.DataSourceID = EmployeeData.ID

gvPhoto.DataBind()

Thanks.

Lisa

Call EmployeeData.Databind() before the dvPhoto.DataBind()

Hope this help

Changing Scale Minimum value on a Graph

How can we change in code the Scale Minimum value via code, depending
on the data in a dataset?
What I would like to beable to do is find the min. value in the dataset
and then set Scale Minimum valueBryan,
I had contacted Dundas support via email on this subject on 3/29 and they
said that it was not possible via the RS version and noted they don't provide
support for RS and directed me to Microsoft's forum websites.
"Bryan Avery" wrote:
> How can we change in code the Scale Minimum value via code, depending
> on the data in a dataset?
> What I would like to beable to do is find the min. value in the dataset
> and then set Scale Minimum value
>|||RS 2000: If you leave the Min value empty, the chart control will
"auto-scale" the minimum based on the actual data values.
RS 2005: you will be able to specify an expression for the min/max values.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"yrmeyer" <yrmeyer@.discussions.microsoft.com> wrote in message
news:6DDA957A-3D62-4CC9-87F9-7374DF9AA1C1@.microsoft.com...
> Bryan,
> I had contacted Dundas support via email on this subject on 3/29 and they
> said that it was not possible via the RS version and noted they don't
> provide
> support for RS and directed me to Microsoft's forum websites.
> "Bryan Avery" wrote:
>> How can we change in code the Scale Minimum value via code, depending
>> on the data in a dataset?
>> What I would like to beable to do is find the min. value in the dataset
>> and then set Scale Minimum value
>>

Friday, February 24, 2012

Changing label of y-axis

For my report i have to change the label of the y-axis. My dataset is
returning integer values "0", "1", "2". These values are now shown as the
label. However, i need to translate these ID's to string values, such as "0"
= "no value available", "1" = "service down", "2" = "service up".
I have tied to insert a code snippet for conditinal names in the Label
Format Code field
=IIF(Fields!Parameter.Value=0, "no values available", Fields!Parameter.Value)
but this does not solve the problem, because it seems i can only use
formatting code in the label field.
Is there a way to do this or do i have to label my y-axis as is and insert a
legend to let the reader of the report know, what that values are meaning?For the series or category (I forget which one is the y-axis), specify the
following instead of just "Fields!myvalue.value"
=IIF(Fields!myValue.value = 0, "No value available",
IIF(Fields!myValue.Value = 1, "Service Down", "Service Up"))
Replace "myvalue" with the actual name of your column.
"Ben" <yogiben_at_gmx_dot_net> wrote in message
news:2B86E61F-186C-4A74-AE0B-EAF85F1DF9C7@.microsoft.com...
> For my report i have to change the label of the y-axis. My dataset is
> returning integer values "0", "1", "2". These values are now shown as the
> label. However, i need to translate these ID's to string values, such as
> "0"
> = "no value available", "1" = "service down", "2" = "service up".
> I have tied to insert a code snippet for conditinal names in the Label
> Format Code field
> =IIF(Fields!Parameter.Value=0, "no values available",
> Fields!Parameter.Value)
> but this does not solve the problem, because it seems i can only use
> formatting code in the label field.
> Is there a way to do this or do i have to label my y-axis as is and insert
> a
> legend to let the reader of the report know, what that values are meaning?

Thursday, February 16, 2012

Changing field type

I'm using my own data processing extension to provide a dataset to a report -
the dataset is beging generatied by VB code and passed in form of XML to the
report as a parameter. Everything works fine except from that type of all
fields is String (although they are passed as doubles in the code), so I'm
not able to show graphs on the report. I've tried to solve the problem by
adding following line:
<rd:TypeName>System.Double</rd:TypeName>
to each datafield in the RDL-file. But it didn't help.
Is it something else I could try to solve this problem?Right-click on the fields list and click "add...". Give it a name and
specify a calculated field of:
=cint(Fields!fieldname.Value)
Mike G.
"Anna" <Anna@.discussions.microsoft.com> wrote in message
news:75B8EF07-1159-4824-93F2-FDF74863DF20@.microsoft.com...
> I'm using my own data processing extension to provide a dataset to a
> report -
> the dataset is beging generatied by VB code and passed in form of XML to
> the
> report as a parameter. Everything works fine except from that type of all
> fields is String (although they are passed as doubles in the code), so I'm
> not able to show graphs on the report. I've tried to solve the problem by
> adding following line:
> <rd:TypeName>System.Double</rd:TypeName>
> to each datafield in the RDL-file. But it didn't help.
> Is it something else I could try to solve this problem?|||Anna,
Maybe it would work if you create a fuction in the Custom Code section,
which casts the strings to double's
Something like
Function ConvertToDouble(sValue as String)
return Double.Parse(sValue)
end Function
And as your chart data value you sould add
'=Code.ConvertToDouble(Fields!stringValue)' to use the convert values as your
chart input.
Jan Pieter Posthuma
"Anna" wrote:
> I'm using my own data processing extension to provide a dataset to a report -
> the dataset is beging generatied by VB code and passed in form of XML to the
> report as a parameter. Everything works fine except from that type of all
> fields is String (although they are passed as doubles in the code), so I'm
> not able to show graphs on the report. I've tried to solve the problem by
> adding following line:
> <rd:TypeName>System.Double</rd:TypeName>
> to each datafield in the RDL-file. But it didn't help.
> Is it something else I could try to solve this problem?|||Sorry, didn't notice the "double" until I read Jan's post. Of course, that
means using cdbl instead of cint. (or using Jan's suggestion and creating a
function)
Mike G.
"Mike G." <theNOSPAMjunkbox@.comcast.net> wrote in message
news:e6Mh5j0TFHA.584@.TK2MSFTNGP15.phx.gbl...
> Right-click on the fields list and click "add...". Give it a name and
> specify a calculated field of:
> =cint(Fields!fieldname.Value)
> Mike G.
>
> "Anna" <Anna@.discussions.microsoft.com> wrote in message
> news:75B8EF07-1159-4824-93F2-FDF74863DF20@.microsoft.com...
>> I'm using my own data processing extension to provide a dataset to a
>> report -
>> the dataset is beging generatied by VB code and passed in form of XML to
>> the
>> report as a parameter. Everything works fine except from that type of all
>> fields is String (although they are passed as doubles in the code), so
>> I'm
>> not able to show graphs on the report. I've tried to solve the problem by
>> adding following line:
>> <rd:TypeName>System.Double</rd:TypeName>
>> to each datafield in the RDL-file. But it didn't help.
>> Is it something else I could try to solve this problem?
>

Friday, February 10, 2012

Changing Data Sources

If I have a dataset that uses a certain data source, if I
change the data source do I have to redefine my dataset
and replace the fields from the dataset in my designer...?
DanNope . I never had to do that
"alien251" wrote:
> If I have a dataset that uses a certain data source, if I
> change the data source do I have to redefine my dataset
> and replace the fields from the dataset in my designer...?
> Dan
>