Automatic update of fields with SSRS - reporting-services

I'm currently working on a Java Project to generate the XML of an SSRS Report, without using Report Builder (this project writes the XML of a report to an .rdl file).
I'm stuck on the Datasets part of my project. I provide a query to my Dataset and when I open my report, my Dataset is created but the fields are not displayed.
And When I execute my report, I have an error that tells me a problem with my DataSet.
This error means "An error occured during local report processing".
The solution I found is to go to "properties of the dataset" and click on "Refresh fields".
"Actualiser les champs" means "Refresh Fields".
The list of fields is displayed and I can run my report without any problem.
So I wanted to know if it was possible to have the fields update automatically without going through the properties of the DataSet and without the action of the user ?
I have already tried to edit the "AutoRefresh" value of the report, without success.
Is there an option to make this happen or some way to run the script behind the button ?
P.S : I need to generate a hundred of Dataset, so my click on "refresh fields" of each Dataset is not viable.
Thank you for any help you can give me.

Related

An attempt was made to set a report parameter 'ABC_PrintCopyOriginal_TH' that is not defined in this report

I'm getting the error: "An attempt was made to set a report parameter 'ABC_PrintCopyOriginal_TH"' that is not defined in this report. when I try to view my reports in a web browser. I'm executing this reports through a menu with button code. When the page comes up I get the error.
I have added manually ABC_PrintCopyOriginal_TH in parameter level report design. this ABC_PrintCopyOriginal_TH was enum which I used to print filter expression based on menu item button. eg: when click on original menu button it needs to print original on report design if etc copy button wise versa....
Can you please help me how to resolve this?
Are you using an SSRS Reporting server to host your reports? If so, have you deployed the report and tried restarting the Reporting server after the changes?
What editor are you using to edit the .rdl files?
If deploying and restarting the server doesn't help there is probably a typo in your .rdl file somewhere since you manually add stuff. Try using Report Builder and check if that gives you more info about the issue.

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

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.

SSRS Dataset Field Refresh not updating for Tablix

I have updated the SP for the attached dataset that the tablix is using. The refresh worked fine and I can see my new fields in the shared data set when I look in the Fields tab. My problem is the tablix itself is not giving me access to the new fields. There is a disconnect somewhere and I cannot figure out hot to get the tablix to see the updated fields available in the dataset. I run into this problem frequently and hope I can get a good answer here to return to in the future as I am sure I will need to. I have googled and looked through the suggested questions here and I cannot find one that is directly related to this issue.
I will also know note that the report project is in TFS source control as I read that has some adverse side affects. I have marked the whole project for edit and also went to the folder structure and made sure everything was unset to read only.
I am using SSRS 2008 in VS 2010.
Just found it... I don't understand the need for hidden menus like this..
Click the report itself, then go up to View on the menu and at the very bottom there is "Report Data". From here you can select your dataset and go to its properties and refresh the reports attached dataset's fields. What a pain in the butt.
Here is a link that helps better explain it.
http://blog.dontpaniclabs.com/post/2012/01/26/Developings-Reports-for-SQL-Server-Reporting-Services
You can also delete the .data file if you still can't get it to refresh.
Go into the file folder where the .rdl file exists
Next to it, there should be a file with the same name with the
.rdl.data extensions. Delete this file.
It appears to force the refresh probably because it has to recreate the file.
Here's a less invasive way but may not always work:
In the Report Data windown, right click on you dataset and click
Dataset Properties like so:
Click Refresh Fields near the bottom right of the Dataset Properties
window:
After changing the Stored Procedure code, without changing the name and number of fields returned, I could only get the report to seemingly call the new format of the stored procedure by clicking the Refresh button in the report's Preview tab.
Go into your solution folder, where the rdl's are stored and delete .rdl.data file for your report.
Next time you'll run the report, new rdl.data file will be created and it will have all the new fields from the updated SP.
ok, this maybe an older thread, but I kept running into the same problem on occasion. The absolutely easiest way to fix this is adding the following line of code to the beginning of the stored procedure that produces your dataset for the report:
SET FMTONLY OFF;
Happy coding :)
I ran into a very similar issue:
Added a new field to an existing SQL table function
(With some difficulty) added the new field to the existing dataset in SSRS
Spent some time unsuccessfully trying to add the new fields to the table (tablix?) in design mode.
This didn't work for me so eventually I opened the particular report file [filename].rdl in a text editor and surprise surprise it was XML. It was easy enough to add the missing field manually, and visual studio then prompted me to refresh the report.
<DataSets>
<DataSet Name="DataSet1">
...
<Fields>
<!-- add new field at this level -->
<Field Name="[newfield]">
<DataField>Email</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
I am having exact same issue in VS 2012. The stored procedure used as a query will not allow to refresh fields. When the button is pressed nothing happens.
The only solution I found is to flip the Query Type to Text and provide the parameter values on the exec call to the SP.
Why do we have to put up with these obvious show stopper bugs?
Had the same issue and I was able to resolve it by renaming my dataset in properties, creating a new dataset with the original name, and then hitting the refresh button.
Old thread, but I ran into this using VS 2015 and SSMS 2016. I was certain it was an issue with VS. When I went back to SSMS and tried executing my stored procedure, however, I found that passing certain parameter values would cause the query to fail. Interestingly, I was able to ALTER the stored procedure without encountering any errors. (Perhaps because some combinations of parameters wouldn't result in a failure?)
Anyways, at the end of the day it was faulty coding in my sproc that was causing the fields in SSRS not to refresh. When I went back and corrected the issues with my code, everything worked as expected in VS.
I am working in Visual Studio 2015 and none of the above answers worked for me. If you are getting the data from a stored procedure, you need to open the .xsd file and right click on the data model. Select Configure, and the correct values from the procedure should appear on the right of the window.
Then refresh your dataset from the Report Data tab.
I had the same issue.
I installed SP1 so that .rdl.data file would get generated which inturn also fixed the data refresh issue.
Reference: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e2b199df-bc1b-4211-9110-85a0c63454b8/why-does-ssrs-not-create-a-rdldata-file-when-previewing-a-report?forum=sqlreportingservices
I was trying to use an ODBC driver for the datasource that connected ok, but wouldn't show Fields in VS 2015 SSRS report. I went back and used a datasource based on SQL Server driver (it's in the choices when designing a datasource) and it worked perfectly.
I had this same issue but the cause was different from the other answers at the time of this writing.
In my case, the stored procedure used as the data source was returning multiple data sets (due to some debugging code that I had left in there).
SSRS was "seeing" the fields in the first dataset, whereas I was expecting it to see the fields in the second dataset.
Removing the extraneous datasets fixed the issue and SSRS was able to see the fields that I intended.
Clearing reportviewer's datasources works for me.
this.(reportviewername).LocalReport.DataSources.Clear();
Open the Visual Studio 2008 reports solution
Open (double click) your report (.rpt file) on left pane
Press Ctrl + Alt + D to open the Report Data panel
Expand the DataSets folder
Find the report's main data set and right click the "DataSet Properties" menu
Click the "Refresh Fields" button on the popup window.
Deleting .data no work for me. Deleting Dataset and adding again worked. And I had previously configured VS/SSRS to NOT cache.
refresh and deleting .data did not work for me. So I just manually added the fields.

