Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

Crystal report not showing data when click on export/ print options in asp.net

Feb 11, 2012
Introduction:

In this article I will explain how to solve the problem of showing data when click on export/print options in crystal report using asp.net.


Description:

In Previous posts I explained many articles relating to crystal reports. During work with crystal report I find problem to display data when click on Print/Export options in crystal report using asp.net. To solve this problem I made small modification in my code to display data when click on print/export options in crystal report. 

Whenever we click on print or Export button in crystal report it will go to pageload during that time we need to bind the report data every time. If you place report binding in !IsPostBack condition place it in outside.

First I written code like this 


protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
BindReportData(name);
}
}
After research I modified this pageload method is like this 


protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
}
BindReportData(name);
}
By making above code modification we got crystal report data whenever we click on print or export button. I hope it helps someone.

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

11 comments :

Madushka Prasad Amarasingha said...

hi,

do you know how to print receipts using vb.net.. if you know pleace post a sample programe.. thank you..

Anonymous said...

please clarify bindreport(data) with examlpe

Suresh Dasari said...

BindReport(data) is the method which i used to bind data to report

fizmhd said...

even i am not able to get you .. i followed your tutorials to create a report but i dont have any funciton like this .. plz help .. the binding was done through ... wizard ..

Anonymous said...

We have to export to excel the data in crystal report viewer.. Does it requires MS office installed on server. Please put some sample code, the excel file has to save on client macchine

Mohammad Al Mamun Sumon said...

Dear Suresh,
When I browse report on design time, I get data as I designed the report. But when I run my full application like "http://www.myapp.com/rpt.aspx" or "111.111.111.111/rpt.aspx" it shows nothing but a blank page. Plz solve the problem.

Jhansi P said...

Dear Suresh,

Crystal report viewer option is not visible in toolbox,can u help me how to add that field in toolbox,I', using visual Studio 2010

Rmk said...

BindReportData(name);
what we should right in it?

Anonymous said...

hi suresh sir... can u give u r mobile number....... i need one help....

Smm Friend said...
This comment has been removed by the author.
Smm Friend said...

Hi Suresh....!

This site is very usefull to all. I am just following your tutorial.

please tell me one thing


BindReport(data) method has not used while pass parameter.

plz see http://www.aspdotnet-suresh.com/2012/01/pass-parameters-to-crystal-reports-in.html

Now can you please tell me where i put this code. I am very thank full to you if you could send a sample to me. My email ID is 145iloveindia@gmail.com

Thank you very much in advance.

Give your Valuable Comments

Other Related Posts

© 2010-2012 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.