on 02-05-2012 7:46 AM
Hi,
It would be very efficient if u can implement an overload to ReportDocument.load() function to accept a memory stream, for templates that we are using too much, we can load them once so lessening the IO, and use them a lot.
Regards.
Hello,
You can actually, just be very careful about managing the objects and you MUST close and dispose of each report once completed.
public class frmMain : System.Windows.Forms.Form
{
CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
CrystalDecisions.CrystalReports.Engine.ReportDocument rpt1 = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc;
CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc1;
...
// then open the report
rpt.Load(rptName.ToString(), OpenReportMethod.OpenReportByTempCopy);
// then clone the report
rpt1 = (CrystalDecisions.CrystalReports.Engine.ReportDocument)rpt.Clone();
// this assigns the report to RAS for modification
rptClientDoc = rpt.ReportClientDocument;
rptClientDoc1 = rpt.ReportClientDocument;
Cloning does a Deep Copy.
I've never tried to load multiple reports this way so not sure what is going to happen. You should use threading to handle each report object.
Sorry no samples.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I came over this question when searching for a way to load a rpt. file from a memory stream. I to think it is very strange that you do not have a overloaded method for the ReportDocument.load() function that accepts a Stream.
We are using the CrystalReports suite in multiple components with a common database. The rpt-files are stored in that database together with a variety of content for the reports.
In the year 2016 i think it is quiet stupid to have to save this rpt. byte [] to a temp file before I am able to load it into the report generator. Memory has become cheep, and it is in so many ways more clean to avoid handling temp files.
Feature request: An overloaded method for the ReportDocument.load() function that accepts a Stream.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wholeheartedly agree!
There is a place to "officially" request new features - http://ideas.sap.com.
I did some searching there and found this: Open report from memory using Java SDK : View Idea. Yes, it's for the Java SDK, but I added a comment about having it for the .NET SDK as well. You should go there and vote it up. If you decide to add an idea specifically for the .NET SDK, please post the link to it back here. I'll publicize it and we may get or from SAP to do so as well. The more up votes an idea gets, the more likely it is that the development team will implement it.
-Dell
Thank you for the information about which channels to use in order to get this feature implemented
I have now voted up the suggestion you linked to, and have created a corresponding suggestion for the .NET SDK: Possibility to load a rpt-file from memory using the .NET SDK : View Idea
-Håkon
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.