This is a migrated thread and some comments may be shown as answers.

Invalid Resx file when creating report with Stored Procedure

14 Answers 236 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 27 Oct 2012, 09:03 PM
Telerik Reporting 2012 Q3 internal build 1025
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.

I am creating a brand new report and using the wizard.  Here the the steps:

  • 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:

this.NeedDataSource += MyReport_NeedDataSource;
 
        private void MyReport_NeedDataSource(object sender, System.EventArgs e)
        {
            Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;
            this.entityDataSource1.Parameters["@accountID"].Value = report.Parameters["accountID"].Value;
            report.DataSource = this.entityDataSource1;
        }

But it doesn't seem to matter, I still get the same error.  Any ideas?

-Randy

14 Answers, 1 is accepted

Sort by
0
Randy
Top achievements
Rank 1
answered on 29 Oct 2012, 02:03 PM
Anyone?
0
Randy
Top achievements
Rank 1
answered on 30 Oct 2012, 11:20 PM
I was hoping someone from Telerik would answer this post.  I am completely stuck with no workaround.
0
IvanY
Telerik team
answered on 31 Oct 2012, 04:36 PM
Hello Randy,

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.

Greetings,
IvanY
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Randy
Top achievements
Rank 1
answered on 01 Nov 2012, 04:47 AM
I am having the same problem in VS 2010, so I don't think it is specific to 2012.

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?

-Randy
0
Randy
Top achievements
Rank 1
answered on 05 Nov 2012, 05:23 AM
Still trying to figure out what I need to do to get records on my report until a fix has been made to the EntityDataSource.

-Randy
0
IvanY
Telerik team
answered on 05 Nov 2012, 01:01 PM
Hello Randy,

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:
<metadata name="entityDataSource1.DefaultValues" mimetype="application/x-microsoft.net.object.binary.base64">
 <value>
  AAEAAAD/////AQAAAAAAAAAMAgAAAFhUZWxlcmlrLlJlcG9ydGluZywgVmVyc2lvbj02LjIuMTIuMTAy
  NSwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1hOWQ3OTgzZGZjYzI2MWJlDAMAAACnAVRl
  bGVyaWsuUmVwb3J0aW5nLCBWZXJzaW9uPTYuMi4xMi4xMDI1LCBDdWx0dXJlPW5ldXRyYWwsIFB1Ymxp
  Y0tleVRva2VuPWE5ZDc5ODNkZmNjMjYxYmVdXSwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3Vs
  dHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAA1VGVsZXJpay5S
  ZXBvcnRpbmcuT2JqZWN0RGF0YVNvdXJjZVBhcmFtZXRlckNvbGxlY3Rpb24BAAAAEkNvbGxlY3Rpb25g
  MStpdGVtcwROU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tUZWxlcmlrLlJlcG9ydGlu
  Zy5PYmplY3REYXRhU291cmNlUGFyYW1ldGVyAwAAAAIAAAAJBAAAAAUEAAAATlN5c3RlbS5Db2xsZWN0
  aW9ucy5HZW5lcmljLkxpc3RgMVtbVGVsZXJpay5SZXBvcnRpbmcuT2JqZWN0RGF0YVNvdXJjZVBhcmFt
  ZXRlcgMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAALVRlbGVyaWsuUmVwb3J0aW5nLk9iamVjdERh
  dGFTb3VyY2VQYXJhbWV0ZXJbXQIAAAAICAMAAAAJBQAAAAEAAAAEAAAABwUAAAAAAQAAAAQAAAAEK1Rl
  bGVyaWsuUmVwb3J0aW5nLk9iamVjdERhdGFTb3VyY2VQYXJhbWV0ZXICAAAACQYAAAANAwwHAAAASVN5
  c3RlbSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1
  YzU2MTkzNGUwODkFBgAAACtUZWxlcmlrLlJlcG9ydGluZy5PYmplY3REYXRhU291cmNlUGFyYW1ldGVy
  BAAAAAhkYXRhVHlwZRhEYXRhU291cmNlUGFyYW1ldGVyK25hbWUZRGF0YVNvdXJjZVBhcmFtZXRlcit2
  YWx1ZSNEYXRhU291cmNlUGFyYW1ldGVyK1Byb3BlcnR5Q2hhbmdlZAMBAgQSU3lzdGVtLlJ1bnRpbWVU
  eXBlMVN5c3RlbS5Db21wb25lbnRNb2RlbC5Qcm9wZXJ0eUNoYW5nZWRFdmVudEhhbmRsZXIHAAAAAgAA
  AAkIAAAABgkAAAAKZW1wbG95ZWVJRAoKBAgAAAASU3lzdGVtLlJ1bnRpbWVUeXBlAwAAAAREYXRhCVVu
  aXR5VHlwZQxBc3NlbWJseU5hbWUBAAEIBgoAAABuU3lzdGVtLk51bGxhYmxlYDFbW1N5c3RlbS5JbnQz
  MiwgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tl
  bj1iNzdhNWM1NjE5MzRlMDg5XV0EAAAABgsAAABLbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3Vs
  dHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5Cw==
 </value>
</metadata>

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. 

Greetings,
IvanY
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Randy
Top achievements
Rank 1
answered on 06 Nov 2012, 03:58 AM
Manually removing the data from the resx file does allow the project to compile and will display my report with headers.  However in either the ObjectDataSource or the EntityDataSource, I cannot get my data to be displayed in either designtime or runtime.

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?

-Randy
0
Randy
Top achievements
Rank 1
answered on 06 Nov 2012, 04:19 AM
Just before giving up I decided to try to create a brand new report instead of trying to re-use my existing report in my other tests.  

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?

-Randy
0
IvanY
Telerik team
answered on 06 Nov 2012, 05:05 PM
Hi Randy,

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. 

Kind regards,
IvanY
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
HDC
Top achievements
Rank 1
answered on 16 Feb 2013, 02:21 PM
Hi Yvan,

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.  

 

Regards.

0
IvanY
Telerik team
answered on 18 Feb 2013, 05:12 PM
Hi Heli,

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,
IvanY
the Telerik team

HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
HDC
Top achievements
Rank 1
answered on 19 Feb 2013, 06:06 PM

Hello Yvan,

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.

Heli.

0
IvanY
Telerik team
answered on 20 Feb 2013, 05:08 PM
Hello Heli,

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.

Regards,
IvanY
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!

0
HDC
Top achievements
Rank 1
answered on 25 Feb 2013, 08:30 AM
Hi Yvan,

The issue is solved after installing Q3 SP1.
Thank you for your help.


Regards.
Tags
General Discussions
Asked by
Randy
Top achievements
Rank 1
Answers by
Randy
Top achievements
Rank 1
IvanY
Telerik team
HDC
Top achievements
Rank 1
Share this question
or