Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I created a small winform application with VB.net, in Form I created a GriddataControle, a chartControl and some text fields.
I created a function that replaces chartControl to picture.

C#
My problem is  to import this picture in a report "Crystal Reports", so I inserted an picture (any picture) and after that I try to replace it like a textbox, but it does not work .
Please is there a way I can insert this picture in Crytal Report.


What I have tried:

VB.NET
Private Function GetChartImage(ByVal Chart As ChartControl, ByVal Format As ImageFormat) As Image
       ' Create an image.
       Dim Image As Image = Nothing
       ' Create an image of the chart.
       Dim s As New MemoryStream()
       Try
           Chart.ExportToImage(s, Format)
           Image = Image.FromStream(s)
       Finally
           s.Dispose()
       End Try
       ' Return the image.
       Return Image
   End Function



C#
cryRpt.SetParameterValue("Picture2", GetChartImage(ChartControl1, Imaging.ImageFormat.Jpeg))
Posted
Updated 20-Jan-17 9:25am

1 solution

Take a look at this solution.
Image in Crystal Reports[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900