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

Thursday, March 29, 2012

Filter Data within a graph

I have a dilemma where I have a dataset that is composed of three columns:

Key, TimeStamp, Value

My chart needs to show different lines based on what the Key in the dataset is through a certain timeframe. Take for example my dataset has 4 keys. On the first key, I need to show the average of the values. On the second key, I need to show the max values. My third key, I need to show the min values. My 4th key I need to show the Median.

I need to be able to put 4 different entries in the Values list of my chart and have them filtered based on the criteria based on the same column within the dataset. I guess my question is: Can I put an IIF statement inside of the Value entry to get my desired result and if so, what would the syntax be?

Yes, you have to put 4 entries into the values list. For example:

1. =iif(Fields!Key.Value = "A", Fields!Value.Value, Nothing)
2. =iif(Fields!Key.Value = "B", Fields!Value.Value, Nothing)
3. =iif(Fields!Key.Value = "C", Fields!Value.Value, Nothing)
4. =iif(Fields!Key.Value = "D", Fields!Value.Value, Nothing)

Note: in a line chart, the chart control will only connect data points that have a value different than null (Nothing).

-- Robert

Filter Data using parameters (in vb.net)

I am trying to use reporting services with vb.net. Since there is no EASY way
to pass dataset to the reporting services (i understand until Vs.net2005). As
an alternative below is what I am thinking of.
I am using vb.net and trying to dynamically generate the SQL to control the
filter. In the initial report definition I have the base SQL get a large set
of data and filter the data within the report format.
How do i pass filter the report data by using parameters. Has anybody got
any sample code?
I have checked the available paramters and what they are supposed to be used
for. They are:
rs prefix (which uses the Command, Format, Snapshot paramters)
rc prefix - i.e type of format
Not sure how I can use the existing parameters so that I am able to filter.
Please help,
Rgs,
MehulI just had a similar issue, I was returning a large set of data for a graph,
and wanted to use the same data to show only a single row, so I put a table
and filtered the data based on the parameter passed into the report.
1.) add the table
2.) set upt he rows and headers to show
3.) click on table and select properties
4.) click filters
5.) in left column, select the field name that you want to filter on
6.) in second column choose relationship
7.) in third columns, select expression, then choose parameters from the
tree and select the actual parameter to filter based on
8.) the filter looks something like Fields!filedName.Value =Parameters!parameterName.Value
you may have to explicitly cast these both to ints
CINT(Fields!filedName.Value) = CINT(Parameters!parameterName.Value)
And at this point, you have your form element showing only data that matches
the parameter that was passed to the report.
Hope this helps
"melu" <melu@.discussions.microsoft.com> wrote in message
news:5C51CC73-3424-47E1-95E7-9E9EE73684A3@.microsoft.com...
> I am trying to use reporting services with vb.net. Since there is no EASY
way
> to pass dataset to the reporting services (i understand until Vs.net2005).
As
> an alternative below is what I am thinking of.
>
> I am using vb.net and trying to dynamically generate the SQL to control
the
> filter. In the initial report definition I have the base SQL get a large
set
> of data and filter the data within the report format.
>
> How do i pass filter the report data by using parameters. Has anybody got
> any sample code?
>
> I have checked the available paramters and what they are supposed to be
used
> for. They are:
> rs prefix (which uses the Command, Format, Snapshot paramters)
> rc prefix - i.e type of format
> Not sure how I can use the existing parameters so that I am able to
filter.
>
> Please help,
> Rgs,
> Mehul

Filter by values from outer list region

Hello,
I am creating a report where I am using a list region to create report pages
with a few tables and graphs on each page. The dataset for the list region
contains categories of the values i want do display in the tables and
charts. The tables and charts have their own datasets, which all should be
filtered based on the category from the list region. Which changes from page
to page.
My problem is that I don't see how the inner tables and charts can be
filtered by the value of the list region?
Many thanks in advance for any help on this.
Best regards,
VemundHi Vemund Haga,
Thanks for your post.
From your descriptions, I understood that you would like to create Report
Pages dynamically. However, I am not very sure about what you want the
pages depend on, is it possible for your to generate some database sample
scripts and send a sample RDL files to me. Would you please share me more
detailed about the whole process? I would love to reproduce it on my side,
which I believe, will make us closer and quicker to the resolution.
Thank you for your patience and corperation. If you have any questions or
concerns, don't hesitate to let me know. We are here to be of assistance!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Introduction to Yukon! - http://www.microsoft.com/sql/yukon
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!|||Hi Vemund Haga,
I haven't heard back from you yet and I'm just writing in to see if you
have had an opportunity to collect the information. If you could get back
to me at your earliest convenience, we will be able to go ahead. If there
was some part of my post that you didn't understand, please feel free to
post here. I look forward to hearing from you.
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!

Tuesday, March 27, 2012

Filter by "all" or actual value issue