SSRS '08 Object reference not set to an instance of an object

Full error from Preview window in Visual Studio '08 (BIDS): "An error occurred during local report processing. Object reference not set to an instance of an object."
There are no further errors/warnings detailed in the Error List or Output windows.
Background: On this report I am using a table to display a sub-report [x] number of times, dependant on the number of related objects that exist in the SQL database. That is to say that the sub-report is set within one of the cells (the only cell) of the table, in a row that repeats for each item returned in a dataset.
Removing the sub-report allows the master report to compile and run, so I feel the issue is related to the arrangement of the sub-report. If the sub-report only displays once, then the master report compiles and runs fine, it is only when a second instance is required that the issue arises.
When testing the sub-report separately, it compiles and runs when given the parameters for each instance it is being asked to render from the master report. So I can rule out the idea that the data for the second instance is causing it to fail (in some div-by-0 type way).
Given the lack of detail from the error and that the sub-report works on it's own, I do not understand why this is happening.
Does anyone have any ideas for debugging or suggested solutions?
Thanks
Brian
tldr: Master report fails when a sub-report repeats more than once.
I figured out a solution. The sub-report is being passed 4 parameters, one of these had a value referring to the value a table-cell on the master report. Changing this parameter to be the value of the expression that was setting that table-cell fixed the issue. I have no idea why this is a solution, but it is.
In more detail: [table_cell_a] had an expression computing it's value.
[parameter_a] for the sub report was set as "=ReportItems("[table_cell_a]").Value", when I changed the expression for [parameter_a] to mirror the expression for [table_cell_a], everything worked again.
This is messed up, and I can't even begin to understand why it behaves like this. If [table_cell_a] was not being computed before the calls were made to the sub-reports, I could understand. But if that was the case, how come the report worked when there was only one sub-report?
If anyone can provide an explanation, I would be most grateful.
Brian
Brian,
I'm having a similar issue with charts imbedded in a Tablix. I found this article that seems to address the issue, although I have not gotten the server upgraded yet to actually test it:
http://support.microsoft.com/kb/2639301
Hope that helps.
G
I was getting the similar error after changing the names of reports in my project even though I changed all the updated report names in the Action property.
An error occurred during local report processing. Object reference not set to an instance of an object.
I found a solution by running the dataset of linked report providing the parameter values manually.
I am not sure what difference it made by running the dataset of linked report manually but it solved my problem and I am no longer getting this error.
Thanks
Yogi
Just sharing. In my case, it was not a sub-report. I had the same message when I was accessing a drill-through-report. Apparently, at the "Action: Go to report" > "Specify a report:", I have wrongly pasted the full name of the report with the extension. Removing the ".rdl" extension solved my problem.
Addendum: If the drill-through report name is part of an expression then the .rdl extension is necessary for it to work when hosted in SharePoint. That prevents it working in preview mode, as you've found. Solution is to code to avoid having to use an expression for the report name.
Copy the Dataset and Queries.
Create new report or copy paste Tablix to new report. You will not get the error again.
I had to remove the SubReport and add it again. Then it worked.
I had the same error when I changed the name of the report I drilled to. I did change the name in the action expression to the new name via the properties > Action > Go to Report > (...) > Expression, but that apparently didn't take. When I opened the text box > Properties dialog window instead of using the Properties pane, and changed the drilled to report name within that window, it solved my issue.