doubt anyone knows the solution to this!

G

Guest

working on a difficult problem, using crystal reports and when the report is
exported for the file save it uses the name of the webform that the control
is on, like default.aspx, but without the aspx. Anyway just wondering if
there is a way to dymanically change the name of the form, for example to put
the current date in it like (report022007).
 
T

Tim Mackey

hi paul,
yes but you're talking to the entire internet so someone is bound to have
found the problem before :)

in your case, i am guessing that you are exporting a crystal report to PDF
and sending it to the HttpResponse on the fly, with 'inline' instead of
'attachment', so that it will open in the browser window rather than forced
download.
if this is true, then have a read of this discussion, which has an
explanation and workaround for the way browsers embed PDF documents.
http://groups.google.com/group/micr...ead/5351568f5c47ee44/3ba6d8b75f1d4263?lnk=gst

let me know if this doesn't match your situation, and post some code too so
we can see if there is something else you might be doing wrong.

good luck
tim
 
G

Guest

Hi Tim, thanks for the response. What you have assumed is correct, what I am
trying to do. I will take a look at the reference you provided, thanks.
--
Paul G
Software engineer.


Tim Mackey said:
hi paul,
yes but you're talking to the entire internet so someone is bound to have
found the problem before :)

in your case, i am guessing that you are exporting a crystal report to PDF
and sending it to the HttpResponse on the fly, with 'inline' instead of
'attachment', so that it will open in the browser window rather than forced
download.
if this is true, then have a read of this discussion, which has an
explanation and workaround for the way browsers embed PDF documents.
http://groups.google.com/group/micr...ead/5351568f5c47ee44/3ba6d8b75f1d4263?lnk=gst

let me know if this doesn't match your situation, and post some code too so
we can see if there is something else you might be doing wrong.

good luck
tim
 
G

Guest

Hi Tim, just had a quick question. Do you think I should try what is below,
also not quite sure how to
do this since, do you have to write code to save it to the server. Plus the
response redirect have to
occure in the export button callback, which I do not think we can access since
it is a crystal report form that comes up.
Suggestion__ save the PDF file to a temp
folder within the web site, and just do a Response.Redirect to the pdf file.
it displays inline, and it will retain the correct filename. i run a script
every night on the server to clear out the temp folder
Thanks again, Paul.
--
Paul G
Software engineer.


Tim Mackey said:
hi paul,
yes but you're talking to the entire internet so someone is bound to have
found the problem before :)

in your case, i am guessing that you are exporting a crystal report to PDF
and sending it to the HttpResponse on the fly, with 'inline' instead of
'attachment', so that it will open in the browser window rather than forced
download.
if this is true, then have a read of this discussion, which has an
explanation and workaround for the way browsers embed PDF documents.
http://groups.google.com/group/micr...ead/5351568f5c47ee44/3ba6d8b75f1d4263?lnk=gst

let me know if this doesn't match your situation, and post some code too so
we can see if there is something else you might be doing wrong.

good luck
tim
 
T

Tim Mackey

hi paul,
i guess you're using the crystal report viewer web control. in my case i
was writing the code in a regular Button_Click event handler so i had no
trouble with that. i haven't used the CR viewer web control so i'm not sure
what's possible.

here is the code i used anyway:
crUnassigned_Audits rpt = new crUnassigned_Audits();
.... databind the report ...
string RelPath = String.Format("../Tmp/Unassigned_Audits_{0}.pdf",
Guid.NewGuid().Value);
rpt.ExportToDisk(ExportFormatType.PortableDocFormat,
Server.MapPath(RelPath));
rpt.Close();
Response.Redirect(RelPath, true);

hope it helps. you may be able to override the export button click event
handler, if you wrote a new control based on the CR control, then you could
use the code above to redirect the user to the report, and keep the file
name for saving etc.

tim

Paul said:
Hi Tim, just had a quick question. Do you think I should try what is
below,
also not quite sure how to
do this since, do you have to write code to save it to the server. Plus
the
response redirect have to
occure in the export button callback, which I do not think we can access
since
it is a crystal report form that comes up.
Suggestion__ save the PDF file to a temp
folder within the web site, and just do a Response.Redirect to the pdf
file.
it displays inline, and it will retain the correct filename. i run a
script
every night on the server to clear out the temp folder
Thanks again, Paul.
 
G

Guest

Hi Tim thanks for the additional information. I thought that you had to use
the crystal
report viewer web control to display a crystal report on a webform
but looks like that may not be the case. I will try something
like what you have provided when I get time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top