ASP.NET Core Crystal Reports integration - asp.net-core

I developed a web application using ASP.NET webforms technology and it contains lots of reports designed by Crystal Reports.
I want to convert my project to ASP.NET Core technology, but I have a problem that's ASP.NET Core does not support Crystal Reports. I searched Google for any help, but did not find any.
I have almost 300 reports. Can you please suggest how to integrate these Crystal Reports with an ASP.NET Core web application?

Crystal Reports does not support .net core, .net 5 or 6, and does not have any immediate plans to support .net core. They offer a couple solutions:
switch to java
hosts the reports it a 4.8 web application, and reverse proxy to it from you asp.net core application.
option 2 is probably your best.
note: .net core applications, nor .net standard libraries, can not call a 4.8 dll.
see thread:
https://answers.sap.com/questions/13029137/crystal-reports-for-visual-studio-and-net-core-5-a.html

One way around this is to decouple the report generation process from the .NET Core process.
For example, the .NET Core process can insert a record into a Report_Job table. That table can include information about not just the rpt file but also parameters and processing options.
Another process can monitor that table, trigger the reports, and remove/update the job records.
There are 3rd-party Crystal Reports tools that can do that (including the ability to update the database based on success/failure of the report job. So no need to reinvent the wheel.

Searched and as you say there is no hope for asp.net core (ref:-https://stackoverflow.com/questions/62057447/how-to-call-reference-crystal-reports-from-net-core ).
But you can do this by achieving :
Add a .net project which supports Crystal report (framework 4.7.1 or read the article - https://answers.sap.com/questions/318288/crystal-reports-in-asp-net-core-20.html) and add all reports in this project. You can add, modify, preview (or test) etc.
Now give the reference in your main application and call report from your code, so this way you can do this.
I have done the same with Telerik report. Good thing that it supports .net core. but having issues to add directly, so add in another project, give reference and then call from main project. Another good thing with this approach is when we go in live/production, as reports having in the different project, we can modify report(s) in designer and publish the report project dll only (not required to publish all projects).

Related

How to publish multiple projects in ASP.NET Core 3.1

I have a question. I created a web application using ASP.NET Core 3.1 in Visual Studio 2022. In the solution, I have three projects, the first is my main project, the second is the admin panel and the third is the repository where I created the models and connected to the database, as well as here all migrations are located.
The question is how to publish these projects on a server or hosting. For example, on smarterŠ°sp. Screenshot of the projects is attached here:
Also I need to load the database.
Please provide a detailed instruction if possible.

Can one use Reportviewer Control in ASP.net Core

I want to make use of the Reporting Services ReportViewer control in an ASP.NET Core MVC project.
The solution as proposed in other answers it to add a webform to the project.
However since ASP.NET Core doesn't support webforms I cannot add the control to a webform.
Is there any other workaround that might possibly assist me in using the ReportViewer control in an ASP.NET Core Web application?
Update 2019
I have ReportViewer working on ASP.NET Core on Windows, and most features (not PDF and Images/PowerPoint) also work on ASP.NET Core on Linux.
There's still some bugs to weed out, though.
You can learn more about it in this github issue.
I can't release it publicly, because ReportViewer has a rather constricting license...
It is based on the AspNetCore.Reporting nuget by amh1979.
You might try the wrapper nuget around ReportExecution.asmx, also by amh1979, this has no licensing issues, but it's no real ReportViewer.
Original post:
No, you can't.
Microsoft is only just evaluating creating a .NET Core ReportViewer control.
Which means there isn't any at present (05/2017).
There also isn't any ReportViewer "control" for ASP.NET MVC.
There is only alanjuden's wrapper around MS-ReportServer's ReportExecution.asmx.
But that isn't the same. That will still require Windows Authentication on the report server (along with user-must-be-member-of-specific-ad-group), and a SSRS server running on Windows.
If you anyway have an SSRS-ReportServer on Windows, you're much better of embedding SSRS ReportViewer.aspx in an iframe. You might want to add forms-authentication to your reportserver. Also, if it needs to be cross-platform (=cross-browser = non-IE), you need SSRS >= 2016 (cross-browser not available in SSRS 2005/2008R1/2008R2/2012/2014).
If you're on Windows and don't want (your customer) to have to install a specific version of SSRS (which means you have to license a MS-SQL-Server), you can create a .NET non-core web application on IIS (on the same domain), and share the auth-cookie. Then you embed that ReportViewer from the IIS .NET non-core application via iframe (or link with target=_blank) in your .NET Core Web-Application. That way you don't require an SQL-Server license, and no MS-SQL-Server if you, for example, use MySQL/PostgreSQL/Oracle.
Other than wait, you can bundle Apache Tomcat with BIRT into your application, and use Launch4J to redistribute it with the JRE. Then you'll just have to use the Eclipse-BIRT ReportDesigner to create BIRT reports (non-SSRS-reports).
Or you can embed JasperReports with JasperServer.
This would be far more difficult to bin-deploy than BIRT.
But I guess docker to the rescue.
Jasper and BIRT have the advantage that they also run on Linux/Mac.
However, that means you either need the JRE installed on the server, or bin-deploy the JRE along with your application.
Jasper's advantage over BIRT is that it is faster, and that it supports vertical text (not just in the web, and vertical-text is not rendered as image).
There usually are always issues with the BIRT releases downloaded from their website that prevent running BIRT at first. Be that a missing JAVA_HOME environment variable, a missing .jar-dependency or an invalid signature in a .jar file. For information on what it will be on your machine at your time, consult the TOMCAT logfiles, and then google the problem.
The nice thing about BIRT is, that it's comparatively easy to bin-deploy.
Another option would be jsReports, if you like nodeJS.
However, Bin-Deploy that without installation and complications will be even harder (PhantomJS, Webkit, wkHtmlToPdf - for example with an ARM-processor on Raspberry PI).
If you have a few years to spare, you can also just wait until the SSRS team ports to .NET Core - if that happens at all, that is.
Here is a report viewer works on both ASP.NET MVC and ASP.NET Core.
MVC .NET Core Report Viewer

Use Office Interop on ASP.net MVC6 website

I want to generate word documents from my ASP.net MVC 6 website. I've implemented several ways to generate a document in a POC : DocX, NetOffice, OpenXml, COM Interop objects. I was seduced by it.
I made a Console App to test and it works.
But, with ASP.net MVC6, we can't reference Console App's or COM Assemblies.
We need to create "Console App (Package)".
How can I add COM Assemblies to my ASP.net MVC 6 website ?
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.
You can read more about that in the Considerations for server-side Automation of Office article.
Consider using third-party components designed for the server-side execution or if you deal with open XML documents you may use the Open XML SDK, see Welcome to the Open XML SDK 2.5 for Office for more information.

Is it possible to make aspnet ModelBinding work in .Net Framework 4.0 Web Forms?

We have a couple of relatively large Web Forms web application projects, but we are limited on using the .net 4.0 because some of our clients are still using Windows Server 2003, and the .net4.5 is not compatible with that OS.
Would it be somehow possible to make the model binding framework created on the .net4.5 work with the .net4.0 WebForms? Maybe something along the lines of extension methods on .net2.0 (although that is obviously almost 100% compile time stuff) or LinqBridge.
If that was possible to some extent, I think I would take the time to do it. Maybe if the code can be extracted from the original sources (I'm downloading them right now to see how it works) and be plugged like an extension or inheritance of sorts in our current page life cycle.
Does that mechanism have some external dependency that would make this prohibitive?
The WebForms-based feature required changes which are only available in 4.5.
That said, if you require model binding in some form, you could always try using the ASP.NET MVC or WebAPI frameworks for the particular part of your site in which you require model binding, leaving the rest as WebForms. They both currently only require .NET 4.0. And you get the benefit that both of those are supported products.

Microsoft .NET Framework 4.0 JumpList / TaskbarItemInfo example for Windows Forms

It is my understanding that JumpList implementation using Windows API Code Pack is now depreciated as Microsoft now supports JumpList directly through Microsoft .NET Framework 4.0.
http://msdn.microsoft.com/en-us/library/system.windows.shell.taskbariteminfo.aspx
I can see that it is possible to set progress etc. to the Taskbar Item in their examples; however I have struggled so much to implement this on a Windows Form.
I had successfully managed to implement JumpList and TaskBarItem progress using Windows API Pack in the past http://code.google.com/p/zscreen/source/browse/trunk/ZScreen/Forms/ZScreenConfigGUI.cs#277 but I want to move away from this dependency and utilise the Microsoft .NET Framework 4.0 instead.
Your advice is much appreciated.
Thanks
Mike
System.Windows.Application is in the presentation framework(PresentationFramework.dll) i.e. WPF. It does not exist in Winforms. So use Windows API Code Pack like here: http://code.msdn.microsoft.com/windowsdesktop/Jump-List-with-Windows-db005b99
WPF 4 provides a native support for Jump List. Instead, if we use
Windows Forms, we must adopt the Windows API Code Pack, a managed
wrapper that allows to access to the Windows API functions. Available
on NuGet too, it provides all you need to manage Jump Lists within our
Windows Forms Applications.
Another example here: http://www.codeproject.com/Articles/103913/How-to-Create-a-Custom-Jumplist-with-Custom-Events
It is my understanding that JumpList implementation using Windows API
Code Pack is now depreciated
Its not deprecated, its also a part of new .net 4 features but for WPF. For winforms, you will still have to use the pack like mentioned above.