473,395 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

doubt anyone knows the solution to this!

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).
--
Paul G
Software engineer.
Feb 5 '07 #1
5 1062
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/micro...1d4263?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

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:FA**********************************@microsof t.com...
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).
--
Paul G
Software engineer.
Feb 6 '07 #2
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" wrote:
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/micro...1d4263?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

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:FA**********************************@microsof t.com...
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).
--
Paul G
Software engineer.
Feb 6 '07 #3
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" wrote:
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/micro...1d4263?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

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:FA**********************************@microsof t.com...
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).
--
Paul G
Software engineer.
Feb 6 '07 #4
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.PortableDocForma t,
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" <Pa**@discussions.microsoft.comwrote in message
news:29**********************************@microsof t.com...
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" wrote:
>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/micro...1d4263?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

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:FA**********************************@microso ft.com...
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).
--
Paul G
Software engineer.
Feb 6 '07 #5
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.
--
Paul G
Software engineer.
"Tim Mackey" wrote:
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.PortableDocForma t,
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" <Pa**@discussions.microsoft.comwrote in message
news:29**********************************@microsof t.com...
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" wrote:
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/micro...1d4263?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

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:FA**********************************@microsof t.com...
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).
--
Paul G
Software engineer.
Feb 7 '07 #6

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

Similar topics

18
by: pmm | last post by:
Hi all, Plz dont fire at me if this is a silly question Is there any way to know in which direction stack grows pmm
6
by: Baskar RajaSekharan | last post by:
In C-sharp, I wnat to know whether the Component is compiled in Debug Mode or Run Mode through Code. How is it possible? Is there any way to Access the Config file and check? Please let me know...
1
by: Rafael Veronezi | last post by:
I have a simple doubt about the Response.Write method... Follows... I have a page that do some processing before show up, it could take something like 10 or 15 seconds... But it's not the network...
11
by: ASP newbie | last post by:
I cannot run my asp.net application in w2k server. But the program works fine under w2k professional. Can anyone tell me is there any difference in the settings? Many thanks.
11
by: krishnamaddi | last post by:
Hi Friends, I am having some doubt. I want to print an ASP Page, for this i need to use java script. the problem is while printing if the line is too big, i can't print those data properly . i am...
8
by: CM | last post by:
Hi, Could anyone please help me? I am completing my Master's Degree and need to reproduce a Webpage in Word. Aspects of the page are lost and some of the text goes. I would really appreciate it....
7
by: new to c | last post by:
Hi! I write the 2 codes int i; i = sizeof(long int); printf("%i", i); i = sizeof(int long); printf("%i", i);
7
by: Anarki | last post by:
int main(a,b,c,d,e,f,g) { printf("Size of a = %d\nSize of b =%d",sizeof(a),sizeof(b)); return 0; } The above program perfectly compiles in cygwin using gcc and my questions are
2
by: Mr. Arnold | last post by:
I mean the ability to call a Web service or a WCF service with Service Broker using CLR code that's running on SQL server is very good. I am programming this in a project for a client that's being...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.