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.
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.
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.
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. |
|||
|
|||
12 comments :
hi,
do you know how to print receipts using vb.net.. if you know pleace post a sample programe.. thank you..
please clarify bindreport(data) with examlpe
BindReport(data) is the method which i used to bind data to report
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
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.
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
BindReportData(name);
what we should right in it?
hi suresh sir... can u give u r mobile number....... i need one help....
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.
thanks solved when i am calling function on pageload, but i am calling my function click buttion
Note: Only a member of this blog may post a comment.