on 10-27-2007 3:25 AM
Hi All,
Is This any possibility to load report from a stream (not from file) ?
I know ExportToStream Method of ReportDocument class.
But This class dont have any method to load report from a stream,
only from file (Load Method)
Please help me
regards
Piotrunio
Not possible
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<p>I think that the only way is to put the stream into a file and then you can load the report from the file: </p><p>This function can help you: </p><p>using System.IO;</p><p>public void FileFromStream(string fileName, Stream stream)</p><p>{ </p><p> StreamWriter sw = new StreamWriter(fileName);</p><p> stream.Position = 0;<br /> byte[] buffer = new byte[stream.Length];<br /> int numBytesToRead = (int)stream.Length;<br /> int numBytesRead = 0;<br /> while (numBytesToRead > 0)<br /> {<br /> int n = stream.Read(buffer, numBytesRead, numBytesToRead);<br /> if (n == 0) break;<br /> numBytesRead += n;<br /> numBytesToRead -= n;<br /> }<br /> stream.Close(); </p><p> sw.Write(buffer, 0, numBytesRead);</p><p> sw.Close(); </p><p> } </p><p> </p><p> </p>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for Your Help, but I know this method.
I want to bypass reports temporary files in HDD.
I don't want put any temporary files on HDD.
Is This possible ?
Reg
Piotrunio
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.