on 04-25-2012 9:07 AM
Hello there!
We encountered an error "A generic error occurred in GDI+" in our Crystal Report file that has large PIE Chart that occupies 80% of the Letter size paper. This remain unsolved until now. It occurs after previewing the report twice, it seems to me that it is a case of a Memory Leak problem or because of unreleased resources used by previous report previews.
As suggested in one of the discussion in this forum, I did closed and disposed the Report Document as follows:
var objRptDocViewer = (CrystalDecisions.CrystalReports.Engine.ReportDocument) crystalReportsViewer1.ViewerCore.ReportSource;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in objRptDocViewer.Database.Tables)
{
table.Dispose();
}
objRptDocViewer.Database.Dispose();
objRptDocViewer.Close();
objRptDocViewer.Dispose();
objRptDocViewer = null;
reportDocument.Close();
reportDocument.Dispose();
reportDocument = null;
crystalReportsViewer1.ViewerCore.ParameterFieldInfo.Clear();
crystalReportsViewer1.ViewerCore.Dispose();
crystalReportsViewer1.Owner = null;
crystalReportsViewer1 = null;
GC.Collect();
But even this does not resolve the problem, I noticed however that if I make the PIE Chart smaller I am able to preview the reports more before the GDI+ error comes up, but still the error remains. I even tried to preview the report without a datasource but still the error is the same.
I'm thankful and look forward to any advice or solution that any one will share.
Many thanks,
Marlon
Hi Marlon,
There are a lot of issues in GDI+ that CR cannot resolve. You could try logging the issue with Microsoft to see if they can resolve the problem.
Can you attach your report with saved data, I'll try it also and see what happens on my PC?
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Don,
Thank you very much for responding.
I tried to attached here the RPT file that I used to test CR Pie Chart and with which I am encountering a GDI+ error, unfortunately the forum only allows files of type asc, .txt, .text, .xml, .xsl, .gif, .png, .jpeg, .jpg, .jpe. If you give me an email address I will send it to you.
I did post this issue at MSDN WPF forum yesterday, the link is http://social.msdn.microsoft.com/Forums/en/wpf/thread/35c150a2-a794-4fe2-a158-68786bebe7c0. But so far, after some 110 views none had suggested a possible solution yet. It seems that there are a lot who have the same issue and looking for an answer.
I'm just looking for a way to provide a report in our system that has a chart on it. I'm hoping and thankful for any solution the forum members will share.
Best regards,
Marlon
Hi Marlon,
Ah right, sorry about that, I forgot to mention to attach the file just rename it to .txt. We can them name it back to rpt to use it. Also discovered you can't zip a file first, the system auto zips the file and can't rename it if it already has a zip extension.
I see you logged a case - Incident 384812
But no report attached?
As I mentioned, it's not something we are going to be able to fix, R&D will simply tell use is a GDI+ issue.
If you have a PC where it does work then use Modules to compare CR runtime files, look for the differences using the tool. I'll attach modules to the case.
Thanks again
Don
Hello Don,
Attached is the rpt file I'm testing, as per you recommendation I change the extension name to txt, you just need to rename it back to rpt.
At the moment, I just decreased the size of the CR chart to its default height as when I first added it on the form or page while I set the width to about 7 inches. This allows me to preview the report more than 10 times without the GDI+ error. To ensure the chart will display its data clearly despite the small size, I limit the data to just the top 10 records.
Also, once the wpf window that contains the crystalreportviewer is open, I just hide it when the user close the window and reuse the same wpf window and crystalreportviewer for subsequent reporting.
It's nice to know that we're not alone in this predicament, but it will be great if we can find a solution to this.
Many thanks,
Marlon
Hi Marlon,
That worked.... I ran the report and it works fine on my PC using VS 2010 and Cr for VS 2010.
So is this report have the pie chart that causes the issue?
If so I'm thinking it may be OS or VS related.
What OS and patch level are you using?
What version of CR and VS are you using?
What is your screens DPI setting set to?
Have you tried updating your PC's Video card driver?
What Video Card are you using and what drivers?
Don
Hello Don,
I work on a laptop which has Windows Vista, Visual Studio 2010, and CR for Visual Studio 2010 version 13.0.3, the graphics device and driver is Intel Media.
I have not tried that CR report with another computer yet but as you have pointed out now I will try it with a Windows 7 PC and other machines that have different configurations.
Although we like our system to be compatible to different workstation setup, I believe your suggestion is still helpful because while the solution or fix for GDI+ bug is not yet available, we can determine the best workstation configuration that we can recommend to our client.
Can you post here the configuration of you PC where you test the rpt file?
Thanks and regards,
Marlon
Marlon,
Getting the same error, did you get a solution to the problem?
My findings are:-
Hopefully this will start something on SAP side
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
A few things to try. Assuming you are using CR for VS 2010 because that is the only version with a CR WPF viewer, upgrade to SP 4. There have been a few fixes in the viewer. SP 5 will have some more, it is after all version 1.
CR 2011 is WIN32 API based and uses GDI and not GDI+, no .NET assemblies referenced in the Designer so comparisons between the designer and a .NET application is not valid. GDI+ uses the .NET Framework.
Third issue is the Charting dll is made by a third party and has not been updated for 5+ years ( maybe ), I don't recall the version or dates but they are old. We are looking at updating them to a current version but that may take time to do if we do it at all.
We know there are problems in GDI+ and we have logged a few with Microsoft, I believe. So until MS resovles these GDI+ issue we can't make CR work 100% in all situations. only solution is to to test and use what works.
Very interesting that you get an error in KeycodeDecoder. That is a new one.... May or may not be related, could be you are not closing and disposing of the report and other objects when done and/or some thread is not being closed properly.... hard to say what would be the cause of that error being thrown without more details. And is a new issue so should be in a new thread.
I still believe it's a Video card driver/DirectX issue and not GDI+, lots of others have resolved by updating their Video card drivers. because Marlon has not replied I am assuming he found a combination of hardware and hardware drivers that did fix the problem.
Don
On a side note dou you know about CR under VS2012, we are thinking about going that direction?
Thanks for the prompt response.
PS have a full version of CR 2011 installed, tried to contact SAP aust for assistance in this matter, and just got no support, could buy per incident support. This is a bug in CR, anyway you look at it.
Can't produce a simple 1/2 A4 graph from simple data. Great concepts and would love to use because it suits my needs, but can't cause it doesn't work.
Vented off now, and feel much better.
#3. We've created our our Charting jar file for CR for Enterprise ( Java version ). Don't know why we never kept it up to date, just the way it is.
#4. Microsoft does thing when they get around to it and because they have their own Reports now it's not a high priority for them, my personal view only.
Attach a report that shows the error with saved data and we can test it on our machines. Use the Advanced editor option and rename the report to *.txt then it will attach. must be less than 1 meg.
Don
Hi David,
Thanks for the report. It works fine for me with SP 4.
I would use Process Monitor or DebugDiag, could be a resource or dependency issue. Try clearing your \temp folder also. You may want to move to using the CR.Window.Forms, WPF viewer is version 1 so there are limitations.
Simplified app, just open and preview:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
namespace WpfApplication1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
crystalReportsViewer1.Owner = this;
}
private void button1_Click(object sender, RoutedEventArgs e)
{
CrystalDecisions.CrystalReports.Engine.ReportDocument doc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
doc.Load(@"D:\Atest\David Ahrens\test.rpt");
crystalReportsViewer1.ViewerCore.ReportSource = doc;
}
}
}
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.