Profile Picture

putting a chart into a crystal report

Posted By Tim Kamrath 12 Years Ago
Author
Message
Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hi Tim,

We have not tried the approach, although long time ago we had a client that we think managed to do it. The Nevron Chart can of course create a memory stream with an image in all formats supported by .NET - bmp, png, jpeg, tiff, targa etc. For example:

NChartControl chart = new NChartControl();

// configure chart here


// create a byte array, containing a BMP image of the chart
MemoryStream memoryStream = new MemoryStream();
chart.ImageExporter.SaveToStream(
   memoryStream,
   new Nevron.GraphicsCore.NSize(400, 300),
   new Nevron.GraphicsCore.NResolution(96, 96),
   new Nevron.GraphicsCore.NBitmapImageFormat());

byte[] bytes = memoryStream.ToArray();



Best Regards,
Nevron Support Team



Tim Kamrath
Posted 12 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 10, Visits: 1

Has anyone every successfully done this with the .net chart?

It looks easy enough to do.  The catch is getting a byte stream of the image to insert into the report.  This link says it is just a matter of inserting the image into the report as a byte array.  Is there a way to get a byte array of the .net chart?  This article talks about using ChartX and says that it provides a way to save the image as a memorystream.  Is there anyway to do this with .net chart?

thanks.



Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hi Tim,

As far as we know Crystal does not support custom report items (such as SSRS). Some time ago we contacted them with a proposal to develop a chart for their .NET reporting engine, because the one that comes with it is really awful, but received no response... The only way we know is to embed a custom image in the data source, as explained in this article:

http://www.universalthread.com/ViewPageArticle.aspx?ID=92



Best Regards,
Nevron Support Team



Tim Kamrath
Posted 12 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 10, Visits: 1

I am wondering if anyone as ever tried putting a displayed chart into a crystal report.  With VS2010 you can use crystal reports to internally generate reports from your app.  But I am wondering if it is possible to put a chart into a crytal report.  Has anyone ever done this?  If so, how?

thanks.





Similar Topics


Reading This Topic