Showing posts with label link. Show all posts
Showing posts with label link. Show all posts

Wednesday, March 21, 2012

Displaying xml with xslt in RS

Hi,

I've got an xml and an xslt - I want to get that into reporting services. Right now I have a link to the xml file in a 'report', which will open it correctly and format with the xslt. I'd like it to display without going to an external link.

I know how to use an xml datasource, but I need the xslt applied, since it has some nice formatting in it - so i don't think that will work.

I'm trying to report on the results of a scripted ms baseline security analyzer of several servers - the style sheet lets you drill down and has links to the base reports.

Thanks for your help.

There is a way to apply xslt "automagically" in a report definition (check the Data Output tab of the Report Properties dialog) , although unfortunately you would probably have to rework your xslt a bit to use it. The reason is that the xml it is going to be applied to is the data XML of the report itself. You either need to define a report that will supply exactly the xml that you currently have as its data result, or you need to change the XSLT to fit the data xml you *will* get from some report.

The key point heres are "from some report" and "data output of a report". You can't just take any xslt result and display it within a ReportViewer interface. Is that what you are trying to do?

Note that it *is* possible to upload arbitrary files to Report Manager and then link to them, I think. But that's not the same thing as displaying those files within a reportviewer control interface.

>L<

|||

"Note that it *is* possible to upload arbitrary files to Report Manager and then link to them, I think. But that's not the same thing as displaying those files within a reportviewer control interface."

Yes, that sounds like it would be what I'm after - I really just need it there because all of our other reports are there, not because of any RS functionality. Now if I only knew the technical term for this to find it in the manual, I'd be set.

"You either need to define a report that will supply exactly the xml that you currently have as its data result"

Seems like this could work too - I'll have to look into it.

Thanks for your help Lisa.

|||

>>Yes, that sounds like it would be what I'm after - I really just need it there because all of our other reports are there, not because of any RS functionality. Now if I only knew the technical term for this to find it in the manual, I'd be set.

<rofl> Well I don't know the techical term but I can tell you that you upload the file using a button in the Report Manager that says... wait for it... Upload File. You give it a title, it becomes a browseable item in the Report manager interface (unless of course you mark it "hide in list view"), etc.

You can do it programmatically as well, you might want to look at this http://www.sqldbatips.com/showarticle.asp?ID=62 or you can probably use the SOAP API for this as well.

>L<

Monday, March 19, 2012

Displaying the query result in one row

Hi all,

I have two M:M tables, A and B, which are connected by a 3rd link table C.
Each row of A might be connected to 0 to 10 row(s) of B.

A (ID, AName)
C (A.ID, B.ID)
B (ID, Bname)

And when I query AName = Smith, normally, it returns:

Smith | Hat
Smith | Coat
Smith | Shoes

My question:
Is there a way to DISPLAY this result in ONE row without changing the tables structure?
Like -> Smith | Hat | Coat | Shoes

Any comment and help would be appreciated.

Thanks
SamYes, but not using pure SQL. You will have to write application code to query the data order by ANAME and then keep concatenating the BNAME values together until the ANAME changes.|||Is there a way to DISPLAY this result in ONE row without changing the tables structure?
Like -> Smith | Hat | Coat | Shoesthere sure is, but only in mysql version 4.1+, and sybase ase|||there sure is, but only in mysql version 4.1+, and sybase ase
... or Oracle 9i like this (http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2196162600402).|||... or Oracle 9i like this (http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2196162600402).W TF OMG LOL

that's horrible!!

:cool:|||True, but at least Tom Kyte has done all the work for us. All we have to do is install his STRAGG function once, make it public, and from then on just use it, i.e.:

select deptno, stragg(ename)
from emp
group by deptno;

(But it would be neat if it came built-in to the DBMS I agree).|||Thanks a lot Tony and Rudy.

I thought there might be a SQL trick (!) to do that and I would put myself in disadvantage if I didn't ask you about that.

I will try this again when I start my application development. Any reference, link, or hint on this subject would be helpful for me. I am not even sure what such a process is called, "multi-column to one-row"? :D

Rudy, I was wondering if you could address the section of MySQL manual for doing that job in MySQL 4.1+ as you mentioned. (I am going to use MySQL 4.1.x and PHP)

Thanks again
Sam|||it's called "denormalization"

in mysql it's the GROUP_CONCAT function (see 12.9.1 GROUP BY (Aggregate) Functions (http://dev.mysql.com/doc/mysql/en/GROUP-BY-Functions.html))

using your tables A,B,C above, you would write:select AName
, group_concat(BName separator ' | ') as BNames
from A
inner join C ...
group by AName|||Yes! That was what I was looking for.

Thank you very much Rudy. You solved my problem again. Your solution works very well. Especially, with that separator '|' you recommended, the result is very readable.

You are not only very knowledgeable but also an awesome teacher. I must enroll in your "online course SQL for Database-Driven Web Sites". I am sure I will learn a lot from you.

Regards,
Sam