How to use "Print" and " Export" option from CrystalReportViewer Interface in Asp .Net

I am new in using CrystalReports with Asp .Net 2.0.

I am using previously populated DataSet as the source of Data for CrystalReports.

The report appears in the web Form itself, inside a CrystalReportsViewer which is embeded in the web Form.

So far, so good.

However, when I try to "Print"(or Export)  it by clicking "Print"(or Export)  button appearing as a part of ReportViewer interface, the report simply disappears.(The page is posted back).

 

Is there any way to handle the event and get the desired result ?

Thanks,

Vijay

 

 

0
VijayT
11/23/2007 10:30:56 PM
asp.net.crystal-reports 7043 articles. 0 followers. Follow

3 Replies
733 Views

Similar Articles

[PageSpeed] 16

 

Hi,

I also got the same problem. And here is the solution. Actually when u press any of the buttons on report viewer, the entire page is reloaded. So, just call the function which provides the dataset to your report document once again. But take care that u dont call the function on the initial load of the page because if the dataset is getting populating on a button click on that page propably at initial page load your dataset is going to be null. And the reportdocument will throw u an error.

This solution will definetly work. If u have any issues dont hesitate to reply to me.

0
Rajesh
11/24/2007 11:05:57 AM

hi i have the same problem here is the code.

how to change this code to make it work.

thanks 

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1"

DataTextField="Name" DataValueField="Name" Width="169px">

</asp:DropDownList>

<asp:Button ID="Button1" runat="server" Text="Button" />

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:nsdpConnectionString %>"

SelectCommand="SELECT DISTINCT Name FROM Staff"></asp:SqlDataSource>

<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

RD.Load(Server.MapPath("rptStaff.rpt"))

RD.SetParameterValue("name", DropDownList1.SelectedItem.Text)Me.CrystalReportViewer1.ReportSource = RD

CrystalReportViewer1.DataBind()

End Sub

0
sultani
11/25/2007 3:31:37 AM

Hi Rajesh,

These are the steps I took to fix the problem -

 [1] am also using Session to store the reportDocument and retrieving it when PostBack occurs.

[2]I was also using AJAX Update Panel and only if when I removed it , i was getting "Print" or "export" pop ups.

Now, I am able to see the report after the post back.

But the problem is , when I click on "Print" or "Export" option, I am getting the error -.

"Failed to export using the options you specified. Please check your options and try again"

I tried different options for export - PDF, Excel, RTF - each time , i got the same error.

I am sorry, i can not resolve any problem.But in case you have the  solutions, then please let me know.

Thanks,

Vijay

 

0
VijayT
11/25/2007 11:41:41 PM
Reply:

Similar Artilces:

"Using" or "With"
Hi all Please can someone enlighten to me as regards the difference with the "Using" and "With" statement when accessing data - which is better, what are the limitations and/or any pointers. Many thanks. Regards DaveDavid WinchesterPlease mark as answer if this is the solution.  using gives you the ability to use the connection and it closes the connection directlly after you finish using it. and there is no need to try- cach - finaly. there is no limitation on using USING keywordMuhanad YOUNISMCSD.NETMy Blog || My Photos || LinkedIn I have a dataobject the re...

Using "+" or "||"
Using SQLAnywhere 5.5.04, I've gotten into the habit of using "||" in ISQL to indicate a string concatenation. I needed to paste my SQL statement into the PowerBuilder script painter for some embedded SQL, and PB didn't like the "||" very much at all. I changed it to "+" and it seems to be ok. Do these two operators indicate ~exactly~ the same thing? moin, afaik these two's are not the same! if you're using "||" and any term is NULL then in the resultstring the term will be ignored if you use "+" then the resu...

Precedence of "where" ("of", "is", "will")?
Nobody on #perl6 today could answer this one. Is: Str | Int where { $_ } the same as: (Str | Int) where { $_ } or: Str | (Int where { $_ }) ? Followup questions, Mr. President: What kind of operators are "where", "of", "is", and "will"? Is there a reason that S03 doesn't list them? What are their precedence(s)? -- Chip Salzenberg - a.k.a. - <chip@pobox.com> Open Source is not an excuse to write fun code then leave the actual work to others. Chip Salzenberg writes: &...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD 9.0.0.580. Bruce "Bruce Lamb" <lamb.bruce@mayo.edu> wrote in message news:6HgI315nCHA.155@forums.sybase.com... > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

C#.Net "Double" and "double" When/Where to use?
Hi all     Please let me know the difference between "Double" and "double" in c#.Net (I understand that "Double" is structure      and "double" is an instance to that structure) differences if any thing else.     Also the context in which both has been used.(When/Where to use both). thanks all...      hi,my brains says Double is reference type & double is value type.regards,satishKind Attn: If a reply to your post helped you, kindly mark it as Answered.__________...

