Crystal Reports through stored procedure - sql

i try to create crystal reports in vs08 using sqlserver2008r2 and here first when i start to create reports i add new item and click on dataset then create tables then after this i add item crystal reports and then call this tables in ado.net
like this in dataset and its very long
this seems where long procedure .. i want to create reports through store procedures can here anyone tell me what i can do for this?

1.create a SP that rerurns data.
2.create a Crystal report with a Datasource, select your SP from the datasource.
3.now your database fields will appear in field explorer.
4.use those fields to display

Related

Create dynamic report in Access 2003 from SQL Stored Procedure

I have to create a report in MS Access 2003 that shows data from sql stored procedure. Stored procedure returns data in table matrix. This report will create columns at the run time as column names are not predefined. How can I
Call this stored procedure from the MS Access report?
Create columns in the report at run time?
Thank you.
Create a Pass-Through query that calls the SP, and use that as record source for the report.
The usual way is to create enough columns in the report, and then show/hide them as you need (.Visible property).

Executing stored procedure using .dbml file LINQ

Using VS 2013 (VB) and SQL Server 2012.
I execute a stored procedure to populate a gridview using linq.
Dim db As New GMConnectionDataContext
Dim gasHedges = db.GasHedges_create2ndMonth.ToList
The stored procedure returns a result set and has been working fine as in it returns the expected result and the gridview displays as desired.
I added some data to my SQL table and loaded the web page and the new data does not show. IF I execute the stored procedure in SQL Server the new data shows. If I execute the stored procedure in VS the new data shows.
Now the weird bit. If I delete the reference to the stored procedure from the .dbml file then re-add it the new data shows when the page is loaded. I know that when using this file if I add columns to a table then I need to delete it and re-add the table to the .dbml file.
Surely the same isn't the case with stored procedures as they would be unusable. Is there something I am missing?
UPDATED
I think I know why this happening but I don't know how to fix it. The SQL result set has dynamic columns as I use the pivot command in SQL. This means that if a user creates a new Gas company the result set will have another column and the datacontext must interpret that as the SP having changed and still shows the old dataset. This does mean I cannot just delete the SP from the datacontext and re-add it as the web application needs to handle if the user adds another company.
Any changes you make in SQL server are not auto-synched to your .dbml file. If you make table or stored procedure changes you need to delete them from the .dbml file and add them again.
Best practices would dictate that you don't pivot your data in SQL. Pivotting data is not a data related issue; it's presentation and should be done in the presentation layer -- in the application.

how to create a view using a command or results of a command in Crystal Reports

I have SQL query which I can use as a 'command' to add data to my existing table in SAP Crystal Reports 2013. However I am looking to use the command to create a View which I will like to join to my original table rather. It makes the report run faster than the former.
Therefore please can someone guide me on how to create a view in SAP 2013 either by using a SQL command or the results of an existing report?

Automatic parameter generation from Stored Procedure SSRS 2005

I have a ssrs 2005 report that has a stored procedure on sql server 2005 as its datasource.
At first, the sp had no parameters, it just returned values.
The sp changed now, a lot of parameters were added.
Now i need to add report parameters for the report, and bind them to the sp parameters
Is there a way for the report to automaticaly generate the parameters and bind them to the sp parameters ?
Usually, When you look in the DATA tab in the RDL design, you can see the datasets that your report uses.
In there, there's a refresh icon that refresh the information from the procedure.
After the procedure has changed, you need to refresh the RDL's dataset.
Once you refresh the dataset, the parameters should be added automatically.

How To use a stored procedure in a crystal reports 8.5?

I have to make a new report using crystal report8.5 .
I have created a stored procedure in SQL Server 2005. The stored procedure has one input parameter.
Now I wanna to know that how I can add that stored procedure and show its result in my report
while designing that report?
thank you
First go to File > Options > Database (going from memory) and make sure the checkbox for Stored Procedures is ticked. Then, when you setup your connection to SQL Server, as well as a Tables section you'll see a Stored Procedures one beneath it. Find your stored procedure in the list, add it as the data source for your report, and you'll be able to use it as a normal source.