472,794 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 software developers and data experts.

Creating PDF from CR

Hi gurus...

Well my problem might be simple to some of you but I can't figure it out.
Im trying to export Report to pdf in code but I still getting the same
error;

"The process cannot access the file
\"C:\\DOCUME~1\\K10263~1.TNE\\LOCALS~1\\Temp\\expo rt_d6506a79-d0e9-4d98-948c
-c42990ffd9f7.tmp\" because it is being used by another process."

My code looks like this and I marked where my errors appear with
/***************ERROR********************/ ;

private void SaveasPDF()
{
string sFileName = Application.StartupPath + "\\temp\\" + m_iRandom+
DateTime.Now.Ticks.ToString() + ".pdf";

crAutt report = new crAutt();

CrystalDecisions.Shared.ExportOptions exportOpts = report.ExportOptions;
exportOpts.ExportFormatType =
CrystalDecisions.Shared.ExportFormatType.PortableD ocFormat;
exportOpts.ExportDestinationType =
CrystalDecisions.Shared.ExportDestinationType.Disk File;
exportOpts.DestinationOptions = new
CrystalDecisions.Shared.DiskFileDestinationOptions ();

CrystalDecisions.Shared.DiskFileDestinationOptions diskOpts = new
CrystalDecisions.Shared.DiskFileDestinationOptions ();
( (
CrystalDecisions.Shared.DiskFileDestinationOptions )report.ExportOptions.Des
tinationOptions ).DiskFileName = sFileName;
PrintForm print = new PrintForm();
//Creating bitmaps with my controls drawn on
DataSet ds = print.CreatePDF(this.pnlSkyrsla);
report.SetDataSource(ds);

Stream st;
/*************** ERROR********************/
st = report.ExportToStream(
CrystalDecisions.Shared.ExportFormatType.PortableD ocFormat);

byte[] arr = new byte[st.Length];

if(arr.Length < (m_iMaxReportSize * 1024))
{

/***************ERROR********************/
report.Export();

ReportViewer view = new ReportViewer();
view.crviewer.ReportSource = report;
view.ShowDialog();

}
else
{
//error
}
}
Jul 21 '05 #1
0 1006

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: rdsteph | last post by:
Python411 is a series of podcasts about Python, aimed at hobbyists and others who are learning Python. Each episode focuses on one aspect of learning Python, or one kind of Python programming, and...
6
by: owen | last post by:
Generally speaking, what does it mean when I see a "button" with red text showing this message instead of the control I've dragged onto the web form in Design View.? (But the page works fine at...
2
by: Pawan | last post by:
Hi Guys, I have this current assignment where I have to develop online forms for local municipal authorities. I have to use adobe acrobat to create online forms from PDFs (which I have never done...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
2
by: LIN | last post by:
Hello, Greetings. I am creating a web site which will contain lot of articles. I had been planning to create simple HTML page on the server everytime i posted a article (eg. article12.html )....
2
by: Patrick | last post by:
I want to define a set of web-form templates in XML and render the equivalent web-form with ASP.NET, then process any input server controls on the form. Reading the XML file from Page_load is...
0
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
9
by: =?Utf-8?B?YmJn?= | last post by:
Hi all, I read somewhere "using kernel stuff in thread is not good.." if ManualResetEvent object is created in thread but not actually used, will it affect performance? Bob
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.