Thursday, March 29, 2012

Customize Report Manager

I would like to use Report Managers interface for choosing reports.

But all of the reports uses different dsu(datasourceuser) and dsp(datasourcepassword) depending on which user that is logon.

I would like to call the interface from a webapplication(where they have the current dsu & dsp).

Is there a way to customize Report Manager to save the dsu & dsp so users don't have to login for each report?

Or could I make a clever transformation from the Windows userid?

Or any other ideas?

There is not much you can do to customize report manager. I would recommend using Visual Studio 2005 to create a web application.

Tuesday, March 27, 2012

Customized Schema

Hi,
Is there any way to specify an XML Schema to SQL Server so when i use "For XML", SQL Server return data in XML Format in the Schema i have defined.
For example. I need sql server to return XML as
<object name="<table_name>">
<property name="<column_name>" value="<column_value>"/>
<property name="<column_name" value="<column_value>"/>
</object>
is it possible ? is there any other work aournd ?
Thanks in advance.
Regards,
Hatim Ali.
You should be able to do that with For XML Explicit. Another option would
be to create a mapping schema and use the XPath query from SQLXML to do the
queries for you. This also uses For XML Explicit but the XPath logic
generates the query so you don't have to.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Hatim Ali" <HatimAli@.discussions.microsoft.com> wrote in message
news:63B74B0A-E902-45F8-9255-4293BD18C70F@.microsoft.com...
> Hi,
> Is there any way to specify an XML Schema to SQL Server so when i use "For
> XML", SQL Server return data in XML Format in the Schema i have defined.
> For example. I need sql server to return XML as
> <object name="<table_name>">
> <property name="<column_name>" value="<column_value>"/>
> <property name="<column_name" value="<column_value>"/>
> </object>
> is it possible ? is there any other work aournd ?
> Thanks in advance.
> Regards,
> Hatim Ali.
|||Roger's solution works if you want <colname>value</colname> or exactly now
all your column names in advance.
We do not provide a general pivoting mechanism in T-SQL for SQL Server 2000
(and the PIVOT in 2005 has some limits).
If you need a completely generic way, you best use FOR XML for getting the
<colname>value</colname> format and then use an XSLT stylesheet to transform
it into the generic form below.
Best regards
Michael
"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:eIfu5RzaEHA.3480@.TK2MSFTNGP11.phx.gbl...
> You should be able to do that with For XML Explicit. Another option would
> be to create a mapping schema and use the XPath query from SQLXML to do
> the queries for you. This also uses For XML Explicit but the XPath logic
> generates the query so you don't have to.
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Hatim Ali" <HatimAli@.discussions.microsoft.com> wrote in message
> news:63B74B0A-E902-45F8-9255-4293BD18C70F@.microsoft.com...
>

Customized Parameters Area For Reporting Services

Has anyone customized the parameters area to pretty it up and make it more configurable like control number of columns etc?

Or can anyone direct me to a third party component?

Thanks.

I'm attempting to do this as well. I have a lot of params for a storedProc call and want to format it so the area isn't so large. Anyone figure this out yet?|||

Here's another post which may be able to help you.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=409942&SiteID=1

Jarret

sql

Customized Parameters Area For Reporting Services

Has anyone customized the parameters area to pretty it up and make it more configurable like control number of columns etc?

Or can anyone direct me to a third party component?

Thanks.

I'm attempting to do this as well. I have a lot of params for a storedProc call and want to format it so the area isn't so large. Anyone figure this out yet?|||

Here's another post which may be able to help you.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=409942&SiteID=1

Jarret

customized order by