quotes, quotes, quotes...
I am getting this error and I know what is causing it, but I have no idea how to fix it, any help would be great. The script steps through the /var/log/messages file on a linux server and puts The entries into a mysql database. However when it gets to the 'hlt' line in the messages file it just barfs. The single quotes are freaking it out. I know about quotes but not how to use in this situation. Thanks, Paul Error: May 27 17:53:00 localhost kernel: Checking 'hlt' instruction... OK. <----- doesn't like this in the messages file DBD::mysql::st exec...

Printing options for "txt" Emails: No "print selection", "print pages X to Y" ??
Hi. NTS told me, that for TEXT only emails it is not possible, to get the same "print..." dialog, as it's available for HTML formatted email: - Printing selected text - Printing a page range I was advised, to place an enhancement request (done). It's hard to believe, that there really isn't some work around to print just parts of TEXT emails, or a page range?? Regards, Rudi. Rudolf, It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply. Has your problem...

Convert my reports from "Active Reports" to "Crystal Reports"
Hello, I discovered data dynamics active reports product a year ago while I was starting a new asp.net project and decided to use it as the reporting tool, it's a very nice product and have a lot of advantages over many other products in the market. However...I also discovered that although they clearly declare that they support Right To Left languages, they have a BIG issue when using Right To Left languages in ASP.NET.I've been writing them posts about this problem and asking when they are going to fix it for 8 months, and yet they did not give me an estimate time frame for fixing this i...

"Net use" not working in application that runs as "system"
Hello, I am trying to create an application object to distribute a program which during the setup procedure creates two local users on the workstation. I tried to set up the application to run as an unsecure system user and start the setup.exe. This method worked fine for quite a number of apps in the past. However this app needs a drive mapping to a windows 2003 server to start the setup.exe. Apparently under windows 2003 it is no longer possible to use the "net use" command when running a script as system user. I get system error 1312 "A specified logon ses...

About "Tools" "Options"
Name: Dominick Email: dominickdotfooatgmail.com Product: Firefox Summary: About "Tools" "Options" Comments: Dear Sir/Madam : I just found a tiny things from Firefox 2.0 . Not too sure is it bug or not. When I try to change my "first page" on "Tools" "Options". It can't show proper web address when I open several sub pages. It will show all pages web address together on the blank when u try to change the "first page". Sorry for my poor english. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-T...

Replacing "\\" with "\"
Hi all I'm getting this value from a CheckBoxList control - a location of file, i have to remove "\\" and replace it with "\" and pass it to Query, how to do it, i tried with Replace, but coud'nt suceed. "\\\\Blaze10xp\\BLZ_SFS_07\\Sample Excel Files\\Excel Files\\report2.xls" thank's in advance - Prakash.C you tried Replace like this? string newstring = oldstring.Replace(@"\\",@"\");Plese, do not forget to click "Mark as Answer" on the post that helped you. Thanx!My blog: Scenes From A Developer Memory yes i tr...

"Net use" not working in application that runs as "system" #2
Hello, I am trying to create an application object to distribute a program which during the setup procedure creates two local users on the workstation. I tried to set up the application to run as an unsecure system user and start the setup.exe. This method worked fine for quite a number of apps in the past. However this app needs a drive mapping to a windows 2003 server to start the setup.exe. Apparently under windows 2003 it is no longer possible to use the "net use" command when running a script as system user. I get system error 1312 "A specified logon ses...

"Retain in Memory" and "Unattended Execution" Options in VS.net?
Hi, A colleague found the article below which explains why our old VB6 DLLs are being unregistered on the server. http://support.microsoft.com/default.aspx?scid=kb;EN-US;264957 Anyone know if these settings are still a concern in Visual Stuio .net DLLs? I tried to find similar settings on the "solution" and "project" properties tabs, but I didnt see anything that matched. Also, if anyone is interested in learning more about DLLs being unregistered, or IIS hanging when you use DLLs compiled in VS, there is a webcast from MS available here: http://www103.pla...

replace the "." with a ","
Oi.... I need to build a small programm in ASP.NET and chose to use C# for it.Now i got everything working but there's one little problem.the first textbox is a double. I need to make it so that when someone enters a "." then it gets replaced by a ","any ideas?Ghan  string blah = "4.2.2.2";blah = blah.Replace(".", ",");Ryan Ryan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question...

"-" not "_"
I wrote a SQL statement in the data tab. I wrote a bunch of alaises as example ' word-type ' but when I hit the layout tab it converts the "-" to "_". So now my field name is ' word_type '. Is there any way to prevent this? CardGunner Don' use a hypen ( - ).  It isn't a valid character for column names.   See http://searchsqlserver.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid87_gci1188931,00.html   Here's an excerpt about column names: Letters as defined in the Unicode Standard 2.0 Decimal numbers from either B...

Web resources about - How to use "Print" and " Export" option from CrystalReportViewer Interface in Asp .Net - asp.net.crystal-reports

Resources last updated: 1/22/2016 2:31:09 PM