I have a string parameter bound to a dataset that contains a "UNION Select
'(All)' " statement to provide the user a way to return all values instead of
just a single value.
I have other integer parameters that use this exact syntax for filtering
(ALL) and they work fine. The syntax looks like this and it doesn't work and
I have no idea why:
Expression: =Iif( Parameters!PropCode.Label = "All", True,
Fields!PropertyCode.Value = Parameters!PropCode.Label)
Operation: = Value: =True
Maybe it has to do with the "(" character? Maybe it has to do with it being
a string? Please advise how I might get past this issue.Did you try:
Iif( Parameters!PropCode.Label = "(All)", True,
Fields!PropertyCode.Value = Parameters!PropCode.Label)
'|||Yes. That was a typo. That is actually what the filter looks like. This
doesn't work.
"Jihong.Liu" wrote:
> Did you try:
> Iif( Parameters!PropCode.Label = "(All)", True,
> Fields!PropertyCode.Value = Parameters!PropCode.Label)
> '
>sql

Filter a Dataset with the Range (inc.) operator

It seems that when I use the Range(inc.) as the filter operator for a Dataset and then try to use the Last and First keywords to extract the results from the dataset in the layout the results are sometimes wrong and don't match the expected.

Does anyone knows of any issues that would affect this filtering mechanism?

That is because your results are not sorted by appropriate fields. If you want to use First(field1) and you have filtered on range of field1, then you must sort by that field to get correct values for first and last values.

Shyam

|||Thanks for you answer, although it was not exactly what I needed but
nevertheless I was able to resolve this problem.
The solution lies in not choosing setting as a field the one you want to filter over,
with the range operator.
I don't know if that makes any sense but it worked for me.sql

Filling a dataset created from stored procedure

How Do I fill as dateset that i created from a stored procedure in SQL SERVER?
I dragged an stored procedure onto the dataset template from the server explorer.
Do I use the exact same sql statement as in the stored procedure, or can I say something like "SELECT * FROM myStoredProcedure", but that is not working?

Thanks in advanceIf the stored procedure outputs a result set (or more than one), you can set the CommandText of your SqlCommand object to the name of the stored procedure and set the CommandType of your SqlCommand object to CommandType.StoredProcedure.

If your stored procedure does not output a result set, you need to issue the same select statement you have in the stored procedure, but without the variable or temporary table that is accepting the results.

If your stored procedure is returning a table variable, you need to put "select * from @.tablevariablename" at the end of the stored procedure, I think, because I don't think the ASP.NET API will accept a table variable as a stored procedure return value. I could be wrong about that, though.

Friday, March 23, 2012

Fill DataSet takes forever, query db 7 sec

Hi,

I got a weird problem. I've created a sp that takes in the query analyzer 7 seconds to run. When i put in my code dataAdapter.Fill(dataSet.Tables(0)) it takes forever to finish!!

What's going on?

Any thoughts highly appreciated.

t.i.a.,
ratjetoes.

What is the query..?|||

Hi ratjetoes,

To troubleshoot this problem, we can do the following:

1. Use Profiler to track every activity of the query, including opening the connection. Check in the trace log to see if it is the query that takes 7 sec.
2. If it is the query that takes long time running, please put it in Query Analyzer to see which part is blocking to whole query.

HTH. If anything is unclear, please feel free to mark the post as Unanswered and post your reply. Thanks.

Fill a dataset in Visual Studio 2005

this may seem like a real newbie question, but I got no clue how to solve this problem. When I was working in Visual Studio 2003, whatever I wanted to fill a dataset with data, I was using a SqlDataAdapter that I created like this

adapTest.Fill(dsTest);

But now, I cant seem to find the sqldataadapter anywhere, I can just create (on the visual interface of one of my page of my aspx project) dataset, but cant find anywhere a adapter to put an SQL instruction into...maybe theres a new way to do this in Visual Studio 2005 that I dont know about. Im not sure if I was clear enough, but what I want in the end is to be able to use my dataset like that

dsTest.Tables.Rows[0]["a column"].ToString()

by filling the dataset with data like I was able to do in VS2003. Thanks for taking the time to read this.

Hey,

The preferred way now is the DataSource controls, which are great. You could use this by calling the Select method: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.select.aspx

Maybe not as graceful; I think you can cast the returned object as a DataView, which could be useful. You may want to use those objects in code-behind.

|||I read about those DataSource controls. It seems all good and all, problem is, it seems I can only use them (at least that's the only way I found), with Data-Bound Controls. But I need to use the data literally in my code behind (like in a "if" or "for" instruction), without having to Bind it to a controls. Like you said, it may be possible to returns a dataview object (from what I can read on the link you gave me, its an object that will be always called Table), but can't seem to find how...Did I miss something? Is there a way to have access to the Data in a DataSource object without having to bind it on a control? Thanks again for taking the time to read this.|||

Hey,

Sure, when you call select, it returns an IEnumerable object, which you can then convert to DataView, if it is indeed a dataview. From that, you can use you if/for logic. I believe it is, but I don't do that alot. You can also code the results in your page, using the SqlConnection and SqlDataAdapter, or Enterprise Library.

sql