Using a username/AD group name as a Crystal Report Parameter on BusinessObjects - crystal-reports

I've got a parametrized report built with Crystal running on a BusinessObjects server.
I would like to get the report to auto-populate the location parameter based on the user name or Active Directory group name.
How do I implement this logic? Ideally I'd have a lookup in the report itself going if AD Group= Kansas Workers then parameter=Kansas...
Looking for any solution that will not require me creating a separate report for every location and placing them in different folders on BO....

Related

Crystal Reports dynamic parameter

In Crystal Reports 2020, I have a dynamic parameter. Since there can be 100000's of values, the user does not want to scroll through all of them,but wants an option to enter the value in a search box (like when we set Static parameter) and then add it to Selected Values box.
Is it possible?
Here is the relevant portion of a KnowledgeBase Article:
https://userapps.support.sap.com/sap/support/knowledge/en/1381361
SAP Knowledge Base Article - Public
1381361 - Dynamic Parameter List of Values are displayed in batches in Crystal Reports and in SAP BI LaunchPad
Symptom
How to change the batch size?
Crystal Reports dynamic prompt list of values are displayed in blocks of values. How to change the number of values per block?
Dynamic Parameter Lists of Values are displayed in a list of pages, is there any way to change the number of values displayed per page?
When refreshing a report in Crystal Reports, or in SAP BI LaunchPad, Dynamic Parameter shows the List of values in batches, how to display the List of Values in one single list instead of multiple groups?
Environment
SAP Crystal Reports 2013
SAP Crystal Reports 2016
SAP Crystal Reports 2020
SAP BusinessObjects Business Intelligence Platform 4.1
SAP BusinessObjects Business Intelligence Platform 4.2
SAP BusinessObjects Business Intelligence Platform 4.3
Reproducing the Issue
In Crystal Reports designer, create a report off any data source.
Create a a Dynamic Parameter, and add it to the report.
Save the report to the SAP BusinessObjects Enterprise Repository.
Refresh the report in Crystal Reports, or in SAP BI LaunchPad.
When prompted by the parameter, notice that not all values displayed in one list, it displays in multiple batch.
How to only show one list with all the values?
Cause
Large list of values for dynamic parameter are displayed in batch of 200 values.
Resolution
There is no option to turn off the functionality of displaying dynamic parameter list of values in batch, but it is possible to increase the number of values per batch by modifying the following options:
For Crystal Reports: PromptingLOVBatchSize
For the SAP BusinessObjects Business Intelligence Platform: crystal_max_number_list_of_values
Therefore, to display all the values in one batch, increase the value of the batch to be greater than the maximum number of values you expect for your largest list of values.
WARNING The following resolution involves editing the Microsoft Registry. Using the Microsoft Registry Editor incorrectly can cause serious problems. Use the Microsoft Registry Editor at your own risk. For more information see the SAP Knowledge Base Article 1323322
For Crystal Reports designer:
Close the Crystal Reports designer.
Open the Microsoft Registry Editor. ( regedit )
In the Microsoft Registry Editor, navigate to the following path:
HKEY_CURRENT_USER\Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\ReportView
Modify the value for the option: PromptingLOVBatchSize from the default value of 200, to a greater value like: 5000

Crystal Reports: export datasource with report definition

I am stepping into a new reporting environment and I don't have a lot of background info yet. But my company utilizes a series of crystal reports.
I want to compare two reports that are identical except that they connect to different data sources. I can click on both reports in the Crystal Reports viewer, go to Database > Set Database Location and I am able to see the data source. If I do this for both reports in question, I can see that they both connect to different data sources, as expected.
However, when I export the two Crystal Reports as text files and then compare them using Notepad++, I don't see the datasource / connection string in the report files, so when I do a compare, they are exactly the same.
If the exported text files are exactly the same, how does Crystal Reports Viewer know to point one report towards a prod data source and another report towards the dev data source? It does not appear to be embedded in the exported metadata / report definition file.
Thank you!!
The connection info is simply not part of the exported report definition text.
But, obviously, it is part of the report definition.
If you need to export more detailed report definition information, including connection properties, consider getting a documentation utility. Ken Hamady maintains a list of those here.

Export SSRS report from SQL 2014 using powershell

I want to automate the generation of a report from SSRS, export the report to csv and then use this data elsewhere. I have done some research and it appears that newer version of SSRS has exposed API to facilitate this. I would like to know if its possible to get the output of a SSRS report in csv using powershell or other methods.
The best way to automate report generation is to set a report subscription in SSRS which will run the report on a user-defined schedule. You can define the output format (CSV in your case), report parameters, and an output location.
The easiest way to create a report subscription is through the Reporting Services web portal.
PowerShell does have a cmdlet New-RsSubscription but you can't create a data-driven subscription this way.

