Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Wednesday, March 21, 2012

Postback takes a LONG time!

I have one other issue, possibly related to my last post, that I thought I
should post in a separate question.
When I specify a default value for a parameter using an expression, the form
postback process seems to get scrambled. If I enter a value in a text
parameter, then click "View Report", the form will do a postback, but NOT run
the query. If I click View Report again, the report runs fine.
This delayed postback occurs on any text field parameter, and can be
observed by entering text in a parameter field, then clicking in another
parameter field. This effect is very disconcerting.
As in my other question, I'm thinking this is a RS bug, but is there a
workaround?
Thanks in advance,
MikeThe server can not determine the dependencies between parameters when some
of them are expressions, so it is conservative and assumes that a dependency
exists. When you navigate away from the text box (to another text box or to
the view report button), the page posts back to get new defaults and valid
values for downstream parameters. If there is no dependency, you can
reorder the parameters to prevent the post back. A parmeter can only depend
on parameters that came before it. So if you make your expression based
parameter the last one, there will be no auto post back.
--
This posting is provided "AS IS" with no warranties, and confers no rights
"rdcpro" <rdcpro@.discussions.microsoft.com> wrote in message
news:691D2719-81E7-46B8-9F26-E3515DD8CDB2@.microsoft.com...
> I have one other issue, possibly related to my last post, that I thought I
> should post in a separate question.
> When I specify a default value for a parameter using an expression, the
form
> postback process seems to get scrambled. If I enter a value in a text
> parameter, then click "View Report", the form will do a postback, but NOT
run
> the query. If I click View Report again, the report runs fine.
> This delayed postback occurs on any text field parameter, and can be
> observed by entering text in a parameter field, then clicking in another
> parameter field. This effect is very disconcerting.
> As in my other question, I'm thinking this is a RS bug, but is there a
> workaround?
> Thanks in advance,
> Mike|||Thanks Brian,
This particular control is the last parameter, but there is also a select
box that is the second-to-last parameter. This one uses a default value, but
not an expression. In particular, it has a set of values that look like
Label Value
foo 0
bar 1
snafu 2
and the default value is specified as:
0
and not
=0
In this case, a postback shouldn't occur, because this is not an expression
but a scalar value, right?
And even if it were an expression, while the server doesn't know if there is
a dependancy, the Designer (me) knows. It seems to me that when I design a
report with parameters that use expressions, I should have a checkbox to
disable postback or declaratively state there is no dependancy.
Any thoughts?
Thanks again,
Mike
"Brian Hartman [MSFT]" wrote:
> The server can not determine the dependencies between parameters when some
> of them are expressions, so it is conservative and assumes that a dependency
> exists. When you navigate away from the text box (to another text box or to
> the view report button), the page posts back to get new defaults and valid
> values for downstream parameters. If there is no dependency, you can
> reorder the parameters to prevent the post back. A parmeter can only depend
> on parameters that came before it. So if you make your expression based
> parameter the last one, there will be no auto post back.
>|||In case others run into this issue, I wanted to post my resolution.
At issue is the fact that a report parameter with an expression is assumed
to be dependant on another report parameter, even when in fact it's only
dependant on a global value or even if it simply uses an expression to return
a scalar result. So, when you set a default value using an expression, the
control is "disabled" and there is no way for the user to physically set the
control without first entering a fake value in another field, then causing a
postback to "refresh" the parameter. Only then can the user set the value
for the parameter using an expression. Of course, before the user runs the
query he/she must remove the "fake" value.
In my case, a user might enter a date in my "End Date" field, then click
"View Report". Instead of actually seeing the report, the screen blanks, a
postback occurs, and it appears to the user that either nothing happened, or
the report returned no results. They have to click "View Report" again to
get the report to run.
Evidently, the behavior is "by design" inasmuch as RS isn't smart enough to
realize there is no dependancy for this parameter, and there is no way in the
report designer to declaratively state as much.
In my case, I simply wanted to set the default value of the parameter to
"true" in one folder, and "false" in another. My solution was to use the
same approach that creating a linked report would use. Upload the report
with no default value on the control, then in the Report Manager, manually
specify the default value I want (either true or false) in the Properties >
Parameters page.
It would be really nice if there was a similar option in the Report
Designer, or if you could set the default to a scalar value directly the same
way you can for a drop-down parameter!
Hope this helps someone,
Mike
"rdcpro" wrote:
> Thanks Brian,
> This particular control is the last parameter, but there is also a select
> box that is the second-to-last parameter. This one uses a default value, but
> not an expression. In particular, it has a set of values that look like
> Label Value
> foo 0
> bar 1
> snafu 2
> and the default value is specified as:
> 0
> and not
> =0
> In this case, a postback shouldn't occur, because this is not an expression
> but a scalar value, right?
> And even if it were an expression, while the server doesn't know if there is
> a dependancy, the Designer (me) knows. It seems to me that when I design a
> report with parameters that use expressions, I should have a checkbox to
> disable postback or declaratively state there is no dependancy.
> Any thoughts?
> Thanks again,
> Mike
> "Brian Hartman [MSFT]" wrote:
> > The server can not determine the dependencies between parameters when some
> > of them are expressions, so it is conservative and assumes that a dependency
> > exists. When you navigate away from the text box (to another text box or to
> > the view report button), the page posts back to get new defaults and valid
> > values for downstream parameters. If there is no dependency, you can
> > reorder the parameters to prevent the post back. A parmeter can only depend
> > on parameters that came before it. So if you make your expression based
> > parameter the last one, there will be no auto post back.
> >
>

