Report Definition Local Definition Error - c#

i have a very strange problem.
i'm designing a winform app using C# and SQL. i have one reportviewer(its a local report) that is bound to a dataset that holds data of a select query.
the report viewer is working ok in both release and debug modes, i'm able to view data, able to export it without any hindrances..
So i went ahead and published my app using Install shield, along with all my other forms. and made the setup file
i installed the setup file on my PC for testing purpose. All forms are working fine except the report viewer. when i click on my generate report button, the error "An error Occurred during Local Report Processing, the report Defination for Report2.rdlc was not specified. Could not find.
C:\Users****\AppData\Local\Apps\2.0\C0AR0PT5.VRJ\DBE8ENNT.GWW\s.i...tion_61336ddcb5db67e9_0001.0005_09635aa1235e262b\Report2.rdlc "
What could be the reason, its working in VS2012 in both Debug as well as release mode.
Please help, What could be the issue?

You should embed the report as a project resource. As it seems, your application expects the report's RDLC file to be present outside the application as a file on the disk.
On your comment "How do I do that?":
Set "Build Type" for the RDLC file in Visual Studio to "Embedded Resource" and then read this. I'd like to add that you need to add the full namespace.
Example: your RDLC file is "MyReport.rdlc" and it's in the sub-folder "reports" of a project with default namespace "com.example.MyFirstProject". Then you need to set ReportEmbeddedResource to
com.example.MyFirstProject.resports.MyReport.rdlc

Related

Can´t use the AcroPDF.dll for global use

For my WPF project I created a costum WPF control for PDF Reader. Therefor I included the AcroPDF.dll with Com-Components. It´s included over C:\Programms...Path. And it works fine on my own PC but when i publish the project it doesn´t work because it can´t find the AcroPDF.dll and run the PDF Viewer. I have already included the dll in the ProjectExplorer and set the option to always copy that it will get copied in the Debug folder. This works. But when I try to include the Component again, Visual Studio always shows me the dll with the C:\Prgramms...Path and when i try to select the dll manualy it selects the wrong Path again.
So what can i do, that Visual Studio really selects the dll in the Project and not where the PDF Reader is installed?

CRM 2015 Online OData Service

Everyone,
I am working on displaying read-only crm data in sharepoint. I followed the directions at Develop1.net. So that means that I used the WebAppWalkthrough from in the CRM 2015 SDK. This worked great and the data does appear in my SharePoint App. But, when I generate a new xrm.cs file, to get access to my customization's, I get the following in my broswer:
I did use the included CrmSvcUtil.exein the SDK. The code that I ran to generate the xrm.cs file is:
CrmSvcUtil.exe
/codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"
/out:"..\Xrm.cs"
/url:https://<Org>.api.crm.dynamics.com/XRMServices/2011/Organization.svc
/username:<user name>
/password:<password>
/namespace:Xrm
/serviceContextName:XrmServiceContext
/servicecontextprefix:Xrm
This will successfully create a new xrm.cs file but as soon as I update my solution and rebuild it I get the Request Error in the browser. I have tried the above code with the /generateActions flag and even registered my computer using the Device Registration Tool to get a deviceid and devicepassword. I then added the\deviceid and \devicepassword flags to the above code. Again the file is generated with no errors, but as soon as I add it to the solution I get the error mesassge.
So I though maybe it was something wrong with the WebAppWalkthrough. I redownloaded the SDK again and had the same issues. So I decided to build the OData service from scratch following the directions at Microsoft. Same error again.
My code is no different then what can be found in the SDK or at the Microsoft link. I get no build errors and no errors in Visual Studio.
There appears to be an issue with the way code is generated via the CrmSvcUtil.exe. Here is what I ended up doing that got things to work:
1) I modified the WebAppWalkthrough file. Basically I just deleted the .aspx pages since I don’t need them.
2) I deleted the Xrm.cs file that is in the folder.
3) I created a blank C# class file called Xrm.cs.
4) I used a tool called XrmToolBox with a plugin called Early Bound Generator
a. I was able to create a separate .cs file for each entity including the XrmServiceContext.
5) I manually copied the code from the opportunity file and the XrmServiceContext file into the blank Xrm.cs file.
6) Anything that had an error in the new Xrm.cs file was deleted
7) Added [assembly: Microsoft.Xrm.Sdk.Client.ProxyTypesAssemblyAttribute()] above the namespace.
8) Added using Microsoft.Xrm.Portal.Web.Data.Services; inside the namespace.

