Well, thatβs why Iβm building a kind of reporting that is central for the company I work for, and the easy part is creating a web file browser, now I move on to the report aspect and get started, I integrate Crystal Reports. I already received files from the SAP site for them, but I ran into several problems,
Firstly, all the examples that I found do so that you need to determine the data source / database and include information for entering the code in it. This is a problem because we have a lot of crystal reports with many different database links, so I can't just use them for everyone. In fact, there are reports that we use this link for several databases at the same time.
Secondly, all the examples I found make it seem like a specific page is created for each report. My goal is to have the report link as a variable and have one page for all the reports that we have.
I looked at everything I could find yesterday, and I could not find what I needed. I'm also interested in what the ReportClass.Load function does. This was in every example that I could find, and I did not notice any obvious differences in the ReportClass that I had when I used it.
During the search, I found an answer that suggested creating a web form application that would generate reports, and then use I-Frame to capture it, but I want to avoid this.
So in the review:
1) I need to create Crystal Reports without having to reference the database
2) , Report, .rpt
3) , , MVC IFrames
!
EDIT: , . RAZOR- ASPX, Crystal Reports . , ViewBag.
:
[HttpGet]
public ActionResult Viewer(string Path)
{
var sessionID = Session.SessionID;
ViewBag.Path = newPath;
return View();
}
ASPX :
<% Report.Report.FileName = ViewBag.Path; %>
<CR:CrystalReportViewer ID="Viewer" runat="server" AutoDataBind="True" GroupTreeImagesFolderUrl="" Height="100%" ReportSourceID="Report" ToolPanelWidth="200px" Width="100%" />
<CR:CrystalReportSource ID="Report" runat="server">
<Report></Report>
</CR:CrystalReportSource>