Reporting Services: Exported to Excel results are different than the ones viewed on IE - sql-server-2005

I'm having this problem:
The SQL Server holds a said value, let's say 990.30, the Reporting Services Report show a different value (948.33) when viewed online, in the brower and a third value (912.22) when the report is exported to Excel.
There are no formulas on Excel, just plain values.
Also, there's no formula on the layout of the report.
The code shows only a simple select that, when run on the SQL Server Management Studio, returns me the original value (990.30).
How on earth shall I start to troubleshoot this ?

I've never heard of this kind of problem before. I would recommend submitting a ticket to Microsoft and provide them with screen shots of the errors, the RDL file, a sample output of the stored procedure, etc.
To troubleshoot this on your own, I would recommend creating a new report that just has a simple table that returns all the details from your stored procedure or query to validate the values are consisten across all interfaces. From there, just start adding on complexity until you get the report to look like it is today.

Related

Conversion error in Visual Studio not showing data types

I'm running into an issue when trying to view a report I set up in visual studio. The report is throwing a conversion error (which I'm familiar with), but it's not showing any information about that conversion error. see screen shot below (I guess I can't embed the image, so please see link). This is running a stored procedure I set up in SSMS, and in that stored procedure everything works just fine. There are three queries and a stupidly simple export with 4 fields. All of the individual queries work just fine.
The conversion error appears to be involving a parameter I set up in the report. This parameter labeled 'performance' is varchar(30) and only interacts with other varchar(30) data types. I literally only compare it to a single field that is of the exact same data type, and do not use the parameter for any other purpose. The reason I say I believe this is the issue is because when previewing the report in visual studio, I can enter a performance name with single quotes around it, and the error doesn't appear (although this isn't helpful because it passes along the single quotes and therefor messes up the match).
I run visual studio and SSMS through a hosted platform, so every angle of this is interacting with a remote server and remote applications. Nothing is stored in house.
Any help here would be much appreciated! I've already discussed this with the company hosting our applications, but without knowing whether or not this issue is server-side or on my end, they're unwilling to assist.

Advantage to using SSRS or Crystal reports when the output is simple and static?