unable to add a rdlc report to asp.net web applicatioin

I am adding the RDLC (report wizard) to my asp.net web application. I am using visual studio 2010 and have installed the AJAX control tool-kit using Nuget package manager.
Problem is arising at the point when I am adding a new item and then opting a new item as rdlc. then as I click over rdlc, instead of adding an rdlc to my project I am getting following error.
"could not load file or assembly 'AjaxControlToolkit' version=4.1.7.1213, Culture=neutral.... or one of its dependency."
I am unable to understand why i m getting this error. Kindly suggest some ways to add the rdlc smoothly.
Thanks!!
Try copying the AJAXCONTROLTOOLKIT.DLL file to the following folder.
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies
Hope this works.
It worked for me.
May be you get this problem again while adding Report Data also, if you are referencing to another business/ data layer project in the solution. Then also copy the dll of those projects to same folder as mentioned above.

Trouble creating Object Data Source

I'm using VisualStudio 2012. I wanna create a demonstration project to be deployed in IIS.
This project must have an aspx page with a ReportViewer which will show a local processing report. By local report, I mean it won't use Reporting Service, the project's compiled code must build its own report.
I'm using the tutorial at http://msdn.microsoft.com/en-us/library/ms251784.aspx
But when I create a report from Report Wizard, "Choose a Data Source Type page" isn't shown. I'm presented to the "Choose Your Data Connection page", where I should set a connection to a DBMS.
I don't wanna create the report from a DBMS, I want an Object Data Source. It will be a List of Plain Old C# Classes, that will be fed to the report. I don't want the report viewer to access the DBMS directly.
BusinessObjects.cs was properly created and it's in the root of the project.
I F6 compiled the solution, cleaned it, closed VS and reopened. It simply doesn't let me create a data source that's not from a DBMS.
Is there anything the tutorial ommited and I'm missing?
I solved it.
I created a new project with a "ASP.NET Empty Web Application" template. Inside the solution I created another project with a "ASP.NET Server Control" template.
I used the serve control project as application layer, and the empty webapp project as presentation/UI layer.
In application project I created the Object Data Source and added that project to UI project's reference. With that I was able to create an asp page in UI project that consumes the application object data source.
GG

C# Pull Report out of a DLL and put it in a Report Viewer

My scenario is that I am creating a DLL that contains my reports inside of it and then adding that DLL to my main project. My report is set as an embedded resource, and in my main project I am doing the following to set the report into the ReportViewer.
Assembly assembly = Assembly.LoadFrom("MyAssembly.dll");
Stream stream = assembly.GetManifestResourceStream("MyAssembly.Reports.MyReport.rdlc");
MyReportViewer.LocalReport.LoadReportDefinition(stream);
MyReportViewer.RefreshReport();
Now when I do this, I know that the Report is loading, somewhat, because I can set ReportParameters. If it wasn't loading at all I would be throwing an exception stating the parameter doesn't exist or something to that effect.
Whats happening is that my Report will load said parameters and when I RefreshReport(), I get this.
The source of the report definition has not been specified.
Any clue as to why this would be happening? I feel I might be missing something when it comes to loading reports from a dll. However, when I scoured the Internet it seemed like this was the correct solution.
As a side note, I have a form inside of my .dll that I am calling and loading reports into perfectly fine. However, that is a different case because that form knows specifically where that report is.
In this situation I have a ReportViewer that is not inside the .dll and I am trying to load the .rdlc that's inside the .dll into my ReportViewer that isn't inside the dll.
EDIT
To top it off, if I use the following code I can see the file that I need in the dll.
string[] resources = assembly.GetManifestResourceNames();
> "MyApp.Controls.Reports.MyCustomReport.rdlc"
this little piece of code at the beginning of the procedure solved my problem
MyReportViewer.Reset();

Categories

Resources