• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1248
  • Last Modified:

ActiveReports 2.0 using ActiveReports Chart control slow performance

I applied the hotfix 4.2.1.1238 and did not see any difference.

Issue:

Loading a batch of invoices, max of 50, then either printing or exporting to PDF. Each invoice has two chart controls.

Prev Environ:

AR 1.0, VS 03, ChartFX

I could view the batch of 50 in under a minute and it was around 30secs to print.

Cur Environ.

AR 2.0 build 4.2.1.1238, VS 05, AR Chart control

Now it takes at least 10min's just to view the batch of 50. I tried to do a test print and gave up after 12min's.

Any suggestions? Right now the current performance is unacceptable. We have thousands of invoices and will not be able to print based on these numbers. Is this perhaps a known issue and is there a fix?

thanks
0
jpsr1
Asked:
jpsr1
  • 8
  • 5
1 Solution
 
mjmarlowCommented:
0
 
jpsr1Author Commented:
I had seen that thread regarding performance but it is related to another issue.  Apparently, I'm the only one using the software in this manner so this issue has not arisen.

So do I earn points if I stump the experts?? :)
0
 
mjmarlowCommented:
Yes, you get to keep you own points if you do not get an answer.  

Try uninstalling AR 4.2.1.1238 and installing 4.2.0.1205 instead.   Let me know how that works out.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
jpsr1Author Commented:
I've tried AR .net 2.0 sp1, sp2, and the hotfix all to no avail.

Apparently they've made a fix so a custom control may be added dynamically so I'm going to give ChartFX a try.  Previously, I used a custom control for the ChartFX object...
0
 
mjmarlowCommented:
If you set visibily of your chart to false, does that speed things up?
0
 
jpsr1Author Commented:
yes, I set the visibility = false and commented the method used to "draw" the chart and the reports rendered in a reasonable time.  There are two ActiveReport charts on each invoice and max of 50 invoices to a batch so essentially there are 100 charts being rendered.  I can watch the memory grow exponentially as the code is run through for each invoice.  :(
0
 
mjmarlowCommented:
One thing i noticed with AR is you need to conserve objects (graphs and subreports) when ever possible to conserve memory.  

In your report create variables to hold your two charts.  Create them once and reuse over and over again.  
0
 
jpsr1Author Commented:
hmmm, i'll look into it...thanks
0
 
jpsr1Author Commented:
TheLearnedOne,

I would rather you not close the question as it was never resolved. I was still hoping for a suggestion from the peanut gallery.

thanks
0
 
mjmarlowCommented:
Has the author tried my suggestion of only creating the charts once and reusing the chart rather than creating and destroying the chart over and over?  

See:
http://www.datadynamics.com/Help/ARNET2/ar2tskOptimizingActiveReports.html for full list of techniques used for optimizing ActiveReports.

If the author has been diligent about resolving this issue, and still no success, the author should make the report (RPX and CS files) available to the "peanut" gallery.
0
 
jpsr1Author Commented:
I solved the problem:

I tried creating a customcontrol at runtime in AR 2.0 and it didn't work.  the other option AR suggested was to upgrade to 3.0...it's a beta.

The successful option is to export the chart to the memory stream--> to an image--> then load the image into a picture control. It is now just as efficient as the "old" code.

I can render 79 invioces with 2 charts on each invoice (gas, electric) in less than 30 seconds. THIS is acceptable!!!

System.IO.MemoryStream memStream = new System.IO.MemoryStream();
           
                chart.Export(FileFormat.Bitmap, memStream);
                switch (serviceType)
                {
                    case "Electric":
                        System.Drawing.Image imgElectric = System.Drawing.Image.FromStream(memStream as System.IO.Stream);
                        picElectricChart.Image = imgElectric;

                        break;
                    case "Gas":
                        System.Drawing.Image imgGas = System.Drawing.Image.FromStream(memStream as System.IO.Stream);
                        picGasChart.Image = imgGas;

                        break;
                    default:
                        break;
                }
0
 
jpsr1Author Commented:
BTW:
I'm using VS 05, AR 2.0 & ChartFx.

Thanks for the brainstorming mjmarlowe...
0
 
jpsr1Author Commented:
update-->The image from the stream was too fuzzy and was unacceptable when I printed it. exporting the chart to a metafile and printing the rendering was perfect. I just couldn't get the metafile from the stream sooooo, below is the end result. I'm loading the image into a picture control on the rpx.

string tempPath = Path.GetTempFileName().Replace(".tmp",".emf");
            chart.Export(FileFormat.Metafile, tempPath);
       
            switch (serviceType)
            {
                case "Electric":
                    System.Drawing.Image imgElectric = Metafile.FromFile(tempPath);
                    picElectricChart.Image = imgElectric;
                                       
                    break;
                case "Gas":
                    System.Drawing.Image imgGas = Metafile.FromFile(tempPath);
                    picGasChart.Image = imgGas;
                 
                    break;
                default:
                    break;
            }
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 8
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now