I would like to some how customize my order by clause such that data gets
ordered in a very specific manner.
Please consider the following ddl
set nocount on
go
create table z_my_tbl_del
( i int,
n char(8)
)
go
insert z_my_tbl_del values(1,'aaa')
insert z_my_tbl_del values(1,'aaa')
insert z_my_tbl_del values(2,'bbb')
insert z_my_tbl_del values(2,'bbb')
insert z_my_tbl_del values(3,'ccc')
insert z_my_tbl_del values(3,'ccc')
insert z_my_tbl_del values(4,'ddd')
insert z_my_tbl_del values(4,'ddd')
insert z_my_tbl_del values(5,'eee')
insert z_my_tbl_del values(5,'eee')
go
select * from z_my_tbl_del
/*
/*
i n
-- --
1 aaa
1 aaa
2 bbb
2 bbb
3 ccc
3 ccc
4 ddd
4 ddd
5 eee
5 eee
*/
*/
go
drop table z_my_tbl_del
go
How can I write order by clause such that it orders by bbb first, then ddd
and then it would sort rest of the items regularly.
Please let me know if there is a way of doing it.
TIA...
/*
i n
-- --
2 bbb
2 bbb
4 ddd
4 ddd
1 aaa
1 aaa
3 ccc
3 ccc
5 eee
5 eee
*/ORDER BY CASE n WHEN 'bbb' THEN 1 WHEN 'ddd' THEN 2 ELSE 3 END, i
"sqlster" <trisha@.nospam.nospam> wrote in message
news:9524A826-4A16-4AED-A0E1-F7A4D9AAF4B2@.microsoft.com...
>I would like to some how customize my order by clause such that data gets
> ordered in a very specific manner.
> Please consider the following ddl
> set nocount on
> go
> create table z_my_tbl_del
> ( i int,
> n char(8)
> )
> go
> insert z_my_tbl_del values(1,'aaa')
> insert z_my_tbl_del values(1,'aaa')
> insert z_my_tbl_del values(2,'bbb')
> insert z_my_tbl_del values(2,'bbb')
> insert z_my_tbl_del values(3,'ccc')
> insert z_my_tbl_del values(3,'ccc')
> insert z_my_tbl_del values(4,'ddd')
> insert z_my_tbl_del values(4,'ddd')
> insert z_my_tbl_del values(5,'eee')
> insert z_my_tbl_del values(5,'eee')
> go
> select * from z_my_tbl_del
> /*
> /*
> i n
> -- --
> 1 aaa
> 1 aaa
> 2 bbb
> 2 bbb
> 3 ccc
> 3 ccc
> 4 ddd
> 4 ddd
> 5 eee
> 5 eee
> */
> */
> go
> drop table z_my_tbl_del
> go
> How can I write order by clause such that it orders by bbb first, then ddd
> and then it would sort rest of the items regularly.
> Please let me know if there is a way of doing it.
> TIA...
> /*
> i n
> -- --
> 2 bbb
> 2 bbb
> 4 ddd
> 4 ddd
> 1 aaa
> 1 aaa
> 3 ccc
> 3 ccc
> 5 eee
> 5 eee
> */
>|||Basically, you want 2 levels of ordering with the first level consisting of
an expression that evaluates 'bbb' and 'ddd' at the top of the list.
Modify your query like so:
select
*
from
#z_my_tbl_del
order by
case n
when 'bbb' then 1
when 'ddd' then 2
else 3
end,
n
"sqlster" <trisha@.nospam.nospam> wrote in message
news:9524A826-4A16-4AED-A0E1-F7A4D9AAF4B2@.microsoft.com...
>I would like to some how customize my order by clause such that data gets
> ordered in a very specific manner.
> Please consider the following ddl
> set nocount on
> go
> create table z_my_tbl_del
> ( i int,
> n char(8)
> )
> go
> insert z_my_tbl_del values(1,'aaa')
> insert z_my_tbl_del values(1,'aaa')
> insert z_my_tbl_del values(2,'bbb')
> insert z_my_tbl_del values(2,'bbb')
> insert z_my_tbl_del values(3,'ccc')
> insert z_my_tbl_del values(3,'ccc')
> insert z_my_tbl_del values(4,'ddd')
> insert z_my_tbl_del values(4,'ddd')
> insert z_my_tbl_del values(5,'eee')
> insert z_my_tbl_del values(5,'eee')
> go
> select * from z_my_tbl_del
> /*
> /*
> i n
> -- --
> 1 aaa
> 1 aaa
> 2 bbb
> 2 bbb
> 3 ccc
> 3 ccc
> 4 ddd
> 4 ddd
> 5 eee
> 5 eee
> */
> */
> go
> drop table z_my_tbl_del
> go
> How can I write order by clause such that it orders by bbb first, then ddd
> and then it would sort rest of the items regularly.
> Please let me know if there is a way of doing it.
> TIA...
> /*
> i n
> -- --
> 2 bbb
> 2 bbb
> 4 ddd
> 4 ddd
> 1 aaa
> 1 aaa
> 3 ccc
> 3 ccc
> 5 eee
> 5 eee
> */
>|||1) use table for the ordering
CREATE TABLE SpecialSort
(sort_order INTEGER NOT NULL,
n CHAR(3) NOT NULL);
INSERT INTO S.sort_order VALUES (1, 'bbb');
INSERT INTO S.sort_order VALUES (2, 'ddd');
INSERT INTO S.sort_order VALUES (3, 'aaa');
etc.
SELECT F.*, S.sort_order
FROM Foobar AS F, SpecialSort AS S
WHERE S.n = F.n
ORDER BY S.sort_order;
2) use a string
SELECT F.*, CHARINDEX (n, 'bbbdddaaaccceee') AS sort_order
FROM Foobar
ORDER BY sort_order;|||Why do you want to do this? Just one time? I would suggest that you add a
sort column to your actual table if you want to sort it differently
(especially since the client probably will want to change the sort
sometimes.) If it is just for certain reports, then implement a report sort
order table and you can then change the ordering at will.
create table sortOrder(
reportName varchar(10),
n varchar(8),
sortOrder int,
primary key (reportName, N),
unique (reportName, sortOrder)
)
insert into sortorder values('yours','bbb',1)
insert into sortorder values('yours','ddd',2)
select z_my_tbl_del.*
from z_my_tbl_del
left outer join sortorder
on z_my_tbl_del.n = sortOrder.n
and sortOrder.reportName = 'yours'
order by coalesce(sortorder.sortOrder,2000000000) asc, z_my_tbl_del.n
insert into sortorder values('yours','bbb',1)
insert into sortorder values('yours','ddd',2)
insert into sortorder values('mine','eee',1)
insert into sortorder values('mine','ddd',2)
insert into sortorder values('mine','aaa',3)
select z_my_tbl_del.*
from z_my_tbl_del
left outer join sortorder
on z_my_tbl_del.n = sortOrder.n
and sortOrder.reportName = 'mine'
order by coalesce(sortorder.sortOrder,2000000000) asc, z_my_tbl_del.n
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"sqlster" <trisha@.nospam.nospam> wrote in message
news:9524A826-4A16-4AED-A0E1-F7A4D9AAF4B2@.microsoft.com...
>I would like to some how customize my order by clause such that data gets
> ordered in a very specific manner.
> Please consider the following ddl
> set nocount on
> go
> create table z_my_tbl_del
> ( i int,
> n char(8)
> )
> go
> insert z_my_tbl_del values(1,'aaa')
> insert z_my_tbl_del values(1,'aaa')
> insert z_my_tbl_del values(2,'bbb')
> insert z_my_tbl_del values(2,'bbb')
> insert z_my_tbl_del values(3,'ccc')
> insert z_my_tbl_del values(3,'ccc')
> insert z_my_tbl_del values(4,'ddd')
> insert z_my_tbl_del values(4,'ddd')
> insert z_my_tbl_del values(5,'eee')
> insert z_my_tbl_del values(5,'eee')
> go
> select * from z_my_tbl_del
> /*
> /*
> i n
> -- --
> 1 aaa
> 1 aaa
> 2 bbb
> 2 bbb
> 3 ccc
> 3 ccc
> 4 ddd
> 4 ddd
> 5 eee
> 5 eee
> */
> */
> go
> drop table z_my_tbl_del
> go
> How can I write order by clause such that it orders by bbb first, then ddd
> and then it would sort rest of the items regularly.
> Please let me know if there is a way of doing it.
> TIA...
> /*
> i n
> -- --
> 2 bbb
> 2 bbb
> 4 ddd
> 4 ddd
> 1 aaa
> 1 aaa
> 3 ccc
> 3 ccc
> 5 eee
> 5 eee
> */
>

