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

Thursday, March 8, 2012

check box in parameters

How do I display check boxes in parameters.. I want the user to be able to
select multiple options that can be passed into the Query.. please help.
For example,
Select * from branch where branchregion in ('NORTHEAST','SOUTHWEST','
SOUTHEAST')..
RKSql Server 2000 Reporting Services does not directly support this
functionality. It is on our wish list for inclusion in a future release.
However there is an solution to this post on the GotDotNet.com web site:
http://www.gotdotnet.com/Community/Resources/Default.aspx?AFXPath=/Resource%5b@.ResourceId='2E882C0A-8D2B-4EAD-81BE-8E66C0941A18'%5d
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"RK Balaji" <rk.balaji@.gmail.com> wrote in message
news:ux5BwXHhEHA.4092@.TK2MSFTNGP10.phx.gbl...
> How do I display check boxes in parameters.. I want the user to be able to
> select multiple options that can be passed into the Query.. please help.
> For example,
> Select * from branch where branchregion in ('NORTHEAST','SOUTHWEST','
> SOUTHEAST')..
> RK
>
>
>

Wednesday, March 7, 2012

Charts in subreports

Hello,
I´ve created a subreport to add it to my main report. When I open the main
report, the subreport is correct with all the parameters I´ve passed from
main to subreport.
The problem comes when I add a chart in the subreport. It shows an error
message like "Error: Subreport could not be shown" (or something like that).
Is it possible to add charts in subreports? Do I need special configuration
in the chart to be shown?
Thanks,
MónicaOn Aug 21, 6:28 am, "M=F3nica" <monica.d...@.augure.com> wrote:
> Hello,
> I=B4ve created a subreport to add it to my main report. When I open the m=ain
> report, the subreport is correct with all the parameters I=B4ve passed fr=om
> main to subreport.
> The problem comes when I add a chart in the subreport. It shows an error
> message like "Error: Subreport could not be shown" (or something like tha=t).
> Is it possible to add charts in subreports? Do I need special configurati=on
> in the chart to be shown?
> Thanks,
> M=F3nica
That shouldn't be a problem. It sounds like you are not correctly
providing the required parameter values/etc to the chart in the
subreport. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Make sure that in your subreport you define the same parameters and name
them the same thing as your parent report.
"Mónica" <monica.diaz@.augure.com> wrote in message
news:eyuybZ%234HHA.5360@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I´ve created a subreport to add it to my main report. When I open the main
> report, the subreport is correct with all the parameters I´ve passed from
> main to subreport.
> The problem comes when I add a chart in the subreport. It shows an error
> message like "Error: Subreport could not be shown" (or something like
> that).
> Is it possible to add charts in subreports? Do I need special
> configuration in the chart to be shown?
> Thanks,
> Mónica
>

Saturday, February 25, 2012

Charts don't update when using dropdown parameters

I have recently upgraded from RS2000 to RS2005. The reports seem to have
converted without any errors. In the report designer, everything works fine.
When deploying to the server the reports don't update properly.
Details:
The reports have two components (a table and a chart) - both are based on
the same query. There are three parameters in a report. One is a dropdown
box that includes a list of products based on a subquery. The other two
parameters are textboxes that provide start and end months for the reporting
period. When changing either of the month parameters, the table and chart
updates with proper data. When changing the product (dropdown box), the
table information updates, but the chart does not (it still includes the
title and data from the previous update when a month was changed; or it
includes the results of the first query if a month was not changed).
Has anyone experienced anything like this? Is there a fix?Hello Piell,
I tested on my side and do not reproduce this issue.
Also, I did not find any related issue in our internal database.
I would like to know if this issue appeared on all reports?
If you apply SP1 on your SSRS 2005, does this issue persist?
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Wei,
We have the same problem on all reports and we have even deleted the chart
and re-created it and get the same results. I will be checking with the
admins later today to find out if SP1 has been applied. If it hasn't, we
will have them update it.
Thanks.|||Wei,
We have installed SQL 2005 SP1 and still have the same problem. Would the
available hot fix help
http://download.microsoft.com/download/6/e/8/6e85f7ab-9f6c-4f3c-8f89-da0f78e026dc/rs2005-kb918222-x86-enu.exe|||We installed hot fix and charts still don't update when dropdown parameter
changes.|||Hello piell,
I would like to suggest you to check your IE security setting and try to
set the security level to low.
If this issue still persist, would you please send a sample report to me so
that I could try to reproduce this issue on my side.
To reach me, please remove the ONLINE in my email address.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
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.|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
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.

Tuesday, February 14, 2012

Character is not valid error

Here's my code:
Dim Cmd as New SQLCommand(sqlString, conn)
cmd.CommandType=CommandType.StoredProcedure
Breaks Here -->>cmd.parameters.add(New SQLParameter(@.OrdAlias, OrdNum))
cmd.parameters.add(New SQLParameter(@.AliasSourceCode, 4))
The error says:
compilation error - -
then, on the line that is in red:
Compiler Error Message:BC30037: Character is not valid.
I have 'OrdNum' declared globally, and OrdNum is assigned right away in the Page_Load event. I've checked the spelling of the SQL parameters (OrdAlias is a varchar, and AliasSourceCode is a tinyInt)
After all this - then, this code runs
Any ideas why I'm getting this error??

Try surrounding your'@.OrdAlias' and the other one, with double quotes

Friday, February 10, 2012

changinh DB of stored procedure

I have a stored procedure that as one of parameters receiving the database.
I need to change the database that SQL statement in store procedure working
on according to parameter.
I cant find any solution except fill naming and rewiring whole statement
depend on parameter or building SQL statement as string and then running it
in store procedure.
I know what there are USE { database } statement in TSQL , but it's doesn't
work in stored procedure.
Please, help if you have any solution of this problem.
Thank you, David Potahinsky.David,
You can't use a parameter after USE, but you can do something like
this, I believe, if you know the names of all the databases that might
be chosen:
if @.db = 'somedatabase'
use somedatabase
else if @.db = 'differentdatabase'
use differentdatabase
else if ...
If you wish, you can also return silently or throw an error if the value
passed for @.db is not one you've taken care of.
SK
David Potahisnsky wrote:
quote:

>I have a stored procedure that as one of parameters receiving the database.
>I need to change the database that SQL statement in store procedure working
>on according to parameter.
>I cant find any solution except fill naming and rewiring whole statement
>depend on parameter or building SQL statement as string and then running it
>in store procedure.
>
>I know what there are USE { database } statement in TSQL , but it's doesn't
>work in stored procedure.
>
>Please, help if you have any solution of this problem.
>
>Thank you, David Potahinsky.
>
>
>
|||David Potahisnsky (david.potashinsky@.kabbalah.com) writes:
quote:

> I have a stored procedure that as one of parameters receiving the
> database. I need to change the database that SQL statement in store
> procedure working on according to parameter.
> I cant find any solution except fill naming and rewiring whole statement
> depend on parameter or building SQL statement as string and then running
> it in store procedure.

Put the stored procedure with the main logic in all databases. In the
master you can say:
DECLARE @.logic_sp sysname
SELECT @.logic_sp = @.db + '.dbo.your_sp'
EXEC @.err = @.logic_sp @.par1, @.par2, ...
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Is there a way to avoid creation of same stored procedures for each database
as it makes maintenance a hell, but to have for ex. REPORTS database with
all stored procedures that can access tables in other DBs on demand by
parameter?
Something that is logically equivalent to:
CREATE PROCEDURE REPORT_TEST1 (@.DB VARCHAR(100)) AS
BEGIN
USE @.DB
SELECT * FROM TABLE1
-- should get records from @.db.dbo.table1
...
END
But the problem is that T-SQL doesn't allow USE in PROCEDURE.
I'm aware that use of dynamic queries in style EXEC ('SELECT * FROM
'+@.DB+'.dbo.table1') is possible but barely acceptable again because of
maintenance pains.
Any other alternative solutions?
"Erland Sommarskog" <sommar@.algonet.se> wrote in message
news:Xns945BF1298BDD1Yazorman@.127.0.0.1...
quote:

> David Potahisnsky (david.potashinsky@.kabbalah.com) writes:
> Put the stored procedure with the main logic in all databases. In the
> master you can say:
> DECLARE @.logic_sp sysname
> SELECT @.logic_sp = @.db + '.dbo.your_sp'
> EXEC @.err = @.logic_sp @.par1, @.par2, ...
> --
> Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp
|||Myrth (m0sh3_NO@.SPAM_hotmail.com) writes:
quote:

> Is there a way to avoid creation of same stored procedures for each
> database as it makes maintenance a hell, but to have for ex. REPORTS
> database with all stored procedures that can access tables in other DBs
> on demand by parameter?

Actually there is: this is the way the system stored procedure works.
However, while you can add your own system stored procedures, this is
deprecated and unsupported, and also has security issues.
And anyway the scheme breaks down the day the databases are spread over
more than one server. In this case, you have no choice than to deploy
your procedure on at least every server.
So the real answer to your problem is to devise a distribution
mechanism, so that you easily can distribute updates to your code to
your databases, no matter they are all on the same server, or spread
out on several customer sites. Obviously for this you need a master
to deliver from, but this master database is not an SQL database -
it's a version control system (which may use SQL Server as its storage
engine, but that's another story).
Such a distribution can be assembled in different ways. The heart of the
procedure is always that in your version-control system you set a
baseline. The terminology changes between version-control systems,
but often you talk about "labels". Then you assemble the changes between
two labels. This can be performed by manually building a BAT-fil which
uses OSQL to install the stored procedures, or it can be more elaborate.
There are several third-party tools on the market. Popular is SQL Compare
from Red Gate, www.red-gate.com, although it works from a different
perspective than I've outlined here. Myself, I have made the tool we
use in our shop available as freeware, see http://www.abaris.se/abaperls/.
Thus, what you have is a configuration-management problem, not one of
writing stored procedures. It may seem inflexible that stored procedures
are tied to one certain database, but there are some good reasons for
this. The most important is that although the logic in the stored
procedure may be the same in two databases, the query plan that SQL Server
should use to retrieve the data may not, because the data is different
in the two databases.
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||we use views successfully here. write your stored procedures to access views
instead of base tables. upon deployment you can literally generate the cross
database views from a table in your main db (table with metadata). an sp can
produce multiple of these:
IF OBJECT_ID('v_<foreign_db>_<base_table_name>') IS NOT NULL DROP VIEW
v_<foreign_db>_<base_table_name>
GO
CREATE VIEW v_<foreign_db>_<base_table_name>
AS
SELECT *
FROM <foreign_db>.dbo.<base_table_name>
GO
where <foreign_db> is a logical name of a db in your system e.g. "rep" for
reporting (not the actual deployment specific sql db name) and can be passed
as a paramter to the sp or even better -- can be persisted in a setup table.
of course using * for column_list is not "production" enough so you might
want to store view's column lists in you "metadata cross-db view definition"
table as well.
we use multiple prefixes for views names like this:
v_<host_db>_<foreign_db>_<foreign_view_name> to allow different column list
for each <host_db> that is each sub-system of the solution. so we end up
with several views pointing to a single base table (but from different
sub-systems).
cheers,
</wqw>
"Myrth" <m0sh3_NO@.SPAM_hotmail.com> wrote in message
news:epkBLBnyDHA.2032@.TK2MSFTNGP10.phx.gbl...
quote:

> Is there a way to avoid creation of same stored procedures for each

database
quote:

> as it makes maintenance a hell, but to have for ex. REPORTS database with
> all stored procedures that can access tables in other DBs on demand by
> parameter?
> Something that is logically equivalent to:
> CREATE PROCEDURE REPORT_TEST1 (@.DB VARCHAR(100)) AS
> BEGIN
> USE @.DB
> SELECT * FROM TABLE1
> -- should get records from @.db.dbo.table1
> ...
> END
> But the problem is that T-SQL doesn't allow USE in PROCEDURE.
> I'm aware that use of dynamic queries in style EXEC ('SELECT * FROM
> '+@.DB+'.dbo.table1') is possible but barely acceptable again because of
> maintenance pains.
> Any other alternative solutions?
>
> "Erland Sommarskog" <sommar@.algonet.se> wrote in message
> news:Xns945BF1298BDD1Yazorman@.127.0.0.1...
statement[QUOTE]
running[QUOTE]
>