cancel
Showing results for 
Search instead for 
Did you mean: 

How to output PDF files in a crystal Report

Former Member
0 Kudos

Hello,

I've some data stored in a database, they are PDFs files data.

How can I include them in a report

For example

I've a Table

MyTABLE with 2 Cols (Name STRING, data byte[]) (in fact it's a .NET/DataSet)

I would like to display the content of my table in a CR

I can include a static PDF in my report, but not a variable one.

Can anyone Help Me ?

Thanks

Marc

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Something I don't understand here. PDF vs. .NET Dataset.

If the data is in a .NET Dataset; (in fact it's a .NET/DataSet)

Then all you should need to do is;

crReportDocument.Database.Tables(0).SetDataSource(dataSet.Tables("NAME_OF_TABLE"))

or

crReportDocument.SetDataSource(dataSet)

or

crReportDocument.SetDataSource(dataSet.Tables(0))

How the dataset is created or what is behind the dataset should not be of any consequence. To ensure you get the fresh data, either don't enable the "Saved Data" option, or use .Refresh in your code.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Former Member
0 Kudos

Hello,

Thanks for the answer

the PDF data are stored in the dataset.

my Question is what kind of 'Control' must I use in the report .

An IFieldBlobObject cans display PDF data ?

Can it display any OLE data ?

Thanks for your help

Marc

0 Kudos

Hi Marc,

What version of CR Designer are you using?

If you have CR 2008 or CR 2011 you can set the XML export type to include Binary data using the Export Option from the File Menu. Then the XML file will have the PDF saved in binary mode in the XML file.

See if that works for you. This feature is not available in the .NET Report Viewer however it will use the saved option when exporting. Not sure if it will use it at runtime though or how to set it.

See if the help for the SDK's has any info, you can get them from help.sap.com

Don

Former Member
0 Kudos

Hello Don,

I don't know where i can have the DR Designer version ? i think it's the Last one for VS2010 and .NET 4.0

I've found a solution to my problems :

My images are stored in PDF.

I load then in EXCEL Sheet via VSTO.

I Use the clipboard to have a picture copy of it :

oleObject.copy()

byte[] tabBytes = (MemoryStream)(Clipboard.getData("PNG")).ToArray();

I store this bytes in a .net dataset (column type System.byte[]);

and I can include it in a report as an image.

Thanks for your Help

Former Member
0 Kudos

thanks

0 Kudos

Great... We had a team meeting so didn't reply right away and I was going to reply back with the same suggestions.

Don

Answers (0)