Customized Merge Replication Snapshot

I'm currently using merge replication that is not syncing the data when
applying the snapshot.
When applying the snapshot, the only bcp files transfered are
msmerge_contents.bcp, msmerge_genhistory.bcp, sysmergesubsetfilters.bcp
and msmerge_tombstone.bcp.
The problem is that the snapshot agent generates bcp files for all of
my tables. I will never use these and delete them as soon as they are
generated.
Does any know if it's possible to have the snapshot agent only copy the
merge tables and not the user tables but still generate the other
metadata scripts?
Thank you,
seanbell68@.gmail.com
I'm confused by what you are doing and why. For a no-sync subscription these
files must be generated and applied on the subscriber. Failure to do this or
emptying some of these file will guarantee your merge replication solution
will not work.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<seanbell68@.gmail.com> wrote in message
news:1121205750.708059.309200@.g44g2000cwa.googlegr oups.com...
> I'm currently using merge replication that is not syncing the data when
> applying the snapshot.
> When applying the snapshot, the only bcp files transfered are
> msmerge_contents.bcp, msmerge_genhistory.bcp, sysmergesubsetfilters.bcp
> and msmerge_tombstone.bcp.
> The problem is that the snapshot agent generates bcp files for all of
> my tables. I will never use these and delete them as soon as they are
> generated.
> Does any know if it's possible to have the snapshot agent only copy the
> merge tables and not the user tables but still generate the other
> metadata scripts?
> Thank you,
> seanbell68@.gmail.com
>
|||There are times, such as after using sp_mergecleanupmetadata, when
snapshots are required to be regenerated. I also use a copy of the
publication database when creating new subscribers so the data is
already synced in that case as well. In fact, I have never used the
bcps generated for the user tables.

customized grouping

I have a tabular report with several groupings.
I want to customize one of the groups.
For example I have a field called country. I want to group it by
region, western and eastern. How would I do this?where does the regional information come from? you need to provide us with
more info about your fields and their data.
"OogleGoogle" <Yvonhong@.gmail.com> wrote in message
news:1183576344.729726.5950@.i38g2000prf.googlegroups.com...
>I have a tabular report with several groupings.
> I want to customize one of the groups.
> For example I have a field called country. I want to group it by
> region, western and eastern. How would I do this?
>