Visual Studio 2012
Silverlight 5 with RIA/Entity Framework
Solution has 4 projects: Web Project, Silverlight Project, Data Project (where model is located), and Reporting Project
I was able to create a report that works just fine with the Entity Framework using both a table and a stored procedure with no parameters. However as soon as I add on with just one parameter it fails when trying to compile the project/solution:
Invalid Resx file. Type could not be read from the data in line 145, position 5. The type's internal structure may have changed. Either implement ISerializable on the type or provide a type converter that can provide a more reliable conversion format, such as text or an array of bytes. The conversion exception was: The constructor to deserialize an object of type 'System.RuntimeType' was not found.
- New Report
- Add New Data Source
- Entity Data Source
- Choose an existing connection (same connection that works in my reports without SP's with parameters)
- Choose an object context (same as above)
- I then get a list of all of my tables in the model as well as all of the procedures. I choose a test procedure with one integer parameter
- In the Configure Data Source Parameters I have tried several different options. For now I am choosing a hard coded value of 1.
- For design time parameters I am also giving it a 1.
- Clicking finish takes me to the screen to choose data sources but now I have the one I created selected and I can see the 4 output fields. I choose next.
- Standard Report
- Choose at least one field for the detail section
- Stepped Layout
- Normal Style Sheets and then Finish
- I am taken to the report designer where I can see my fields.
- As soon as I click the preview tab the solution tries to build and gives the error.
I have tried changing the hard coded value to a parameter and used the following code:
But it doesn't seem to matter, I still get the same error. Any ideas?
14 Answers, 1 is accepted
We are aware of the issue and it is now logged into our systems. It can be observed only in Visual Studio 2012. You can rest assured that we are investigating it and it will be fixed for a subsequent version of Telerik Reporting. For the time being you can use the ObjectDataSource instead (Select the context as DataSource and the needed data retrieval method as DataMember). We apologize for the temporary inconvenience.
the Telerik team
So I tried to use the ObjectDataSource and I am having limited success. I have an object that is used in the application to retrieve data from stored procedures. I can connect using that object and browse the methods available. When I pick the one I want, it does prompt me to add parameters. I tried that and ended up getting a message that the parameters were not populated. So I backtracked and just tried to use hard coded values. While the solution compiles, the report shows me no records. It is almost like it executed the procedure and didn't pass in any values.
Any clues on how to proceed?
Thank you for the valuable input - we will investigate further on our end since we were not able to reproduce the issue with Visual Studio 2010.
Regarding the usage of ObjectDataSource - the only drawback when using it instead of EntityDataSource is the fact that you will not have design time support (i.e. you will not be able to preview the report and will not have the Fields node populated with data). However at runtime everything should be the same and you will not have to actually change your code.
Since you are having issues with this workaround it will be best if you open a support ticket and attach a runnable sample that exhibits them so that we are able to reproduce it at our end - that way we will be able to identify the culprit faster and advise you more accordingly.
Another workaround for your current issue would be to delete the serialized metadata in the resx file each time the build fails. To do so just open the resx file of the respective report, locate the snippet that looks like this and delete it:
Also if you are following our best practices you will have your reports in a separate class library, which means that you will have to rebuild only a single project.
the Telerik team
Each time I test, I am removing the existing datasource from my report. I already have 7 parameters defined and setup with the proper datatype so I usually don't remove them. I start by connecting to the datasource and in each case I end up at the screen where I can define parameters. The EntityDataSource will also allow me to select default values. If I am using the EntityDataSource, each time I view the parameters I then have to go into the resx file and remove the metadata. I can then preview the report and it will show me the headers and zero's for the totals for group and report.
I then try to run the application and I as the report is generating, I am watching the impact on the SQL Server via Profiler. I can see that it never makes an attempt to hit the database. When I do these same steps, but use a stored procedure without parameters, it skips the screen where you can add paramters. It also displays the data in both designtime (EntityDataSource) and runtime (both).
So what am I missing on the parameters? I don't care if I use ObjectDataSource or EntityDataSource. I do not have any code in the code behind of the report. I can see some examples in the documentation where instead of using the wizards to retrieve the data, it is done in code behind. I would like to try that as well, but I am not sure where to put the code? Maybe there is some event I need to hook into?
Test #1 - This time I created one using the same datasource with EntityDataSource and I stayed away from parameters all together. I was actually able to get data back.
Test #2 - Then I created yet another eport with the same datasource. This time I included parameters. I have them the same defaults that I used for the hard coded values in the last test. But after I removed the metadata from the resx file, when I go to preview it tells me Missing or invalid parameter value. Please input valid data for all parameters. I think it might be related to the metadata that I have to remove to get it to function correctly since it said something about defaults.
Test #3 - I then realized that there was a way to set defaults in a different place. From the designer I can right click and choose report parameters. Each parameter has a default that I can populate. After visiting this screen, I had to remove the resx metadata. Doing this I was able to get the report to preview WITH DATA.
This leaves me with a few questions. #1, does this mean there is something else that is broken in my report definition? I spent a few hours trying to get everything lined up perfectly. If there is any way to salvage that work, I would be happy. And #2, if I proceed with the way I did things in Test #3, will that work? Will I be able to pass in parameters from my silverlight application still?
We are sorry for the inconvenience caused by the problematic design time parameters of the EntityDataSource.
Regarding your questions - if you are not able to connect to your database at all the reason almost definitely lies in your code, since the data sources (and especially the ObjectDataSource) have been tested by us and used by many customers. Also if you proceed as you did in test 3 you will be able to pass parameters without a problem. However that would require (as mentioned in the previous post) you to delete the default values from the resx files before each build. That way you will be able to preview the report and it also will work in runtime; the limitation is that the Fields node will not be populated with data.
the Telerik team
What's the status of this issue? I don't like the suggested workaround and would like to work as should with stored procedures including parameters.
Will there be an update soon as this is blocking our development process.
Can you please describe your issue with more details since in the previous posts multiple issues and workarounds have been discussed. In general it would be best if you are able to provide us with more information about your project -this will help us advise you accordingly. Do you use ObjectDatasoure or EntityDataSource? Are you experiencing difficulties with connecting to your data or when you are building the project? Do you use parameters for the data sources? Are your reports placed in an ASP.NET application? Any other relevant data will be highly appreciated.
All the best,
the Telerik team
I’m developing a Silverlight OOB application using the 2012Q3 components. I have a MS SQL Server 2008R2 stored procedure which has two parameters (datatype = ‘date’). The stored procedure is imported in the Entity Model in the web part of the Silverlight application.
I’m adding a new report, using the Wizard. By using an ‘Entity Data Source’ I’m able to connect to the stored procedure. I can select the fields, use a group, …
But, as soon as I try to compile (or preview the report) I’m having the same issue as the person who started this thread (unable to compile).
My question: when will I be able to use the report and a parameterized query without having to use a workaround? I know I can for instance write the data from the stored procedure to a table, and connect to the table instead of connecting to the stored procedure.
But, I just would like to use Telerik Reports without any workarounds, as should. Why am I unable to compile the project and when will this be solved?
Thank you very much for your input.
The issue you are having is fixed in Q3 SP1 - you can check our release notes for more information. Just upgrade to a later version and your issue will be fixed.
the Telerik team
See what's new in Telerik Reporting Q1 2013. Register for the March 4 webinar to witness the impressive new visualizations in Telerik Reporting. Just for fun, 10 webinar attendees will be randomly selected to win a Telerik T-shirt and a $50 Gift Certificate to ThinkGeek. Register now! Seats are limited!
The issue is solved after installing Q3 SP1.
Thank you for your help.