How to see the contents of deployed datasource? - sql

I've inherited a project (without a handy handover) that contains reports published to a Reporting Server (2005).
MY SSRS knowledge is 4 years stale, so I need your help.
I need to edit one of the published reports, is this possible?
I also want to peek into the Data Source on the RS, because that's probably where I can change stuff.
I'll add more info as I get a better understanding of what exactly to ask.
EDIT: I found a project for some of the reports, opened up in VS2005 BI.
Still, how do I see where the Data Source gets its data?
It brings back 56 fields but I don't know which tables/stored procs/queries are used to get these.

Yes you can.
1st - to edit the published reports: Browse to the folder containing the report source you want on report server (web server). On the right side click 'Show Details'. Now click the properties icon under the 'Edit' column. Near the bottom you will see two links: Edit & Update. Click edit and the source RDL file will start to download. This is the actual report source.
You can import this right into a VS2005 report project and have full access for modifications.
2nd - As to the project you found: After opening an RDL file for editing, click the 'Data' tab. directly under that you will see a drop down list labeled 'Dataset:'. A report can have one or more datasets. These are the actual queries that generate report data. Also clicking '...' will allow you to see other properties of each dataset, such as parameters, etc.

You can run a profiler on your server, then run your report. The profiler give you most info about your query or stored procedure.

Related

Google Data studio can't find the bigquery dataset after moving to a different location

I have changed the location of several datasets in bigquery. The final names have not been changed after the operation.
I can query them in the bigquery UI but data studio is raising an error (BigQuery error: Not found: Dataset xxx:yyy)
It seems that data studio is not changing the processing location.
Is there a fix or solution for this?
Here is how I solved this bug without breaking my dashboards.
Click on "Resource" -> "Manage added data sources";
Find the data source that you need to reconnect and "Edit" it;
Click on "Edit Connection" on top-left;
Click on "Custom Query" and use this template: SELECT * FROM `{project}.{dataset}.{table}`
Click on "Reconnect";
By doing this, you can preserve all your fields & tables.
After that, you can use it just like that or move back to selecting the dataset and table and reconnect again.
I've seen this and "Reconnect" does not work. The fix is to Copy the report, then it will work. Rename the old report with a (Do Not Use) suffix, then remove "Copy of" from your new report name.
You will need to reset the Share permissions to the same as the old report. Of course any links to the old report need to change too.

Some useful functions of MySQL Workbench for SQL Server management studio

Our project is moving from MySQL to MS SQL and after a long time working with MySQL Workbench I really miss some features in SQL Server Management studio (2014).
Do you know whether they exist in SSMS or there is an alternative/replacement application for SSMS to work with database?
Functions are listed below:
Generate update data script to review and to be able to copy-paste it. Do not update data when I move to another row when the table is opened for editing.
Some changes are still made in database in our project, and sometimes it's easier to add some rows manually in 5 tables, get the script, test it and run the script at production environment. I don't want to write a script for each update and I don't want to make a mistake when copying data to production server using edit table option.
Review update table script BEFORE the changes were made, not after (I am talking about Tools - Options - Designer - Auto generate change scripts).
Upload a file using select file dialog into a binary field.
Again, I know about using OPENROWSET function, just interested how to do it as I used to.
Ability to view large text fields in a convenient way in SSMS. Now I have to copy data from a field and paste it into notepad. (For example, error message with a long trace log)
Save a few tabs with some useful scripts and open all of them when I open SSMS.
Is there any way to organize tabs to be able to work with 10+ tabs more effectively? Now only 6 of them can be shown on the screen (compate it to 15 tabs in MySQL WB).
Simple 'search field' (like Ctrl+F in Excel) to be able to search data in all fields displayed on the screen.
I would appreciate any ideas.
Thank you.

Not able to preview RDLC report in VS2013 because of blank data source instance

I have been struggling with this issue for two years now. My problems are happening in Visual Studio 2013 (not a web server).
Occasionally, I have to take an RDLC file that was created by someone else and make changes to it. Using VS, I create an XSD file for the dataset, then replace the DataSource and DataSet in the RDLC so that the report now points to the tableadapter(s) in the XSD.
Often when I try to view the report in the ReportViewer form, the Report Data Source and Data Source Instance are blank. I've tried Rebind Data Sources, and I've cleaned and rebuilt the project, but I can't get the data source to show up. Sometimes the report will have a subreport, and that data source will be available if I choose that RDLC.
I'm a third party developer -- I'm not editing (and cannot edit) aspx files; just the reports. I've tried editing the code in Form.vb manually to insert the TableAdapter, but it hasn't worked, and I don't really know what I'm doing there -- I have some object-oriented programming experience, but not much.
What can I do to make the data source available to the report viewer and/or bind it to the RDLC? Any suggestions are appreciated. Please let me know if there's any particular code it would be useful to share.
Thank you.
I ended up doing the following, which solved the problem in this case. Not sure it's a solution that will work in all situations like this.
I replaced the opening Report tag in the XML of the RDLC with this:
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
I removed the <ReportSections> and <ReportSection> tags, as they are not supported by the 2008 schema. I didn't remove anything that was between the tags.
After making these changes, the data source became available to the form, and I was able to preview the report.

extract raw SQL query from a Crystal Report .rpt file