How to avoid blank report export to Excel in SSRS 2008 r2?

Hi I developed one report which is taking parameters dynamically with help of Data driven subscription.
but when I did subscription it is exporting all users reports into Excel and keeping it into windows file share folder.
here my issue is my client doesn't want the report if report is empty for a particular user.
but I have to fix this issue in SSRS itself instead of doing changes in Procedure (database) level.
i used the below expression in SP Level
i.e
if(##rowcoun>0)
raiserror("nodata",16,1)
Note: but the same procedure is using for multiple purpose and my db developer is not accepting to do changes in SP levle.
in reports level i am using the below expression to hide the column headers if report is empty
iif(countrows()>0,"true","false")
but the above expression showing blank report and it is exporting empty excel sheet for the user.
Thanks in advance
Since you are already using a Data Driven Subscription, what you need to do is edit the subscription query so that it creates a list of recipient emails based on those with data. The way I do this is to join the table of recipients with the dataset to be returned.

SSRS Dynamic Filenames for Email Subscriptions

We are in the process of migrating our reports from Crystal Reports to SSRS. In Crystal Reports we use variables to dynamically generate our filenames so when the report gets sent out via email, the file has the report name and execution date. (e.g. MonthlyReport09-07-2012.xls).
Is this possible in SSRS? I don't see any straightforward approach to using variables in the filename when subscribing to a report. This could prove troublesome when sending multiple reports with the same filename to the same person because it would be difficult to discern which report is which.
Any help is greatly appreciated. Thank you SO.
There is no feature in SSRS as such but there is a work around for this. You have two options
Option 1:
Instead of emailing it directly first dump the file in fileshare location which can be something like \machine-name\ExportReports\ReportName\ then create a windows job which renames the file to the format you want and emails it in the next step.
Option 2:
Refer to this blog what you want starts from section "Generate a PDF output file programmatically" now you can use this in an assembly then have some scheduling mechanism which picks up the schedule. This then calls the DLL which generates the report and emails it.
Use #timestamp in the name of the file and it will translate at run time.
You cannot specify the report filename in a standard subscription in Reporting Services.
If you have Enterprise edition (or SQL 2012 Business Intelligence edition) you can use the Data-Driven Subscriptions features that allows you to specify the report filename (and other properties) based on data retrieved from a table.
If you have Standard edition, then your options are either of the ones suggested by Bhupendra, or you could look at scripting the report generation using the "rs.exe" utility supplied with Reporting Services and use Database Mail and SQL Server Agent to handle the emailing and scheduling.
This post looks pretty old , but better late then never ...
There are some tools on the market , which can run SSRS reports : CRD, R-Tag and RemiWare
These are Desktop tools but I guess you are not looking to replace SSRS , just to extend it.
I am not sure about the CRD and RemiWare , but R-Tag supports data driven reports and dynamic names. It also can be used with Standard license.
I was able to automate the emailing and change the file name by looping thru a table of accounts, invoices and emails, then setting the parameters and renaming the reportname and pathname in catalog be execution at the end of the after the execution I did a wait for 2 seconds then when to the next loop. I the end I set the path and name back to orginalname. Performed well.
#timestamp works for Windows File Share as answered by Chris.
For Email deliveries, you could use:
#ReportName -specifies the name of the report.
#ExecutionTime - specifies when the report was executed.
For more details- MS Docs
You can do this by changing the filename directly from the table [ReportServer].[dbo].[Catalog]
Make sure to add a forward slash to the Path
For e.g. I created a SQL Job that ran every night before the report and added the date to the filename.
Sample Job (replace [ItemID] corresponding to your Report):
DECLARE #PREFIX CHAR(25) = 'REPORT_NAME_';
DECLARE #SUFFIX CHAR(8) = CONVERT(CHAR(8),GETDATE(),112);
DECLARE #VARNAME CHAR(33) = CONCAT(#PREFIX,#SUFFIX);
DECLARE #VARPATH CHAR(34) = CONCAT('/',#PREFIX,#SUFFIX);
UPDATE [ReportServer].[dbo].[Catalog]
SET
[Name] = #VARNAME,
[Path] = #VARPATH
WHERE [ItemID]='63D051EE-3139-4F50-ADBB-1C944F3D5D47';