Monday, March 12, 2012

Possible to set http://localhost/Reports default start report?

SQL 2005
Is it possible to set a default start report? I have a report which contains hyperlinks to all the other reports, I'd like to just load this one by default when a user hits: http://machine/Reports

Perhaps I'm barking up the wrong tree and need to set this in IIS? I want users to still be able to make their way back to the /Reports folder lists also.

- Thanks in advanceI would rather set a new virtual directory with pointing / redirecting to the new folder than messing with the old settings. But with that there would be not point in returning to the main folder structure, unless you put it as a hyperlink inyour report.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

Friday, March 9, 2012

Possible to make "Detail View" default in Report Mgr?

Is there a config file where this can be modified such that the views in http://SomeWebServer/Reports will be Details view by default?Still wondering about this. I reviewed the CSS one day for the site, but didn't see this in there.

Possible to make "Detail View" default in Report Mgr?

Is there a config file where this can be modified such that the views in http://SomeWebServer/Reports will be Details view by default?Still wondering about this. I reviewed the CSS one day for the site, but didn't see this in there.

Saturday, February 25, 2012

possible bug: sp_attach_single_file_db

The scenario:
The server in question has its Default Log Directory set
to "L:\". I used sp_attach_single_file_db to attach an
mdf file. Here is the command that I used:
EXEC sp_attach_single_file_db @.dbname = 'test2',
@.physname = 'f:\test2_Data.MDF'
I received the following error:
Device activation error. The physical file
name 'L:\test2_Log.LDF' may be incorrect.
New log file 'L:\\test2_log.LDF' was created.
Notice the 2 back-slashes in the path of the log file! I
didn't notice it at first, and eventually attempted to
restore the database from a backup taken from a different
server, using a 'with move'. Here is the command that I
used for that:
RESTORE DATABASE test2
FROM DISK = 'x:\test2.bak'
with MOVE 'test2_Data' TO 'f:\SQL_Data\test2_Data.mdf',
MOVE 'test2_Log' TO 'L:\test2_Log.ldf'
and the response:
Server: Msg 3156, Level 16, State 1, Line 1
File 'test2_Log' cannot be restored to 'L:\test2_Log.ldf'.
Use WITH MOVE to identify a valid location for the file.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
When I discovered the source of the problem, I inserted
the second back-slash in the move clause, and the restore
worked.
So, there may actually be 2 issues:
1. The extra back-slash that SQL expects to be in the path.
2. The erroneous error message associated with the restore
statement.
Has anyone else seen this?
Steve Phelps
SQL Server DBA
American Fidelity GroupThe extra backslash is due to a bug in EM in that if you use the browse
button to select the default directories it appends the trailing backslash
to the folder path, SQL actually expects the value to not have a trailing
backslash (easily ammended in EM by removing it although it generally
doesn't cause problems except the filename looking funny. Not come across
the restore issue, I'll try and repro that.
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Steve Phelps" <Steve.Phelps@.af-group.com> wrote in message
news:014201c356ce$1fa90c50$a601280a@.phx.gbl...
The scenario:
The server in question has its Default Log Directory set
to "L:\". I used sp_attach_single_file_db to attach an
mdf file. Here is the command that I used:
EXEC sp_attach_single_file_db @.dbname = 'test2',
@.physname = 'f:\test2_Data.MDF'
I received the following error:
Device activation error. The physical file
name 'L:\test2_Log.LDF' may be incorrect.
New log file 'L:\\test2_log.LDF' was created.
Notice the 2 back-slashes in the path of the log file! I
didn't notice it at first, and eventually attempted to
restore the database from a backup taken from a different
server, using a 'with move'. Here is the command that I
used for that:
RESTORE DATABASE test2
FROM DISK = 'x:\test2.bak'
with MOVE 'test2_Data' TO 'f:\SQL_Data\test2_Data.mdf',
MOVE 'test2_Log' TO 'L:\test2_Log.ldf'
and the response:
Server: Msg 3156, Level 16, State 1, Line 1
File 'test2_Log' cannot be restored to 'L:\test2_Log.ldf'.
Use WITH MOVE to identify a valid location for the file.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
When I discovered the source of the problem, I inserted
the second back-slash in the move clause, and the restore
worked.
So, there may actually be 2 issues:
1. The extra back-slash that SQL expects to be in the path.
2. The erroneous error message associated with the restore
statement.
Has anyone else seen this?
Steve Phelps
SQL Server DBA
American Fidelity Group|||You are aware you have to restart the SQL Service for changes to the default
directory to take effect ? A little test I did was to create a database when
the default log directory had a trailing backslash and confirm it had a \\
in it's name. Change the default log directory to remove the trailing
backslash and restart the SQL Service. I then detached the database created
earlier, deleted the log file and attached it using
sp_attach_single_file_db. This created the log file with the correct path
(no \\) . The device activation error referred to the path with the \\ in it
because it's reading the original logfile location from the database header
in the mdf file. Hope this makes things a little clearer
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Steve Phelps" <Steve.Phelps@.af-group.com> wrote in message
news:038101c356e2$dc0aaa70$a501280a@.phx.gbl...
Jasper,
Thanks for the quick response. I had considererd that
possibility and tried both with and without the slash when
I set the default directory. In neither case did I use
the browse button for that purpose. In both cases, the
default directory *appeared* to have been set properly.
Only when I used the sp_attach_single_file_db stored
procedure did the problem arise. My original thought was
that it was a bug in the stored proc. I hadn't looked at
the source code because I assumed that it was encrypted.
It isn't. I parsed out the code that builds the "Create
database" statement and executed it, printing the
resulting command:
CREATE DATABASE [test2]
ON (FILENAME ='f:\sql_data\test2_data.mdf' )
FOR ATTACH
then pasted it into Query Analyzer and executed it. Got
the same result. The new log file's path contains 2
slashes.
Steve Phelps
SQL Server DBA
American Fidelity Group
>--Original Message--
>The extra backslash is due to a bug in EM in that if you
use the browse
>button to select the default directories it appends the
trailing backslash
>to the folder path, SQL actually expects the value to not
have a trailing
>backslash (easily ammended in EM by removing it although
it generally
>doesn't cause problems except the filename looking funny.
Not come across
>the restore issue, I'll try and repro that.
>--
>HTH
>Jasper Smith (SQL Server MVP)
>I support PASS - the definitive, global
>community for SQL Server professionals -
>http://www.sqlpass.org
>"Steve Phelps" <Steve.Phelps@.af-group.com> wrote in
message
>news:014201c356ce$1fa90c50$a601280a@.phx.gbl...
>The scenario:
>The server in question has its Default Log Directory set
>to "L:\". I used sp_attach_single_file_db to attach an
>mdf file. Here is the command that I used:
>EXEC sp_attach_single_file_db @.dbname = 'test2',
> @.physname = 'f:\test2_Data.MDF'
>I received the following error:
>Device activation error. The physical file
>name 'L:\test2_Log.LDF' may be incorrect.
>New log file 'L:\\test2_log.LDF' was created.
>Notice the 2 back-slashes in the path of the log file! I
>didn't notice it at first, and eventually attempted to
>restore the database from a backup taken from a different
>server, using a 'with move'. Here is the command that I
>used for that:
>RESTORE DATABASE test2
> FROM DISK = 'x:\test2.bak'
> with MOVE 'test2_Data' TO 'f:\SQL_Data\test2_Data.mdf',
> MOVE 'test2_Log' TO 'L:\test2_Log.ldf'
>and the response:
>Server: Msg 3156, Level 16, State 1, Line 1
>File 'test2_Log' cannot be restored to 'L:\test2_Log.ldf'.
>Use WITH MOVE to identify a valid location for the file.
>Server: Msg 3013, Level 16, State 1, Line 1
>RESTORE DATABASE is terminating abnormally.
>When I discovered the source of the problem, I inserted
>the second back-slash in the move clause, and the restore
>worked.
>So, there may actually be 2 issues:
>1. The extra back-slash that SQL expects to be in the
path.
>2. The erroneous error message associated with the restore
>statement.
>Has anyone else seen this?
>Steve Phelps
>SQL Server DBA
>American Fidelity Group
>
>.
>

Monday, February 20, 2012

positioning of report parameters when diaplayed in report manager

hi all

i have a report with set of parametrers.

by default when we create parameters they r displayed adjacent to each other.

is there any way by which we can specify position of parameter to be displayed in parameter area?

for eg:- suppose i have two parameters say age & name

then i want to display them one below the other.

is this possible?

if yes how?

plz help me.

waiting for reply.

You cannot customize report manager in this area.

The closest you can get is to e.g. with VS 2005 build your own frontend application (Winforms or Webforms) that deals with the parameters and then use RS Winforms/Webforms ReportViewer controls to display the report based on the selected parameters. More information on the ReportViewer controls: http://www.gotreportviewer.com/

-- Robert

Positioning an added column...

how do I position a newly added column in the table?
the default is at the very end.
what would I have to add to this code:
ALTER TABLE Vehicles
ADD Model varchar(55)
Thanksyou can not change the position of the newly added coulmn from QA, it can only be done through EM. But why would you care to change the sequence of the columns? it is to be taken care in the query.|||I never seen such a command before, I don't think there is...
What is the diff?
The sequence of the columns in the table is not the finalize version...
You can still use "select statment " to position your columns for viewing.

Else if you really want to do it, do it through Enterprise Manager, design table, in between the columns you want it to be position, right click and click "insert column".

Ports And Protocols

Hi Folks ,

Got one for you ....

By default what ports and protocols do the following sql tools use...?

Enterprise Manager
SQL Query Analyser
SQL Profiler

And if anybody knows :

Performance Monitor
Mapping drives
Event Viewer
User/Server Manager

Any help would be greatly appreciated ....Do you mean TCP/IP ports and protocols?

Microsoft SQL uses port 1433 for the default instance, and 1434 for named instances. It uses the TDS protocol.

The other tools use a mish-mash of ports and protocols, but I'd start with port 135.

-PatP

Ports

Hi
I have a SQL Server 2000 system with two instances. The
non-default instance needs to use port 1433, but the
default instance is using that one. Anyone know how to
change the ports the instances are using?
JoeUse the Server Network Utility, select the instance then
select the TCP/IP protocol and select properties. You can
set the ports from here.
-Sue
On Tue, 18 Nov 2003 07:43:56 -0800, "Joe"
<anonymous@.discussions.microsoft.com> wrote:
>Hi
>I have a SQL Server 2000 system with two instances. The
>non-default instance needs to use port 1433, but the
>default instance is using that one. Anyone know how to
>change the ports the instances are using?
>Joe|||In case your instances are running in a Microsoft server
cluster, both instances can listen on the same port since
they'll be using two different IP addresses.
Linchi
>--Original Message--
>Hi
>I have a SQL Server 2000 system with two instances. The
>non-default instance needs to use port 1433, but the
>default instance is using that one. Anyone know how to
>change the ports the instances are using?
>Joe
>.
>