I've got an .rpt file that I did not write and can find no documentation about. I want to be able to review the SQL that is generated from this report so that I can figure out, well, what data it was pulling and what WHERE clause parameters were used.
I can open it up and see the report layout. But when I select Database|Show SQL Query... the report tries to connect to the data source. The problem is, the data source being used is unknown to me, probably an ODBC connection used by whoever wrote the query. All I can do at that stage is 'Cancel' and I'm back to looking at the report designer.
Am I missing something? Can I get to the SQL query without connecting to the datasource? It seems like viewing the selection criteria shouldn't be dependent on a data connection.
Thanks.
version: Crystal Reports 2008
I know that this is an old thread, but I encountered this same problem. Effectively we used to have a database/application that has since been aquired by an external agency.
Although they now have the database/application they don't have access to crystal reports, so we can't just send them the old report that we used to run. Likewise we can't run it as we don't even have the database set up anywhere.... So instead our plan was just to extract the SQL code generated by the report and forward that on.
We experienced the same problem, but the solution is actually pretty simple.
If you don't have access to the original data source, just create a new 'blank' datasource (such as an ODBC connection). As long as the connection to the datasource works (i.e. it is some kind of valid datasource this it works fine). When running the 'Show SQL' option point the report to this datasource. As long as you don't try to actually run the report (and only show the SQL) the operation wont fail. This worked for our situation anyway. (Crystal Reports 2008)
(I can give more details if it helps in any way.)
It should be possible to find out some details about the existing datasource, by selecting Database > Set Datasource Location... .
As well as enabling you to change the datasource location, this should show you some information about the current datasource, such as which type of datasource is being used, and possibly (dependant on the type of driver) the name of the database. It is likely to be less helpful if (as you surmise) the datasource is ODBC, but if it uses a native driver there may be something useful.
Without the password, I'm not sure how much you can do. It seems "Show SQL Query" requires to report to run first, then generate the SQL plan.
It's not ideal, but you could go to Database > Visual Linking Expert to at least see the tables and how they are joined, and the go to the Record Selection Formula Editor and see what the custom WHERE statements are.
Viewing the SQL of a Command in a Crystal Report File
There are times you have just the report file, but not the associated database structure that the report uses.
This is common when dealing with example reports of functionality you wish to mimic.
This is a workaround ONLY to allow you to see the SQL of a Command that a Crystal Report is based on, when you don't have the underlying database connection that the report is based on.
In essence, the dialog box has to be satisfied before it will show the SQL, so we fool it with a legitimate Data Source, just not one that would work with the SQL that is actually in the SQL Command.
Why does a report use a command? Doesn't Crystal Reports have the ability to link tables?
When a Crystal Report is based on a record set that is too complex for the table linking functionality within Crystal Reports, the report can instead be based on a SQL Query, usually developed/tested in another editor tool and pasted into the command. This allows advanced SQL functions to be utilized.
If you don't already have a Data Source on your computer set up that you can connect to, you will need to build one first.
A simple Microsoft Access .mdb file saved in a simple location will suffice.
I placed mine with the path C:\A_test\test.mdb to make it easy to find.
If you don't have one, google for a sample mdb file and download it, saving it with a name and location you can remember. (You won't ever actually open this file, but just connect to it.)
Once you have the file saved, open the ODBC Administrator and create a New Data Source.
(you can get to the ODBC Administrator quickly from Start > type ODBC in the Search)
On the User DSN tab, click the Add button.
Scroll down the driver list to Microsoft Access Driver (*.mdb), select it and click the Finish button.
In the Data Source Name box, type a name (I used MyTest).
Click the Select Button and select the mdb file you saved from a previous step, click OK.
Click OK again. You will see your new Data Source listed by the name you gave it. Click OK.
You now have the data source you will need for the next steps.
Open the Crystal Report you want to see the SQL command for, and click on Database Expert button or Database>Database Expert Menu.
Under Selected Tables, right click on the Command and choose View Command
The Data Source Selection Box appears. Select the Data Source you created (or one you already use) and click the Finish button. The View Command box should open with the SQL in the left pane. Copy the SQL into your favorite text editor.
Whats happening is that the crystal reports needs a database to connect to regardless if its the original source DB or not.
Create a local database or use a database stored on a server, added it to your ODBC Datasources and use it when connecting. After a successful connection you should be able to view the SQL query without an error.

How do I share an image between projects in Microsoft SQL Server Reporting Services 2005?

I have a SQL Server 2005 Reporting Services solution containing several reporting projects. (I need separate reporting projects so that I can deploy reports to the correct folders on the report server.)
We want to include our company's logo in the header of each report.
I don't want to bake the logo image into each report ("embedded"); nor do I want to include a copy of the logo in each reporting project.
Still, I would like for the logo to "live" in the solution and on the report server one way or another so it's packaged up with the reports and gets deployed along with the reports.
How?
The best solution I have come up with so far goes like this:
Create a reporting project (called “Shared” in my case).
Include the logo image in that project (it goes into the “Reports” folder, but that seems irrelevant).
Configure that project to deploy where and when I want. (For the “where”, a folder called “Shared” was the default and suited me.)
On each report, set the properties for the image in the “layout” tab thus (and I mean the properties in the sidebar view, not the other properties in the pop-up dialog box):
Under “Data”, set Source to “External”
Under “Data”, set Value to “../Shared/logo.png”
(To apply this to many reports, it helps to do bulk manipulations on the RDLs’ underlying XML.)
This shows a broken image link when I play with the report in Visual Studio, but when I deploy it to a report server, the logo appears.