I have an ASP.NET/C# web app in which the user needs to run reports with various criteria that will ALWAYS yield simple, 2-dimensional, tabular data. I'm tempted to use a sophisticated reporting engine like SSRS or Crystal Reports, but these seem like overkill, since there's really nothing to design (all outputs will be to CSV, or JSON for the browser to render in an HTML table).
In this scenario, am I eating too much complexity by trying to use SSRS or Crystal Reports? Should I instead just write custom classes to dynamically assemble SQL statements (based on user selections) that will be fired against the database?
Does SSRS or CR add anything that is of value (within the requirements constraints I've already described)...?
Its depend on your requirement if you want to minimal overhead on your web app then please go ahead and use your custom codes since you are not required any styling or extra functions.
Just get JSON objects and fill in HTML and go Head !!
I am working with ssrs So i will talk just about it:
ssrs is a very useful tool for building a Reports
all You need is sql server Stored Procedure to build your report
then deploy it to report server and use this report from your app
-now all you need in your app just one page for all reports and you path the URL
dynamically with report name
You need to know this :
-ssrs did not work correctly with all browser
for Exp :
-Print Btn just work with IE
so Mozila and Google you need to use java script to print Report
-some issue with criteria section :
there is no way to rename the 'select value' with drop down
so you need to use java scrip to handle it
also you find ( Null and chick box ) any customer did not know what null mean so
you need first to remove null keyword or to rename it to anther Keyword
also you need java script to do this
the most problem i have :
all reports in reports server so
when i go to a new client what i need
just Sql server no need to setup visual studio and ssrs tool
just to deploy all reports on client report server
its very bad ..
i solved this issue with tool i had make to deploy the all the report
and no need to setup VS just to deploy the report
i think that the most important problem i have
and all of it i found a work around to solve .. and it takes more time
finally :
use ssrs or CR its very easy to use and make report very fast no need to create a custom page for report and develop all its control just like print and export
report to PDF,excel or any type
but if you have a few report i think no need to use any reports tool

Crystal Reports vs. SQL Queries

I'm a programmer (mostly C++) who has moved into a non-software workplace. However, I don't have much experience with database stuff at all.
TL;DR: If we compare Crystal Reports to just writing scripts that execute SQL queries and parse the results, is there anything that CR can do that isn't possible via SQL queries & scripts? I'm talking purely in terms of extracting data - not making pretty documents.
Detail:
At my workplace they have a process where you run a bunch of Crystal Reports, modify the date range to the current month, manually export each to excel, delete the rows and columns that aren't needed, and then cut and paste into a summary excel document that is used by management.
To me, this is pretty crazy and stupid. I'd like to automate/script most of it.
So I have two options:
Learn Crystal Reports and try to modify the existing reports to be more automated.
Dump CR and just learn SQL and do the whole thing programmatically with scripts working with CSV files or something.
I'd much rather learn SQL since it's more general and useful. But I need to be assured that I can get the data output that I need (without writing a million lines of code to reproduce CR myself.)
So yeah, I'm looking for an answer like, "The two are equivalent. Anything you can do in CR you can do easily via scripts and SQL," or "If you need to group records into categories based on a parameter and then sum their one of their fields, then CR will do it much more easily than raw code," to push me in one direction or another.
Edit:
Some additional detail. At the moment my crystal reports run a database query, and then crystal does things like, "don't display the records that are returned, instead group the records by Field A and then display the count of how many records in each group."
Is functionality like this difficult to reproduce via SQL coding? I wouldnt want to have to write a python (or whatever) script to parse and manipulate the data from plaintext CSV, for example.
You can't just compare SQL and CR - they have different purpose. SQL (in this context) is data source, CR is pretty output formatter. For excel you would need data, not formatted output. Excel combined with SQL can give you all CR options (dynamic crosstab reports, charts etc) what you can't get directly from SQL data.
BTW, creating SQL views or procedures is often needed to overcome CR limitations; from this standpoint SQL has lot of more options than CR.
I personally would go with SQL+Excel route. In our company we're using simply SQL+CR without postprocessing, sometimes SQL+Excel. Our customers are using different approaches.
But like said by other people, choice of tools depends on more things. Who has to redesign reports? Who will maintain these reports? How often requirements change? Are there more uses for CR reports besides sourcing Excel tables? Who will be waked up at night, if reports do not work?
Management perpective:
In many I will say mostly cases management does not know SQL. So if a manager for E.g.HR wants to know staus about something then how he will get that status?? This is where Crystal reports come into picture, Using crystal reports they do not have to worry about SQL; they will just enter required fields and get their data.
Programmer perspective:
Simple data outputs can be achieved through SQL but consider a scenario where you need to pull details as well as summary. I agree it can be done via SQL but consider the overhead of time and proficiency required to develop such output using sql. I bet it wont be that easy to develop such output using sql as compared to crystal. So I will say learn both SQL and crystal, you will get to choose the tool to apply for your requirement.
You can write SQL and drop it into the Crystal Report. Best of both worlds, and possibly faster performance than the drag-and-drop Crystal functionality.
You will see some response time lag when the report runs.
There are actually a few things that Crystal Reports can do that are very tricky using plain SQL Queries as Crystal Reports can access the entire dataset in a single formula and can do things at runtime.
However unless you have some really crazy complex Crystal Reports I would recommend building a tool in Excel that can one click the info straight into a new sheet.
I did this and it got me a promotion, not kidding :P
I have a custom Excel Addin I can give you code to that basically does this:
On open, connects to the database and downloads a list of menu options connected to views and procedures
Adds these menu options into a new Ribbon tab within Excel
When one is clicked, runs the view and dumps the entire dataset (properly formatted) into a new sheet
Advantage of this is you can update the main menu list and each view it references without making any changes to the file or re-issuing anything to everyone.
Crystal could be helpful if you want to create a document with a specific layout , logos etc. and show some data on it. Export to excel from Crystal repot is not easy - usually there are a lot of empty columns and rows and each report should be tweaked to avoid that.
If you need to export some data from a SQLServer database to excel your best option will be SSIS ( I guess you have a license for SQL Server). If you don't have license for SSIS or you are using for example Access database there are also some inexpensive tools, which can retrieve data from any database ( not just SQLServer) and export it to excel. I would suggest you to check this one: http://www.r-tag.com. It can run Crystal reports and SQL reports so you can start using your crystal reports immediately and start transforming them to SQL reports whenever you have time for that. Both reports could be exported to excel.
i fixed this by editing excel sql, Left(Column_maxLength, 250)
this resolved my issue
in my case if even if i read left 250 character is enough

Failed to retrieve data from the database, Database Vendor Code 9421

I have a report made in Crystal Reports XI. The report is generated and exported to PDF in visual basic script using COM interface. Generally everything is running smoothly, but in one case generation breaks with error:
Failed to retrieve data from the database. Details: [Database Vendor Code 9421]
Database used is MSSQL 2005 connected over ODBC to CR XI. When I am opening report with exactly the same parameters in Designer, everything works fine.
It looks like it is data related, but it is hard to trace since the whole report is pretty sophisticated. Anyway I spent half a day on crawling over Dr. Google and it seems that he has no clue what might be an issue.
When you previewed the report in Crystal Reports Developer, did you look at the whole thing? Some custom formulae are not calculated until you actually look at the page.
Try scrolling through the entire report top to bottom. If your error message pops up halfway through and Crystal refuses to preview the rest of the report, then there's probably some anomaly in your datasource that is tripping up a custom Formula in your Crystal Report.

SQL behind an external data query in Excel

I have inherited an Excel spreadsheet which contains an external data query. I can edit the query, which provides a list of the columns returned, but it does provide the table that this data comes from. Is there any way to retrieve the actual SQL behind the query?
I think this may depend on the version of office you're using and the type of external data you're connecting to.
I believe if you're using Office 2003, and you're seeing columns like you say, there may be a SQL icon in the toolbar.
Click that to view the SQL used to return the data.
If you're using Office 2007, Go to the Data tab, click connections, then properties, then the definition tab, and change the command text.
However I believe you're using the first method.
This is from what I can remember, so I hope it's correct.
It could also be somewhat obsfuscated by using an ODBC link or something. Another way to get it is to run SQL Profiler on the SQL Server to see the exact SQL being executed. Of course, this won't help you edit it but you'll know what it is doing.