List reports with inline SQL in SQL Server Reporting Services? - sql

I have a couple of inline SQL in many of our reports on the report manager.
Now I need to do some code change for all of them, is there a way to list all those reports based on the inline SQL and not any SP?
Thanks,
D

You can use the reporting services API to get the report from the web service and do a search for the appropriate tags in the XML. The MSDN documentation for the report definition XML schema and diagrams can be found here and a diagram of the data source related parts here. The API documentation can be found here.
You can write .Net programs that upload and download reports from the Reporting Services API, using ReportingService.GetReportDefinition and SetReportDefinition. You can upload or download the report definition into a buffer, which can be read or written to disk. Somewhere I have an Ironpython prototype that does this, which I'll post if I find it.
To use this, you need to query the WSDL and generate a stub. The tool to do this is called WSDL.EXE. If I can find it I'll post it here, but you could just as easily use C#.
There is also a tool called rs.exe that comes with BIDS which takes a VB.net program and tops and tails it with includes for the Reporting Services API. You can use this to execute a VB.Net script from the command line - essentially it tops and tails the program, compiles it behind the scenes and runs it against a report server.

You can either do what NXC suggested or if this is a one time activity, you can simply open the RDL file for the report in a text editor and search for common SQL strings like "select", "delete" etc in order to find the reports which have inline SQL

Related

Viewing SQL for SQL Server Integration Services (SSIS) Transformations

I am new to Database and SSIS. Can anyone please let me know is there a way to look or view SQL code generated by SSIS transformations.
I know in BI reporting tools such as Business Objects, when we pull fields or columns into the reporting panel, we can view its corresponding SQL.
Similarly in SSIS, is there any option to view the SQL for SSIS Transformations.
Thanks in Advance
Raj
SSIS unlike other tools does not generate SQL per se, although you can include your own SQL inside tasks and components, but I guess you are not interested in the SQL that you write yourself but rather what SSIS is doing behind the scenes.
An SSIS package is essentially an XML-structured file with a collection of properties marking up the flow and process of its components. You can access to this xml file by right clicking on the package and selecting View Code:
The example above is an empty package so it's a very small XML file. In a complex package, this file can be very large as you will see all the tasks, components, parameters, variables, etc. as well as your own SQL code and C#/VB scripts if any.
When the project is built it generates a .ispac file which is no other thing that a zip file containing the package(s) in project plus a manifest, a content type and any other file required for the package to be deployed and executed.
You can see what is inside a .ispac by renaming to .zip and opening it. In this example I've built the above empty package and renamed the ispac to zip, then opened it :
In summary, unlike other tools that are purely SQL generators, in SSIS there is not much you can see about the generated code, all you can see is its structure as shown above.
Also, as mentioned by Marko Ivkovic in comments it might be possible to get some more info about what is happening at run time by using tools like SQL profiler.

How to open a Webi report from Design Studio?

We have recently installed Design Studio 1.5 and trying to call existing Webi reports through Design Studio.
Can anyone please let me know the steps involved to attain this?
For this you need to use the OpenDocument feature.
Have a look at help.sap.com which contains all the manuals for SAP products. Specifically this page contains the OpenDocument manuals (search the page for OpenDocument and select the version corresponding to your BI4 deployment).
In a nutshell (you can find all the information you need in the aforementioned manuals): the OpenDocument feature is basically a URL in which you provide the necessary parameters (docID, parameters, …) to open and optionally refresh your report. As it's a URL, you can embed it just about anywhere (an HTML page, a Design Studio app, … even another Webi document!).
Once you have the OpenDocument URL of the Webi report, you can use the scripting function APPLICATION.openNewWindow(newUrl) in the Design Studio client, and pass in the URL. As Kristof suggested, check on SCN where there are many users writing guides and discussions on how to get the URL.

How do I upload an Excel sheet to a SQL table in a Lightswitch web client?

I have a lightswitch project in visual studio 2013, using vb.net. I would like the user to be able to click a button and have lightswitch find an excel file, and upload that file to a sql table according to a pre-determined column mapping.
My preference was to use the Office Integration extension for visual studio, which I got working with VS 2013 by downloading it from this link: http://www.ge.tt/71iuRQv/v/0
However, the documentation and examples for office integration seem to be very heavy on getting an excel spreadsheet into a display in the lightswitch web client, rather than into the sql data table, which is where I need it. Here are the examples I've been following:
http://blogs.msdn.com/b/bethmassi/archive/2012/07/18/new-and-improved-office-integration-pack-extension-for-lightswitch.aspx
Alternatively, I have an existing stored procedure, and I can request that the server call this stored proc by sending a web API extension from the client to the server. I have this working already for other stored procs, according to examples from Beth Masi and Paul van Bladel. (Stackoverflow won't let me post the links...)
The undesirable part of this approach is that the stored proc is old, and messy.
I've searched and searched, but have yet to find anyone approach this problem for VS 2013 with lightswitch. Any useful advice?
I've used the method detailed by Matt Sampson to store word files and it works very well. Since it just stores the raw binary it should handle Excel files just as well.
If you're creating the table in LightSwitch, use the Binary Type. If you use SQL create scripts use varbinary(MAX).
You need to create a custom Silverlight dialog box to gain access to the OpenFileDialog object. Then open the file in as a FileStream.
Finally, you need to add a handler for the closed method of the control and then show the control to the user. Most likely done in a button. This needs to be done on the main dispatcher.
The code examples are in C# but I just used one of the many available translators out on the web and copy/pasted the VB.NET code.
Another option might be to consider shelling out to the DTSEXEC run-time to execute an SSIS package to perform the upload - especially if the target Excel spreadsheets have predefined layouts and content data types.
Even simpler, you might be able to use the SQL Server BULK INSERT command to get the job done - although that would require a SQL Client connection to your database.
HTH

Custom Report Items in local reports

i have read this article about custom report items(CRI)
http://msdn.microsoft.com/en-us/magazine/cc188686.aspx
The only problem is that CRI are only usable in reporting service and not in local reports. My question is it possible some how to use CRI in local reports( RDLC ). Also i am interested in which version of reporting service is this possible, if possible
Best Regards,
Iordan
Custom report items are not supported in .rdlc files. (http://msdn.microsoft.com/en-us/library/ms251712(v=vs.90).aspx) This is likely the approach taken by Microsoft because the ReportViewer used with these files is a free control, while more complex features like third-party controls are supported only on a full SQL Server report server.
One thing in particular I have done in the past to get around this is generate custom charts/controls/images etc. As images and then send them into the report as an image. Not an ideal solution but it works.

Password protected PDF/Excel reports using SQL Reporting services

I am generating a reports using SQL Reporting services 2005. I need to protect the protect the reports(pdf and excel) with the password while the user is exporting the report to to excel or pdf.
Is there any way to protect the report.
The short answer is that you can't do this from the provided PDF rendering extension from SSRS 2005 (either from the web UI or programmatically from the SSRS web services). You can, however, create your own rendering extension that could provide this functionality. Here are some links that might help get you started:
Introducing Rendering Extensions
Microsoft SQL Server 2005: Reporting Services
You could take a COTS library, some open-source code, or your own custom code that can create password-protected PDF files, then wrap that into a custom rendering extension for SSRS 2005. In my opinion, however, this would be a relatively difficult task. A quick Google search didn't give me any obvious rendering extensions for sale that might provide the functionality you're looking for.