Check if another Report exists before launching it - reporting-services

The Map polygon Action can launch another Report.
Is there a way to check that a particular report actually exists before blindly trying to launch it?
This would allow re-direction to an 'Oops!' dummy report instead of it erroring.

You can query the ReportServer database directly (It is called ReportServer by default, though this can be different).
All of your SSRS items - from reports to subscriptions - are held in here somewhere. If you want to check for a report, you can search the Catalog table on both Path and Name.
If you can build a dataset of the reports you want to link to, you can then replace the ones that have no match in Catalog with a link to your Oops! report.

Related

Adding SSRS report through CRM2016: Prefiltering doesn't work?

I've created a custom Reporting Services report from within Visual Studio that is intended to use automatic prefiltering as described here.
So, I've created my query as follows:
select fullname, createdbyname, createdon
from FilteredContact as CRMAF_FilteredContact
order by createdon desc
However, once I add a new Report in CRM based on the report's .rdl file (as described under "Deploying the Report" here) it adds the report fine, but two things happen:
1) The shared data source for this report is initally invalid, both CRM and SSRS refuse to render it with the error:
"The report server cannot process the report or shared dataset. The shared data source 'MyOrg_MSCRM' for the report server or SharePoint site is not valid. Browse to the server or site and select a shared data source. (rsInvalidDataSourceReference)"
I have to manually set the DataSource from within SSRS to /MyOrg_MSCRM/CustomReports/MSCRM_DataSource to get it to work.
2) The report doesn't appear under "Run on Selected records" but under "Run on All Records", and doesn't perform any prefiltering.
Also, when I download the .rdl from SSRS it hasn't modified it, neither adding an extra parameter or changing the SQL query. as I would have expected based on this information.
What could I be doing wrong?
I'm using MS CRM 2016 update 1 (v8.1.0.359) on premise, with SQL Server 2014 Reporting Services and the SRS Data Connector installed on the same machine.
Apparently, you can use a shared data source reference, but you have to name it MSCRM_DataSource, just as the Data Source that MSCRM uses for its reports.
If you upload a Report in MSCRM like this, MSCRM recognizes this and automatically updates the data source to the valid /MyOrg_MSCRM/CustomReports/MSCRM_DataSource datasource, and also adds the prefiltering modifications.
You've created a Shared Data Source that you are using for multiple reports. When uploading reports through CRM this is not supported. Each report must have its own connection details embedded in the report.
I think the reason for this is, as you are trying to do, the report gets modified to add hidden CRM parameters and to alter the queries so that pre-filtering can take place.
To fix this, you have to modify each report and enter the Connection Details directly into the report rather than using a Shared Connection. Its a little annoying but should give you the results you are expecting to see

Error after renaming SSRS linked report names

I have changed the SSRS report names in my reporting server projects. I have four reports and four linked reports in this projects. The linked reports are being called by an action setup on a column value where the parameters are being passed to the linked reports. After renaming all the report names I have made similar changes in the Action property in order direct the parameters to the changed report name. I have also saved the changes and re-built the project and have not got any errors. All the four main reports are working fine but the linked reports are trowing the following error while running the reports using preview options in MS Visual Studio 2010
An error occurred during local report processing. Object reference not set to an instance of an object.
I have deployed this to my local report server and on browser I getting the following error
The item '/Unit Reports/OLDREPORTNAME' cannot be found. (rsItemNotFound)
Here you can see that it is still trying to locate it to the old report name not the new changed one.
I have clean, built and deployed the project several times but still getting these errors
Please let me know if I need to make changes in any other files to avoid this error.
Thanks
Within the .rdl search for "OLDREPORTNAME" and replace with "NEWREPORTNAME"...
Take a backup first :-)
I have noticed that when I implement the Action property on the report field, it automatically set-up the same Action property of that text box where the field was defined.
I have found that the text box Action property was still pointing to the old report. I have changed text box Action property to point it to the new report and now my linked reports are working absolutely fine.
Thanks
Yogesh

How can the CustomerRef field from SalesTable be added to the CustAccountStatementExt report?

In Microsoft Dynamics Ax2012 R2 I want a customization for report CustAccountStatementExt by adding the field CustomerRef from SalesTable
Location of report in the AOT :
SSRS Reports\Reports\CustAccountStatementExt
You have to open Visual studio 2010 (only supported version for AX 2012 R2) and open this repot from Application Explorer (View -> Application Explorer Ctrl+D,Enter).
MSDN:
Walkthrough: Customizing Existing Microsoft Dynamics AX Reports
How to: Customize a Report
Visual Studio Tools for AX must be installed from the AX Setup.
In addition to Matej's answer (which only covers the customization of the report layout) you also have to make the field available in the report data source. To do that you have to add a new field to table CustAccountStatementExtTmp that will hold the value of the CustomerRef field from table SalesTable.
You will also have to customize the creation of the CustAccountStatementExtTmp records which in this case is surprisingly done in the report controller class CustAccountStatementExtController (usually the report tables are filled in the data provider class). This will require some work, because you have no direct way to access the SalesTable record there. Basically you have to figure out how to determine the sales order from the CustTrans record that is available there.
After that, you still have to customize CustAccountStatementExtDP.insertNewRecords method because for some reason the records are copied from one instance of the (temporary) table CustAccountStatementExtTmp to another.
After that the new field should show up in the data set of the report in Visual Studio and you can then include it in the report layout (see Matej's answer on how to do that).
Here are the steps I followed to accomplish this:
Add field to the CustAccountStatementExtTmp table
Add code to CustAccountStatementExtController.insertCustAccountStatementExtTmp method to populate the new field.
Refresh the data source in the SSRS report, and in the report design (and then re-open the design).
Add the field to the report
At this point I also had to restart the AOS before the data would appear on the report. Apparently there was something cached in memory that prevented it from working.

SSRS report flashes but won't show anything on report server

I have a report to modify on SSRS (just to add a new column for the table that was created using a custom code function). The table was created using natural key and create "case". I added the natural column for the keys and when I previewed it in SSRS, everything looked perfect! However, when I uploaded it to the server, the report can only select partial selections from a drill-down field/widget. If I choose "select all" for the parameters, it flashes then nothing happens (neither an error message nor data is shown).
It was running fine and I was able to select all the selections for the report in Visual Studio and even extract it in Excel. I thought it was a credential problem, so I used my ID and password for the credentials, but it still did not work.
I tried to deploy the original report that was downloaded from the server, but it wasn't working (even without any changes).
Thank you.

Debug.rdl file not found error in SSRS

I have a master report let's say 'Master' which is linked to subreport 'Child'. I can drill through a link provided on Master report to the Child report & vice versa.
The problem is that, I can play with drill through only twice. At the next time, when I click on back button image, which I provided in my Child report, it shows me following error.
An error occured during local report processing.
Error in the application.
Could not find file 'C:\...\bin\Debug.rdl'
The Debug.rdl file does not exists in my solution as I haven't created it.
Thanks.
Yes. Solved it.
The proble was in the action attribute --> go to report --> specify report I had used one expression which was generating parent report name.
So when I clicked on master report link, it was taking me to child report with the expression generating master report name in the child report.
But when the expression due to some fault or any error was not able generate master report name, the child report was not able to take me to the master report using << go Back link. Rather it was showing me error like Debug.rdl file not found.
Still question remaining is why Debug.rdl ?