开发者

Create a "fake" file to pass in to Crystal Report API

Attempting to create a PDF from a Crystal Report file in C# using the Crystal Report API (version 13) - The API requires that the Crystal Report file be passed in as a file. I currently have the report as a memory stream and would prefer to not save it to a file, use it, then delete the file when done.

Is there any way to "fake" sending a file without creating an actual file? (Parameter it requires is a filename.)

This application runs on a server in the cloud and will have multiple instances and other things that make me not want to try to deal with permissions and file structure and things like that that may crop up when creating a "real" file.

Thanks 开发者_运维百科for your help!


Of course not. If it's expecting a filename as a parameter, it's using OpenFile() or the equivalent to open a physical file on disk. How do you fake it?

Every OS I've ever worked with has a mechanism for getting a temporary filename; in .NET, you can use System.IO.Path.GetTempFileName for exactly this sort of purpose.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