473,407 Members | 2,676 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,407 software developers and data experts.

Export Crystal report to PDF

Hi,

Could any one give a sample example on how to export crystal report called
"MyReport.rpt" to PDF using Crystal Report !!?
Thanks

Oct 11 '06 #1
5 25010
Hi,

ReportDocument r = new ReportDocument( );
r.Load( reportURL );
// set the parameters/ the datasource, etc,etc
r.SetDataSource( GetaDataSet() );
r.ExportToDisk( ExportTypeFormat.PortableDocFormat , "path to file );
--
Ignacio Machin
machin AT laceupsolutions.com
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
Hi,

Could any one give a sample example on how to export crystal report called
"MyReport.rpt" to PDF using Crystal Report !!?
Thanks

Oct 12 '06 #2
Thank U very mutch Ignacio and this code is working fine but I didn't using
the " r.SetDataSource( GetaDataSet() );" line of code because I don't know
what it does!!?
So does it add a new data to my Report file!!?

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

ReportDocument r = new ReportDocument( );
r.Load( reportURL );
// set the parameters/ the datasource, etc,etc
r.SetDataSource( GetaDataSet() );
r.ExportToDisk( ExportTypeFormat.PortableDocFormat , "path to file );
--
Ignacio Machin
machin AT laceupsolutions.com
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
Hi,

Could any one give a sample example on how to export crystal report called
"MyReport.rpt" to PDF using Crystal Report !!?
Thanks


Oct 12 '06 #3
That line of code, that cited Ignacio, just bind your data to report to show
report content.
SetDataSource can take different data sources, including DataSet.
See MSDN for more details about this method

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


"Badis" wrote:
Thank U very mutch Ignacio and this code is working fine but I didn't using
the " r.SetDataSource( GetaDataSet() );" line of code because I don't know
what it does!!?
So does it add a new data to my Report file!!?

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

ReportDocument r = new ReportDocument( );
r.Load( reportURL );
// set the parameters/ the datasource, etc,etc
r.SetDataSource( GetaDataSet() );
r.ExportToDisk( ExportTypeFormat.PortableDocFormat , "path to file );
--
Ignacio Machin
machin AT laceupsolutions.com
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
Hi,
>
Could any one give a sample example on how to export crystal report called
"MyReport.rpt" to PDF using Crystal Report !!?
>
>
Thanks
>
Oct 12 '06 #4
Ignacio Machin ( .NET/ C# MVP ) schrieb:
Hi,

ReportDocument r = new ReportDocument( );
r.Load( reportURL );
// set the parameters/ the datasource, etc,etc
r.SetDataSource( GetaDataSet() );
r.ExportToDisk( ExportTypeFormat.PortableDocFormat , "path to file );

Hi,

a little hint!

I had on some customer-pcs problems with this ExportToDisk(). Sometimes
i got error messages, that a process can´t start in the background.

After exporting the reports in a MemoryWriter and writing this stream to
a file, the problems a gone.

Greetings from germany

Stephan
Oct 12 '06 #5
This bit of code is good if I already have the report, do U know how can I
generate a new report with a name of my choice and set its parameters!!!?
Thanks Michael
"Michael Nemtsev" wrote:
That line of code, that cited Ignacio, just bind your data to report to show
report content.
SetDataSource can take different data sources, including DataSet.
See MSDN for more details about this method

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


"Badis" wrote:
Thank U very mutch Ignacio and this code is working fine but I didn't using
the " r.SetDataSource( GetaDataSet() );" line of code because I don't know
what it does!!?
So does it add a new data to my Report file!!?

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,
>
ReportDocument r = new ReportDocument( );
r.Load( reportURL );
// set the parameters/ the datasource, etc,etc
r.SetDataSource( GetaDataSet() );
r.ExportToDisk( ExportTypeFormat.PortableDocFormat , "path to file );
>
>
--
Ignacio Machin
machin AT laceupsolutions.com
>
>
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
Hi,

Could any one give a sample example on how to export crystal report called
"MyReport.rpt" to PDF using Crystal Report !!?


Thanks

>
>
>
Oct 13 '06 #6

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

Similar topics

0
by: Tim Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
3
by: Colin Graham | last post by:
Error when attempting to export Crystal Report as PDF document asp.net. I get the following error. Error in File...
6
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel...
1
by: John | last post by:
Hi. Sir: Does anyboday know how to export subreport data using the export button in crystal report tool bar? We have a main report including a on-demand report. When we click the on-demand...
0
by: suicidaltendencies | last post by:
I'm able to view the report, but when I click the button on the webpage that shows the report to export into a different format it gives me an error on Export. Any help would be great I keep...
0
by: Leonard Danao | last post by:
Anyone have any ideas as to why this is happenning. There are no other versions of Crystal installed aside from the one that came with vs2003 enterprise. the error happens when the...
1
by: ElanKathir .S.N | last post by:
Hollo Guys, I want to export my crystal reports (Crystal Report 9.0) to word format using visual basic 6.0. Means I want to export the reports with out preview. Now showing report using...
0
by: Henry | last post by:
I have written an ASP/VB.Net application via VS 2003 (Crystal V9) that uses MS Access 2000 as its database. I can export reports that have no linked sub reports for printing. However, I'm unable...
3
by: Brad | last post by:
In a Vista/IIS7 asp.net app, a coded crystal report export is crashing IIS7....but it works just fine in visual studio's cassini web server. And if I create a web form and use the crystal...
3
by: acextreme | last post by:
Hi all, I have a big problem when I try to export from Crystal Report 8.5 in .pdf from VB6. I use a database made in SQL Server 2000. The problem is that all the decimal fields in database are...
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: 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
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.