Currently, I have a report on SSRS ( SQLServer 2008R2) and accept a invoice number as a parameter. The report will generate the information related to this invoice in 1 report. So, 1 invoice 1 report. If I need to generate 2 invoices, I need to run twice.
I would like to schedule it and generate reports automatically once the invoice appears in the database and save the output as PDF for each in a unique file name.
Just wonder what's the best option for me to do it
1) Use SSIS. Create a For..Loop to execute a SQL statement to return all invoices that fulfills the criteria and then call SSRS report.
2) In SSRS, there's a subscribe option but I can't find any way I can pass in the parameter automatically and for multiple times. Or some configuration that I missed out ?
Hope you can provide me some ideas. Thanks.
both 1 and 2 would work. To me, I think 2 is better.
2) In SSRS, there's a subscribe option but I can't find any way I can pass in the parameter automatically and for multiple times. Or some configuration that I missed out ?
I found this on Microsoft site which covers how to pass in parameter value to report. Hope it is helpful.
https://msdn.microsoft.com/en-us/library/ms166561(v=sql.105).aspx
Related
I am trying to restrict what users can view based on the branch that they work in. I have it working on my main report but I want to pass the branch parameter from my main report to a drillthrough subreport. How can I do this in Report Builder 3.0? Thank you.
You can pass the parameter via the url.
Example:
http://myrshost/ReportServer?/AdventureWorks 2008R2/Employee_Sales_Summary_2008R2&ReportMonth=3&ReportYear=2008
Here we're passing the report parameter ReportMonth the value 3 and ReportYear with 2008
An alternative to using a URL, you'd need the same parameters in both reports.
Go to the properties of where you want the drill-through to occur.
Go to Action
Select 'Go to Report', specify the report directory (this can be flat files or via the report server). Think this can also be a URL but I am not certain.
Select 'Add'. In the Name field, you want to put the parameter name of the parameter in the drill-through report, in the 'Value' field you want to enter the parameter of the report that you're currently in.
If you don't want the user changing this parameter, in the drill-through report, you can simply hide this parameter in the drill-through report.
This is by far the easiest way of doing what you require I believe. Hope this helps if you're still struggling.
I'm new to SQL queries and need to build a custom report in Microsoft SQL Report Builder 3.0. The data source is a SCCM database. I need help with understanding the best approach to achieve the following:
We need to cross reference if a computer exist in two Views, if so show that name in the report.
InputParameter1 = "Please select a View"
InputParameter2 = "Cross reference with this other View"
If I know the names of the Views beforehand I have a query to get what I need from the SQL server, but I need to create a parameter-based report where you select two Views dynamically and the report cross reference them for you and present which computers exists in both Views.
This is the query I can use for a static result. v_CM_RES_COLL_CMS0020B and v_CM_RES_COLL_CMS000D1 are examples of names of possible Views, until I can solve the parameter issue in Report Builder:
SELECT v_GS_SYSTEM.Name0
FROM v_GS_SYSTEM
WHERE Name0 IN
(SELECT Name from v_CM_RES_COLL_CMS0020B)
AND Name0 IN
(SELECT Name from v_CM_RES_COLL_CMS000D1)
I don't know how to proceed in how to make the above query into a parameter report in Report Builder. Somehow I need to change v_M_RES_COL_CMS00### to what ever the user inputs to the parameters. Does anyone know how? Any help is greatly appreciated.
I am working in Visual Studio 2013 and SQL Server 2008 R2.
A really long Expression [60-70 IIF's] is in a calculated field that is used in about 35 Reports. The Calculated Field expression matches a value from the Data Row [coming in from T_SQL] and designates a 'Group Name' for the row.
Example Data:
ID Prod_Num Amount
1 123 15
2 234 20
3 345 25
Example Expression (pseudo code):
IIF (Prod_Num = '123', 'Shirts',
IIF Prod_Num = '234', 'Pants',
IIF Prod_Num = '345', 'Socks', 'Other')
Problem is when the Prod_Num list is added to or modified - the changes have to be made in all reports.
What would be a good way to have all this in one place - so that when there are changes, they only need to be made in that one place.
I don't have Create Table rights on the DB and I don't know if that is even an option - though if I DID have the rights, I would put all the Prod_Nums and Categories (Shirts . . . Pants . . .) into a Table and then just do the work in the SQL for the report.
I thought of a T_SQL Function but some of the Reports use a Linked Server to pull data from a Progress DB . . . and I don't know how that would work with a SQL Server Function??
I'd appreciate any help/suggestions.
Thanks!
You can put your expression into a function in a Custom Code Assembly in SSRS.
Then you add that assembly to all the reports that need it, and all you have to do on each report is call that function in an expression.
By the way, you should be using Visual Studio 2008 to build reports for SSRS 2008R2. Reports built in VS2013 are not guaranteed to work on SSRS 2008R2.
You will have the same issue wherever you place this logic if you are not enforcing the relationship in your data, i.e. creating a type table for your products.
The only leverage you can gain is to move the hardcodes from many locations to just one so that when you do update a table(s), you can clearly document one other location that must also be updated. Here are a few examples :
As Tab Allerman pointed out, create a class function inside an assembly and embed that assembly into each report. You then just update the server with a new assembly when your choices change.
Create a custom SP in a database that every report will have access to, even if it is not your report's main database. (You can create multiple data sources in a report.)
Use a web service as a data source for your reports and put the types in one location this way.
Use an xml document as a data source for your reports and put the types in one location this way.
Ask the person(s) maintaining the database why the heck the products are not typified.
My RDL file contain 10 different ds, dataset1... dataset10.
On document I am only using dataset1...dataset5 and rest are obsolete (dataset5 to dataset10)
Report is doing fine but having performance issue as dataset5 to dataset10 are unnecessary loading with the report. I have client requirement not to delete them ,he wanted keep the old logic.
Is there any way in SSRS where we can disable or deactivate these datasets not to load.
Please help me to this. Thanks .
vd
Why not just make a copy of the current report, then delete the unneeded datasets in the present version? That way you'll have a retrievable record of the old report and its datasets without having to deploy it to the reporting server. Just click on the report in the solution explorer, then press ctrl+c and ctrl+v.
For the moment, you can use a hidden parameter with a default value (say "1") and use that parameter in the obsolete datasets.
dataset5
select
code here
where #parameter <> 1
I'm writting a SSRS Report using sql server and I have the following problem
I need 2 details in my report
Detail 1 - is generated by a Stored Procedure that get the set of data from differents tables.
Detail 2 - I had a different stored procedure to get my datase for this detail but I need to show only those rows there are not in a Detail 1.
I tried to use filter referencing a different dataset but this doesn't work...
Can someone an idea of how can I do that?
thanks
#Eliana: Here i am little confused with Detail 1 and Detail 2:
If you have any operation that can be done in SQL try resolving in SQL stored procedures only as the query processing is fast. After that you can use the SSRS report to just display the records based on some parameter.
It's my personal experince for improving performance of the report.
Please share some sample input/output you want to display.