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

Sunday, March 25, 2012

Accessing DataTable(s) in Dataset

In .NET when I call a stored proc that returns two sets of data, each
set is put into a datatable within the dataset. I have an SRS report
that is calling a stored proc that does the same thing. However, SRS
doesn't show me that second data table so I can get access to it's
columns. Is there a way to see multiple data tables from within a
Dataset in SRS?On Jun 5, 1:49 pm, Doogie <dnlwh...@.dtgnet.com> wrote:
> In .NET when I call a stored proc that returns two sets of data, each
> set is put into a datatable within the dataset. I have an SRS report
> that is calling a stored proc that does the same thing. However, SRS
> doesn't show me that second data table so I can get access to it's
> columns. Is there a way to see multiple data tables from within a
> Dataset in SRS?
As far as I know, there is not; however, you can create multiple
datasets: one dataset per resultset. Sorry that I could not be of
greater assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

accessing datasets / Field collections through custom code

Hi,

My report has multiple datasets, and I want to access the fields of a particular dataset from custom code. The problem is that the name of the dataset to use is only calculated during the execution of the custom code.

Allow me to illustrate:

public function Test(data as DataSets, fieldName as string)

dim datasetName as string = CalculateDatasetName()
dim ds as Dataset = data(datasetName)

' now here I want to get the fieldName out of the dataset.
' in the report, I would do something like
' First(Fields!fieldName.Value, datasetName)
' but in custom code, this obviously doesn't work.

end function

I've been looking for a way to accomplish this, but it seems you cannot get data from a dataset through custom code (there is only the commandtext property). Also it is not possible to pass the Fields collection as a parameter, as I do not know the dataset name when in the report designer.

I hope my problem description is clear.
Does anyone know how to solve this issue?

Thanks,
Phil

Hi Phil,

Look at the code below

public DataSet Dataset_name = new DataSet();

public DataTable DataTable_name = new DataTable();

public DataColumn DataColumn_name = new DataColumn();

public DataView View_name = new DataView();

public datatype function(name_of _variable_which catch_the column_value datatype)

{

DataColumn_name = new DataColumn("name_of _variable_which catch_the column_value", System.Type.GetType("System.String"))

}

Hope this helps

Priyank

Accessing dataset with custom code

Hi,

Need a little help on the code here. How can I import values from an RSS dataset? I will store them in a hash table and then call the function to check for dups. An example or pointer or article reference would be appreciated.

Thanks.

Since RSS is xml, you can use the XML data processing extension that comes with SQL Server 2005. This link has documentation on this feature:

http://msdn2.microsoft.com/en-us/library/ms159741.aspx

Basically, you create a data source in report designer with type xml and specify the connection string to be the url of RSS feed. The query language it uses is similar to XPath. The doc for the query language is here:

http://msdn2.microsoft.com/en-US/library/ms365158.aspx

|||Here is an example of using the Xml Data Processing extension using this forum's RSS feed as the source.

Connection String:
http://forums.microsoft.com/MSDN/rss.aspx?ForumID=82&Mode=0&SiteID=1

Query:
<Query>
<ElementPath IgnoreNamespaces="True">rss{}/channel{title,link, description}/item{title, date, link, description, comments}</ElementPath>
</Query>

Ian|||

Thanks for all the help. This stuff is pretty much new to me. I'm mostly familiar with VBA, Classic VB, and T-SQL but we'll see where this leads.

Accessing Dataset values

