473,396 Members | 1,907 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,396 software developers and data experts.

Crystal Report code on WinForms

Eleven
19
I've got a web page that I use to generate Crystal Reports, it works perfectly but now I want to do it in WinForms. I need you guys to help me out on the exporting to PDF, the ExportToHttpResponse won't work on WinForms...

Expand|Select|Wrap|Line Numbers
  1. private void btnCK2_Click(object sender, EventArgs e)
  2.         {
  3.             ReportDocument doc = new ReportDocument();
  4.             doc.Load("...\RPT\CK2.rpt");
  5.             doc.SetParameterValue("ent_no", txtEntNo.Text);
  6.             doc.SetParameterValue("trak_no", txtTrackNo.Text);
  7.             doc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "Certificate");
  8.         }
  9.  
I tried the following but nothing happens when I click on my button.
Expand|Select|Wrap|Line Numbers
  1. doc.ExportToDisk(ExportFormatType.PortableDocFormat, "Report");
I'd really appreciate your help, thanks!
Jan 12 '09 #1
2 3490
vekipeki
229 Expert 100+
I know that there is also a bunch of options that you can set like:

Expand|Select|Wrap|Line Numbers
  1. doc.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
  2. doc.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
  3. doc.ExportOptions.DestinationOptions.DiskFileName = "filename.pdf";
  4.  
but I don't have Crystal reports installed right now so I don't remember it exactly, try to find an example for ExportOptions class in your help docs to see how it works.
Jan 12 '09 #2
Eleven
19
Thanks a lot, I got it to work!
Jan 13 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
0
by: Dr. Indera | last post by:
hello, i previously posted the questions below on several crystal reports newsgroups, including the one for the company that makes crystal reports, but never got an answer, so i'm hoping that...
8
by: Rod | last post by:
I've written a Visual Studio .NET application (WinForms app) and put a Crystal Reports for .NET report in it. It is a very simple application - one regular form and another with the crystal...
2
by: Mythran | last post by:
In .Net, how can I go about and set a Crystal Reports namespace? Right now they use the Root Namespace (VB) from the project. How can I extend the namespace for a single report (which will be set...
2
by: mike parr | last post by:
I am just starting using Crystal Reports.NET with VS.NET 2003 and I can create a report and open it up in my webpage fine. However, I am now trying to export the report, and I keep getting the...
3
by: Karine Proot | last post by:
Hello, I created two reports : - OleDbReport.rpt, with an OLE DB (ADO) data source (took only table 'stores' from database 'pubs') - DataSetReport.rpt, with an ADO.NET DataSet as a data source...
7
by: Jlo | last post by:
Hi, I have a c# winforms application. When I call the report file, it shows me all the records in the table. How can I make it to call only a particular range. i have the following code...
1
by: halaor | last post by:
I have my data filled in a DataTable, generated on runtime. I have a DataSet, into this DataSet i add my DataTable dataSet1.Tables.Add(datatable); Now I would like to show this simple table...
2
by: Bruno43 | last post by:
I am very new to Visual Baisc in general but I am trying to learn Crystal Reports. I have gotten a few things on there but a couple of things are still escaping my grasp. My question: I have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.