Showing posts with label parameters. Show all posts
Showing posts with label parameters. Show all posts

Thursday, March 29, 2012

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

Monday, March 26, 2012

Fill label of chart X axis

Hi!

I have a report that diplay the sales per month from 2 date (start date, end date) passed in parameters. For exemple if the dates are 2006-01-01 to 2006-12-31 i want to diplay the sales for all the month between 2006-01-01 and 2006-12-31. Right now my graph display only month where sales exist. What i mean is that for this range of date my chart display only March april and may month because there are no sales for the other month. My problem is that i would like to display all month in the label on the X axix even if the month have no sales. So for this exemple i would like to diplay all month from January to december but i would have column only for the march april and may month.
From what i understand i have to use the "category group" to generate the label of my X axis but i don't know how to generate all the month from 2 date. I have to do another report that display sales per days. So i would have to generate all the day between 2 dates. How can i do such a thing ?

Thanks and sorry about my bad English ^_^

The x-axis has two modes:
* category mode (this is what you seem to be using)
* scalar mode (if "numeric / timescale data" is checked on the x-axis tab)

In the scalar mode, if you use actual DateTime objects for the category grouping, the x-axis will be drawn as a real datetime axis. So if you have sales in January and in December, it will show all the months in between in the scalar mode.

-- Robert

Fill in page

Hello,

My current reports are too large for printing but good for viewing. Can I set some parameters to fill reports in single page by width?

Thanks

Are you asking if you can have a report dynamically shrink so it always fits on a single page? If so, the answer is no.

You can set the page height or width in the Report Properties dialog box.

Friday, March 9, 2012

File transfer

I have to make a process/stored procedure that will either send or receive from a specific location (parameters: ftp server, username, password, filename, etc). Ne direction/help in order to do this. Or if anyone has done this before please help.
thxCould you supply some more specifics?|||The specifies are:

I have to make a sp that will send/receive files to/from an ip address or ftp site.
The sp will query the information such as (filename, send_time, receive/send, servername, usernid, password, size_of_file, etc).
Once this info is queried, the script should transfer the file to respective location using, either exec xp_cmdshell or ne other way.

Since it's critical that the file being sent/received, must succesfully be sent/received. The script must also handle that.

This script will be running on SQL server. Any sample code?
thx|||I guess you're going to use ftp...

OK...build an ftp script...and execute it from a bat file with xp_cmdshell...don't forget to redirect the output...maybe load it to a log table...

I guess you'll interogate a directory..

Use xp_cmdshell 'DIR D;\whatever\*.*

and load that to a table to interogate that...

something like that?