I have 2 datasets. One is used to give the values to a parameter and the
second one is used to populated the main table in my report.
The first one has a code and a Name like:
Code Name
c cat
d dog
I would like to display â'catâ' in the main table, but I just have the code
â'câ'. Is there a way to do it ?Soan,
I'm not sure I fully understand your scenario.
If you're after the 'label' from the chosen parameter, you can get it
using;
=Parameters!paramname.Label
Chris
Soan wrote:
> I have 2 datasets. One is used to give the values to a parameter and
> the second one is used to populated the main table in my report.
> The first one has a code and a Name like:
> Code Name
> c cat
> d dog
> I would like to display â'catâ' in the main table, but I just have
> the code â'câ'. Is there a way to do it ?|||I am looking for a function that returns the second value of the dataset when
i give the first one.
Something like Parameters!paramname.Label the difference is that the
parameter does not have the valued assigned (I want to access different
values in the dataset).
> I'm not sure I fully understand your scenario.
> If you're after the 'label' from the chosen parameter, you can get it
> using;
> =Parameters!paramname.Label
> Chris
>
> Soan wrote:
> > I have 2 datasets. One is used to give the values to a parameter and
> > the second one is used to populated the main table in my report.
> >
> > The first one has a code and a Name like:
> > Code Name
> > c cat
> > d dog
> >
> > I would like to display â'catâ' in the main table, but I just have
> > the code â'câ'. Is there a way to do it ?
>|||Soan, I think you just need a join in the second dataset on the table
from the 1st dataset that gives you the description. You should make
the dataset contain all the data you want to show in the data region.
eg dataset 1 gives salesperson list;
Select SalesId, FirstName from tblSalesperson
this is used in the parameter. The value is SalesId, the label is
FirstName.
the second dataset would return the orders for that salesperson, but
you want the sales persons fullname on it from the salespersons table;
Select O.OrderId, O.SalesId, S.FullName, O.Date, O.Value
From tblOrder O
Join tblSalesperson S On O.SalesId = S.SalesId
Where O.SalesId = @.parametername
You can achieve this in the Graphical query designer, but I always use
the Generic designer so can't really explain it that well.
Hope that helps.
Chris
Soan wrote:
> I am looking for a function that returns the second value of the
> dataset when i give the first one.
> Something like Parameters!paramname.Label the difference is that the
> parameter does not have the valued assigned (I want to access
> different values in the dataset).
>
> > I'm not sure I fully understand your scenario.
> > If you're after the 'label' from the chosen parameter, you can get
> > it using;
> > =Parameters!paramname.Label
> >
> > Chris
> >
> >
> > Soan wrote:
> >
> > > I have 2 datasets. One is used to give the values to a parameter
> > > and the second one is used to populated the main table in my
> > > report.
> > >
> > > The first one has a code and a Name like:
> > > Code Name
> > > c cat
> > > d dog
> > >
> > > I would like to display â'catâ' in the main table, but I just
> > > have the code â'câ'. Is there a way to do it ?
> >
> >

Tuesday, March 6, 2012

Access to dataset fields in Code window

Hi,
Is it, or will it be possible to use dataset fields in expressions in the
code window. We are converting formulas which are too complex for an IIF
expression in the report, and would prefer not to create too many sprocs in
the database.
Cheers,
MattYou cannot access fields directly in the code window. You need to pass-in
the field values as arguments to your custom code function. The following
article shows how to do this:
http://odetocode.com/Articles/130.aspx
A more detailed discussion is provided in the following MSDN article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/ERSCstCode.asp?frame=true
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Matt" <Matt@.discussions.microsoft.com> wrote in message
news:3EFF6484-97F2-4744-BB6F-6DC35F084D7B@.microsoft.com...
> Hi,
> Is it, or will it be possible to use dataset fields in expressions in the
> code window. We are converting formulas which are too complex for an IIF
> expression in the report, and would prefer not to create too many sprocs
> in
> the database.
> Cheers,
> Matt

Sunday, February 19, 2012

ACCESS PARAMETER (ssrs) urgent

HI ,
how can i access the different dataset parameter in th SSRS. i have created one dataset and define Bu as a parameter. then i created separate dataset called dataset2 and need to access that BU parameter from dataset2. i cant access it using normal way. ex strtoset(@.Bu)..... ?

dear Friend,

Inside my report, I have a field that is the sum of one field in a dataset and other field in other dataset...:

Code Snippet

=Sum(Fields!NC_FPA_OpFinanc.Value, "DataSet_FPAtribuidos")+Sum(Fields!CM_ENT_ReqFundosPropriosRC.Value, "DataSet_ActivoPonderado")

Helped you?
Regards!

|||i need to access it in my mdx query. is it possible to access like following?
SET [FilteredBUList] AS strtoset(@.BU,"Dataset2")