My subreport is not detected in Visual Studio - c#

I am currently attempting to create a report using rdlc in Visual Studio 2022. I ran into a problem where every time I run the program
The subreport 'foo' could not be found at the specified location bar. Please verify that the subreport has been published and that the name is correct
Everywhere I've looked no one mention anything about publishing the subreport beforehand, they all just enter the subreport name in the subreport properties panel
Update:
I found this warning after running a few test, not sure if this is helpful
Warning: An error occurred while executing the subreport 'RunDetailsSubReport' (Instance: 0): The report definition for report 'RunDetails' has not been specified (rsErrorExecutingSubreport)

Related

Visual studio designer wont display my user controls but runs the application fine

for some reason my user controls display the error 'Cannot locate resource 'resources/backicon.png'. I am confused as to why this is happening as the program runs fine it just cannot create an instance of the controls in the designer and is displaying a blue warning here: ''. The path in the error is 'resources/backicon.png' however in the actual user control the path is specified as '/Resources/BackIcon.png'. Also the build action for the images is set to resource.
(I'm running Visual studio 2013 Express for Windows Desktop)
Explicitly specify the assembly name in the path although it belongs to the same assembly.
pack://application:,,,/MyAssemblyName;component/MyResourcesFolder/MyImage.png
Make sure You set the build action of the image to the type 'Resource'.
Right Click->Clean
Once its cleaned
Now RightClick-> Rebuild
You will see the blue warning gone.
Its because your user control must be added later on which resulted in designer not having any reference as its using previous build as base

Unable to generate Crystal report- Incorrect Log on parameters

I have been trying to generate my report but this error keeps showing up. Can any one please tell me what can be the issue, what can be the possible solutions to rectify the problem.
Logon failed. Details: mscorlib : Could not find a part of the
path 'E:\OPCollectionSUMMARYReportXML.xml'. Error in File
C:\Users\arifkhan\AppData\Local\Temp\OPCollectionDetailsReport {89FDC9CF-5AE2-45E7-
B382- 28318AD342A2}.rpt: Unable to connect: incorrect log on parameters.
Configuration: C# (VS2005), Crystal Report 8, SQL Server Management Studio.
Thanks in Advance and have a good day!
We solved 4 issues like that this week, i will share here.
A report with a subreport. The main report and the subreport use the same XSD as the data source. The XSD defines 5 tables. The 5 tables was added to the main report, but only 3 was added to the subreport. We removed the 2 "extra" tables of the main report and it worked.
We had another issue very similar to the first one, but the main report had fewer tables. We just added the "extra" tables in the main report, so that the main report and the subreport now have the same tables and it worked.
A coworker said he put "content" as the "build action" of the XSD file in the visual studio project and it supposedly worked. But i did not tried it to check.
A report was using 2 XSD files. We changed it to use only 1 XSD files and it worked.

Report Definition Local Definition Error

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

Server name doesn't exit in current context in crystal report(visual studio 2010)

I am trying to generate crystal report but i am getting error for server name.
Here is my code,
rptDoc.Load(Server.MapPath("C:\\Users\\intlpos\\documents\\visual studio 2010\\Projects\\FormCrystalReport\\FormCrystalReport\\SubProductReport.rpt"));
error message is Server name doesn't exit in current context. I am using Visual Studio 2010.
Can anyone help me.
Thanks.
It looks like Server.MapPath() takes a virtual path, not a physical path, as an input. So you would use
Server.MapPath(#"Users/intlpos/documents/visual studio 2010/<<snip>>/filename.asp") to convert the virtual path to the physical path.
Take a look here for better info.

Report Services crashes in visual studio debugger for local report when page number parameters are added

I have a report that looks like this:
There isn't anything really special about the report, it's my first report I've made with reporting services for my application (we're transitioning from crystal reports).
It's a local report that runs fine outside of visual studio. However, if I run it inside visual studio with that bottom right corner textbox (the expression is =Globals.PageNumber & " of " & Globals.TotalPages) it crashes. If I remove the box, it runs.
It crashes with this error code:
The assembly with display name
'expression_host_9191d5a6e4724724b792f551d1c7a8e9'
failed to load in the 'LoadFrom'
binding context of the AppDomain with
ID 1. The cause of the failure was:
System.IO.FileNotFoundException: Could
not load file or assembly
'expression_host_9191d5a6e4724724b792f551d1c7a8e9,
Version=11.2.30319.1, Culture=neutral,
PublicKeyToken=null' or one of its
dependencies. The system cannot find
the file specified.
Does anyone know what I'm doing wrong?
This is a bit of a shot in the dark but my next move would be to disable the Visual Studio hosting process.
Right Click on project and select Properties
Go to the Debug Tab
Uncheck "Enable the Visual Studio hosting process"
It's possible this particular project type doesn't support the hosting process in which case it will be grayed out (and I'll be wrong :) ).

Categories

Resources