Lars
Note : The code below is stripped from a asp.net project using a web
service. This project would relay a binary file from an internal web server
where Crystal reports is installed to an external web server. You will still
need write permissions for the directory you want to save to
You could try this, I hope It helps
Stream fs =
rep.ExportToStr eam(CrystalDeci sions.Shared.Ex portFormatType. PortableDocForm at);
byte[] binaryfile = StreamToBinary( fs);
string docLocation = Server.MapPath( null) + @"\Docs\";
SaveFileToServe r(binaryfile,do cLocation,"my.p df",DateTime.No w);
Response.Redire ct("Docs/"+"my.pdf") ;
public void SaveFileToServe r(byte[] binaryFile, string docPath, string
docName, DateTime fileModifiedDat e)
{
Directory.Creat eDirectory(docP ath);
MemoryStream m = new MemoryStream(bi naryFile);
FileStream f = new FileStream(docP ath+docName,Fil eMode.Create);
m.WriteTo(f);
f.Close();
m.Close();
File.SetLastWri teTime(docPath+ docName,fileMod ifiedDate);
}
public byte[] StreamToBinary( Stream fs)
{
Int32 i = Convert.ToInt32 (fs.Length);
byte[] b = new byte[fs.Length];
fs.Read(b,0,i);
fs.Close();
}
"Lars Netzel" <la*********@ NO-SPAM.qlogic.se> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Here's what I need to do:
Due to a bug in Crystal Reports ExportToStream( ) method I can't stream a
Crystal Reports directly to the client as PDF and I must must use the
Export() and put the the PDF on disk first and stream to the client.
That's just how it is.
Question:
So I need to let the aspx user have write permissions to disk.. NOT GOOD.
How do I solve this? Can I somehow write the PDF to disk in another thread
with other writes? OR are ther other ways around this?
best regards
/Lars Netzel