cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Graphic Location

0 Kudos

I am using the graphic location to pull an image from the disk and place it in the report.  This works with 2013 crystal reports.  When I use the .Net Viewer I can show the path an it is correct but the image fails to show more often than not.  If I click previous and next and keep doing it sometimes one of the images will come back and the other are missing.  It works great except in the .Net Viewer. Please help. If I go to the need of the report then back to the beginning most of the time all the images on each page are missing.  Any ideas?

First time the report loads most of the images show until I change pages and then some will not show.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Christopher,

First I would like to comment on your report, I am assuming also this report is typical and no database fields are used. I know the sample report was just to show the issue...

So you are not using any database fields other than to load OLE Objects into a report.

Why not just load the OLE Objects into a PDF file using Adobe's API's and allow users to preview those objects?

OR Export the report the report to PDF and then open the PDF file, there is a sample on how to be able to select the output destination on our site also.

Framework calls the System.printer collections when printing a report through a .NET application.

Word and all other MS products use Native WIN32 API's, funny they don't even use .NET Framework in their own software.

CR uses these collections:

System.Drawing.Printing.PrintDocument pDoc = new System.Drawing.Printing.PrintDocument();

System.Drawing.Printing.PageSettings pPage = new PageSettings();

Try printing using the framework and watch the memory.

Printing directly also requires formatting the page, so it's still going to use GDIPlus and the printer driver with printing directly to Printer.

Did you change the output to POC? It uses an ActiveX dll that is the same as CR Designer uses.

CR is hardware and software dependent, meaning we load the printer properties from the framework to format the page because we need to format the output accordingly, WYSIWYG...

Try setting the report to No Printer and see if that works, then it is using USP10 to format the page and not the printer driver.

Still doesn't matter if it used to work in COM, no option to go back to it...

DEV is still trying to find a way to handle the memory error in the viewer.

And to clarify for DEV, when you used this larger report you had set the crystalReportViewer1.CachedPageNumberPerDoc  to 1

and it still caused a problem in the VIEWER only? Do not print, that is a separate issue.

Need to know:

#1. Does memory error go away with the API set to 1? DO NOT PRINT, just page through the report.

#2. Export the report to PDF, either from the viewer or code and open the PDF file in the viewer, no print, does that work for you?

#3. Does No Printer fix anything? Open report, click on File Page Setup and check on No Printer.

#4. Change the default printer to POC for the viewer and use POC to do the printing, does that work?

Don

Don

Answers (48)

Answers (48)

0 Kudos

Don,

There is something else I need to know how to fix with this issue. On the image object there is the file location.  Under the COM object if the path to that file doesn't exist it just didn't display the image.  With the .NET control it throws a report exception and will not allow the report to be viewed.  I need to know how to get around this because it is a huge problem for me.

Thanks

Chris

0 Kudos

You should be able to ignore the exception.

Send me a report directly and I'll have a look at it.

And it's time to start a new post, this one is getting way to long.

Thanks

Don

PS - actually on holidays until tuesday

ido_millet
Active Contributor
0 Kudos

Some of the 3rd-party UFLs listed at Crystal Reports Viewers, Schedulers and Related Products

provide a FileExists() function. That should allow you to resolve the issue by have the Graphic Location expression check to see if the image exists.

0 Kudos

In the codebehind it is a property.  So CystalViewer1.interpolationmode = highqualitybicubic

It is just not in the properties box of visual studio.  It is hidden from the properties box but it does allow you to access it from the codebehind.  I wish it would be like a regualr property like enabled, visible and all the other proerpties.  You can only change it form codebehind.

0 Kudos

Hi Charles,

See KBA 2332112


I put sample code in it on how to. In the Form load you could create a button or feature to select the feature.


It also requires SP 17.


@ Christopher, I'll mention printer property to DEV....


Don

ido_millet
Active Contributor
0 Kudos

Don, a search for that KB fails.  For example, this link returns no results.
That, by the way, seems to be an ongoing problem with KB articles.

Can you provide the details via this forum or a blog? 
It's not clear if this new CRViewer property is available now or only in a forthcoming SP17.
Does it also apply to Winform projects?

Thanks,

- Ido

Hi Ido,

Found the cause, Ludek noted I did not have a product attached to the KBA so it was not searchable... I fixed it....

@ Christoher - DEV checked it out andf the FOrmatting engine does use those settings when printing, not exactly the same but you should see a difference.

@ Ido - WinForm ONLY:

Requires SP 17. Here's the info:

2332112 - Add a property in Windows.Forms.CrystalReportViewer to control the display quality of OLE object image

Symptom

In Crystal Reports .net Winform Viewer,  OLE object with high resolution image displays in low quality

Environment

  • SAP Crystal Reports, version for Microsoft Visual Studio SP16
  • SAP BusinessObjects BI platform .Net SDK runtime 4.1 SP8
  • SAP BusinessObjects BI platform .Net SDK runtime 4.2 SP2

Reproducing the Issue

  • In Crystal Reports, insert a OLE object with high resolution image
  • View the report in CR .net Windows form viewer.

Cause

This is an enhancement request.

Resolution

This issue is fixed in the patches listed in the "Support Packages & Patches" section below.

The "Support Packages & Patches" section will be populated with the relevant patch levels once they are released.

For Business Intelligence Platform maintenance schedule and strategy see the Knowledge Base Article 2144559 in References section.

After applying the patch:

     1. Add a new property: CrystalDecisions.Windows.Forms.CrystalReportViewer.InterpolationMode in order to control the display quality of image.

     2. The default InterpolationMode is set to "System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor".

In C# you can load the values in the FormLoad event:

public frmMain()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

    // SP 17 - SAP NOTE 2321691
    //System.Drawing.Drawing2D.InterpolationMode CRInterpolMode = new System.Drawing.Drawing2D.InterpolationMode();
    //CRInterpolMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;

    //crystalReportViewer1.InterpolationMode = CRInterpolMode;

    LstInterpolationMode.Enabled = false;
    Array CRinterpolationMode = Enum.GetValues(typeof(System.Drawing.Drawing2D.InterpolationMode));
    foreach (object obj in CRinterpolationMode)
    {
        //CRInterpolMode.GetTypeCode(CRinterpolationMode);
        LstInterpolationMode.Items.Add(obj);
    }
    LstInterpolationMode.SelectedItem = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
....
}

Now in the View Report button add this:

private void ViewReport_Click(object sender, EventArgs e)
{
    //// from Soda to handle Viewer OLE Object refresh issue 175343
    //crystalReportViewer1.CachedPageNumberPerDoc = 1;

    // SP 17 - SAP NOTE 2321691
    //System.Drawing.Drawing2D.InterpolationMode CRInterpolMode = new System.Drawing.Drawing2D.InterpolationMode();
    //CRInterpolMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;

    crystalReportViewer1.InterpolationMode = (System.Drawing.Drawing2D.InterpolationMode)LstInterpolationMode.SelectedIndex;
....

Don

ido_millet
Active Contributor
0 Kudos

Thanks, Don!

Good chances that there are other KBs without a Product association because I run into the same issue frequently.

0 Kudos

Not the only reason, got any numbers?

Don

ido_millet
Active Contributor
0 Kudos

I didn't record the numbers. Just an ongoing exercise in frustration when searching for KBs.

Consider doing an automated search against the KB CMS. There is probably a way to locate KBs that are not associated with a Product. Or that are not visible to searches for other reasons.

0 Kudos

CMS is BOE and that is a Contract supported product. You will not find many KBA's on BOE. We are working on converting all KBA's to SAP Notes and available through SMP with a log in attached to a Support contract.

If you don't own BOE no need to find Notes about the product...

This a off topic. if you have questions post a new one in the BI Product forum.

Don

0 Kudos

Don, something I want to mention to make sure they did this as well. With the interpolation mode I am hoping since the viewer has the feature that when they render it to the printer now they are using the same interpolation mode.  This will improve the overall print quality of the image as well once it is sent to the printer.  Nearest neighbor will render much poorer quality to the printer.  If this hasn't been done can they add it to SP18? 

charles_gagnon
Participant
0 Kudos

Hello Christopher,

     I'm lost in you 7 pages post. You are stating that the interpolation is not public. Could you please let me know how to modify it.

Thank you.

0 Kudos

Now that is what I am talking about!!!!!!!!!!!!!!  The interpolation mode fixed about 10 issues I have been having.  It even helps with the spacing problems I have been having as well. This has to be the best service pack to date.  Too bad they didn't make the interpolation mode public because someone unaware of what it will do for them will never know it is available.  You should find a way to put the word out.  Once I get the memory issues resolved I am as close as I will get to the COM object.  Thanks for the help getting there Don.

0 Kudos

Don,

#1 If I set the API to 1 it lets me page through the report slowly but it works.

#2 Exporting the report fails just like printing.

#3 No printer did not fix anything for me.

#3 POC seems to work but the options to print are nothing like what is available since it has it's own interface.

I have to use crystal because there are other database fields that I use.  I gave you a simple scaled down version of this report.

I have other reports, one that is 8K pages and I am printing to the printer and it is just fine.  It only fails on reports that have images inside them.  Crystal uses GDI+ as you know and it uses this on every report to render it to the printer.  So if it was a GDI+ problem it would happen on every report that was large.  The leak is with the way images are disposed of.  In 2010 I wrote a graphic based program like Paint.NET I experienced this problem while developing it.  The issue is that the object it not being disposed of properly after rendering it to the printer.  The simple fact that if I do not set that API to 1 lets me know there is a problem. I cannot page through the report on the screen in the viewer without that being set to 1. I get the same problem when printing just like viewing.

If I could not see the problem in the viewer I would say it is printer problem.  As far as disposing fast enough.  Managed code is pretty good about freeing up memory provided the object has been disposed of properly.  These images are compressed and less that 80K per each image.  Uncompressed they are about 30MB each.  The fact I cannot page through them on the viewer means there is an issue disposing of them.  I have and image control from lead tools and my customers page through thousands of images daily and at a very fast rate.  I never get and Memory exception.  They also print 20K worth of images per day to these same printers and it works fine without a memory exception.

I know you are doing your job by helping development out trying to find me a work around. You guys could take the images that I gave you and copy them.  Then make a database of your own and show these images in a report of about 1000 pages that would give you a test case to work with.  Then bring the report up and print it to a printer.  You will get the same error I get.  The other reason I know it is not a printer driver issue is that it will let me print one or two books (reports) before it throws the memory exception some times.  It will does not reset between reports, it seems like the memory is not being cleared from the previous report. I think if they fix the viewer problem and render the images to the printer the same way they view them it will be fixed.  But the viewer is not fixed 100%.  I would be ok if they printed the same way the viewer works with the API set to 1.  When I print I can see the exception in Visual Studio.  There is a problem with disposal of the images I can watch the memory usage while printing.

0 Kudos

Hi Christopher,

POC uses an ActiveX component and is the same dialog box you see when printing from CR Designer. It is also closer to the RDC Viewer than .NET P2P API so it has a better memory handler.

If that works for you it can be a temp solution....

And I did get an update from DEV, they have significantly reduced the memory usage but they need more time to test this since it's going to affect all of the BI CR products and backend code and they want to make the change in BOE 4.1 SP 9 first and if that passes the QA cycle then they will port it into CR for VS in SP 18. SP 18 is due out in September.

To late to get this into SP 17, which is going to be delayed due to 3rd party updates that are causing issues...

So it would appear from all of the info you have provide them they have found a better memory handle routine but it does change the way CR works so they have to be very careful on how this gets implemented so it does not cause any regression issues.

Thank you once again for all of your patience....

Don

0 Kudos

By the way where is SP17?

0 Kudos

Unfortunately when we had to upgrade a third party dll it caused issues in all of the CR products so DEV and QA are very busy trying to resolve the issues...

Hopefully soon, some patches have been released so CR for VS should be soon.

Don

0 Kudos

Don,

Watching it in debug on the diagnostic tools as it is spooling the report I get a message

"A generic error occurred in GDI+." This is and exception that is throw as it is spooling the report to the printer.

Thanks

0 Kudos

Don,

Something else I might mention. It does the exact same thing if I use the ReportDocumentClass to just print out the report.

These memory exceptions happen on all my images no matter how or where I print them.  If I print them manually through my own code I don't get any exceptions using the same print controller.  I just have to add stuff to the images that I cannot do easily.  This works perfect with COM I know you don't want to hear that.

Thanks

0 Kudos

Don,

It cannot be the print driver simple because this works with the COM control.  It works with the COM control on the same computer using the exact same report. The printer driver is the latest printer drive from HP.

In debug VS2015 you can use the Diagnostic tools to see what it is going on.  When I change the cache page value you can see that it calls the Garbage Collector much more often.  So that fixes the paging issue for sure. So page to page you can see the Garbage Collection cleaning it up.

This does not fix it when printing records so I would suspect since the viewer is not being used in this case and it is printing the report out it has the exact same issue just with printing.

Please let me know.

Chris

0 Kudos

Don,

It doesn't just happen when they preview the images.  It happens when they print them from the preview.  So if they open the preview then select the print button it prints all the pages but after that if they go and do anything else they get the memory exception. The error can be ignored but the application then does unpredictable stuff after the exception.  It really requires the application to be closed and restarted.  I have noticed something in debug.  If I set the value to 1 the garbage collector gets called much more frequent and it shows in debug.  So I think setting it to a lower value is going to fix the memory issue.  It just seems to slow everything down is all.  I can maybe setup the value in my report builder and set the value only if they are printing images.  That way it doesn't slow down my other reports.

0 Kudos

Well that is new info, would have been good to know that sooner... Anything else I should know?

So now it's not the viewer causing the problem it's only when Printing. So it's the Printing/printer causing the memory issue. Try setting the Print button to use PrintOutputController, that uses the ActiveX printer control, same one as the Designer uses and see if that helps.

The default uses the System.Drawing.Printing in PrintToPrinter API, another .NET function.

For an example see my Printer test app - search for KBA 2163438, and it is a property of the viewer and can be changed in code as well.

crystalReportViewer1.PrintMode = PrintMode.PrintToPrinter;

crystalReportViewer1.PrintMode = PrintMode.PrintOutputController;

And likely it's the Printer Driver causing the issue, make sure they are using the latest Printer driver that supports the Framework...

Don

0 Kudos

Don,

I appreciate the response back.  I was reluctant to move from VC to .NET simple because of the performance reasons. I am fully aware of just how slow .NET really is and it seems that Microsoft is the only one hasn't receive or is ignoring the memo.  The sad part is that .NET is just a layer we all talk about c and c++ but .NET uses c and c++ and native win api's.  All they did was create a layer (more wrappers) to make the programming easier for everyone else and it does come with a cost. I guess I had used the RDC for so long and as computers became faster so did my applications.  This transition to .NET has been very tough because version 11.5 of crystal using the ActiveX (COM) is truly a much better product.  I know that this is not SAP's fault.  It is just very hard for me to accept how much of a difference there is.  Lost the prompt screen (prompt.dll) and several other things I have mentioned. It is taking me a long time to get use to all the trade offs.  I do appreciate the help just need to find a way to prevent the out of memory exception.  Waiting another 3 to 4 months will be very difficult my frustration come out because my customers are frustrated with me over these exceptions. I was hoping to get that fixed in SP17 so that I could quiet them down a little.  I guess could always create a vc viewer and call the viewer as a module and use the RDC.  I just need to find a way to view these images without the memory issue.  Thanks

0 Kudos

I completely agree with you, RDC and even the CRPE C++ was much easier to use and a lot less files to distribution and all of that....

But we had to so we are trying to make them functionally the same but the limitations in .NET just can't do it some times... And yes it is basically a layer on top of COM and C++

And we are back to the second part of this post and using GDIPlus...

I tried compiling my app in 64 bit thinking it would help but it's even worse.... Memory jumped to 800+ meg paging through your report, 32 bit only got to 230 meg max.

Is it possible to get more data from you? If so I'll send you a link to upload to or if less than 1 meg you can attach it here.

Did you try setting the value to 5 or anything other than 1 to see if that helps?

Only other thing I can suggest is the ask your users not to page through so quickly.

You never mentioned what happens after the memory error pops up? Can they ignore it and carry on or does it require closing the app and restarting? If it's just an annoying error then simply catch it in a try/catch block and don't let them know it happened...

Don

0 Kudos

Don Just a note on this issue.  There should never be a property on any control that crashes a system or pushes it out of memory if it is not set.  The fact that the CachedPageNumberPerDoc is set to false by default and it is a hidden property compounds the issue.  They really do need to fix this issue with it set to false or true.  Even if that property is set to false it shouldn't cause the control to throw an out of memory exception and cause the images to disappear.  This has caused me some considerable problems over the last three months even before I posted this issue.  I am hoping this can actually get fixed permanently.  The normal behavior is not to click as fast as they can but I can reproduce the issue by clicking each page very slowly.  This issue is pretty common in all .NET controls if disposing of the image isn't done correctly.  The other thing is that the machine is not out of memory on these exceptions.  It happens even on a system that I am using a 64bit OS and has 64GB or ram. So the system is reporting out of memory but it is no where even close to being out of memory. I am hoping that this gets fixed because that line of code you had me add makes the viewer even slower than it was.  I really wish the performance was closer to the ActiveX control.  I have had several customers complain how slow the .NET viewer is.  I know the difference in GDI and GDI+ but many of my reports are three to four times slower on .NET than they are using the ActiveX  control. .NET is slow but it really shouldn't be as slow as it is these reports are displaying the same data as they are using the ActiveX control and using the same drivers.  I would hope that since Microsoft uses thread blocking in .NET that they would implement some kind of threading to resolve some of the speed issues.  I have also noticed that sub reports are much slower as well with .NET. Please mention this to the development team I am sure they can come up with some kind of compromise.

0 Kudos

Hi Christopher,

I understand the performance issues but we are comparing Apples to Oranges....

By the way I've been supporting CR since 4.6 and 5.0 in the CRPE32 DEV Support team and used to do all my coding in C++ as well. The RDC was just a COM wrapper based on crpe32.dll.

The RDC was all C++ COM components and used native WIN32 API's, but when Microsoft announced they were dropping COM for .NET we had to change so We dropped the RDC and started building the .NET assemblies. Of course we all know MS caved due to pressure and still supports COM now but it was too late for us... CR 9 was when We made the biggest changes, removed the Query and SQL Builder components out of crpe32 into their own dll's. Along with updating all of the Database drivers, removed all the custom hacks to work around Client issues and basically followed the Standards, most issues are in the Clients, all DB error messages are simply passed through from the Client.

Our .NET Assemblies they still use COM interopt to pass objects to crpe32, some dll's still require being regsvr32'd. Which is why you can't use the RDC in a dll and host it in a .NET app, to many hops for the interopt to handle so it is not stable.

Back to how to and why.... So with the upgrade to .NET the side effect was performance, typically about a 8% reduction. We've tried on many occasions to get performance up and about all we can do is to suggest loading a dummy report on app open so it preloads all of the CR assemblies, then close that report and CR stays in memory.

As for threading, we can't. In the BOE Servers they all spawn a separate thread for each report job requested, if the job hangs or what ever we can simply kill the thread. The RAS Engine which is still 32 bit and we left it that way for backward compatibility, and it is the BOE Server Management handler, queries the various Services for status and info etc. So it stayed 32 bit and single threading.

You can create a threaded app and use RAS/Engine but for more than 3 jobs you actually will see performance issues. Dan wrote a good blog about this...

So your app is still using the 32 bit .NET components which means the MAX memory is about 1.5 Gig for a 32 bit process, but if it gets that high it's the OS Memory handler that is going to start complaining about memory, again CR is simply passing the error through from the OS. If you look at your app in Task Manager you'll likely see it is getting way up there...

OK back that property. According to DEV it was exposed when it was first created but it caused backward compatibility issues so they hid it. And the default is 10, 1 is the lowest it can go. You could trey different values but this may depend on the OS and available resources so test lots...

Back in SP 9 when I first reported this to them they tried variations on this fix and they too noticed the memory handler problem as well, which is why the API is now hidden, but still usable if you know the format....

So for this issue DEV did not get any solution into SP 17, your work around for now is to use that API and we'll have to see if DEV can get SP 18 to handle the memory problem.

You can see it bouncing around in Task Manager, as soon as you stop it does start to clear up, this is the GC.Collect() being triggered. We're doing it as fast as we can but there may be another way to handle this, which is what DEV will be doing for SP 18... hopefully.

To Sum up:

Performance is and has been know for for a long time, work around is to load dummy report.

API is hidden for a reason, backward compatibility

Fix did not get into SP 17, possibly SP 18

Stop comparing the RDC to .NET, we know it's different and we are doing as much as we can to improve performance and get it to the level of the RDC as for functionality. There are some limitations and functions/feature that simply can't be done in .NET.

Thanks again

Don

0 Kudos

One other thing. For the future they might want to set that property to 1 by default. If it is zero this issue will keep cropping back up like a bad penny.

0 Kudos

Ah so it doesn't, must be hidden for now. Changing default behaviour is not good either.

So real life behaviour is to click the next page button really fast? I noticed it also, as soon as you stop the memory goes down. By default there is about 50K per image when CR loads them. It's party MS issues also, Windows is not capable of defragging memory on the fly like UNIX can, CR requires contiguous memory space...

I'll mention that part to DEV and see what they say...

Thanks again

Don

0 Kudos

IntelliSense Didn't pick it up that was the issue. Might want to expose that to the public It fixes the viewing issue, I hope it fixes the memory issue as well.  I have had a memory overflow exception when viewing many images. Thanks for the help.

0 Kudos

Don,

I added that line but it still does the same thing for me.  Can you send me a code example because this is not working for me at all.

Thanks

Chris

0 Kudos

Download the test app for printing from KBA 2163438. For some odd reason though it doesn't find it so use this link:

Project is attached to that Doc, at the bottom of the page...

and change the open method to this:

    // Open a report and get and fill in the various info boxes
   private void btnOpenReport_Click(object sender, System.EventArgs e)
   {
        // from Soda to handle Viewer OLE Object refresh issue 175343
        crystalReportViewer1.CachedPageNumberPerDoc = 1;
0 Kudos

I need something that has the recommended solution to this issue we are working on.  I do not see any code in that sample that replicates this issue When I set that code that you say fixes my problem it doesn't work.  I need a code sample that we think works so I can test it on my end. Thanks

0 Kudos

I didn't see the rest of the post in the email let me look at it.

0 Kudos

Yes, SCN doesn't refresh the updates automatically, you have to hit refresh.

0 Kudos

This is the property page I am talking about. VS2015 CrystalReports Viewer properties.

0 Kudos

Hi Christopher,

DEV had some more time to look at the original issue, OLE Objects not showing when paging.

They could not replicate the issue until I shared my image with them but then it only happened once, after rebooting the image it worked properly which is strange behaviour....

They also suggested adding this line of code in your Viewer Report button click, But I believe it can be added in the main form load, it should be a global variable:

crystalReportViewer1.CachedPageNumberPerDoc = 1;


I tried that on my main test PC, where I could duplicate it still using SP 17 ( recent built ). Once I added that line I now see every image.


See if that works for you and let us know? Not sure if this line was available in earlier patches.


Thanks again

Don

0 Kudos

My viewer control doesn't have that property for some reason. If I drag the report viewer to a form under winforms that is not a property for me. What am I missing?

0 Kudos

That is odd,

What version of CR for VS are you using?

SP 15 has it:

Don

0 Kudos

I am loading an external report if that matters.  I am not using any embedded reports.

0 Kudos

So am I, should not matter. It's a property of the viewer not the report.

Does the object Browser show the property?

What SP are you using?

0 Kudos

The screenshot of my properties I sent the other day is all I have.

0 Kudos

I am using sp16

0 Kudos
0 Kudos

Ok I didn't realize it wasn't a property of the viewer control itself.  With that being said how to do you actually set it for the viewer?

private CystalDecisison.Windows.Forms.MainReportDocument mainreport;

mainreport.CachedPageNumberPerDoc = 1;

then how do I set the viewer to use this? What property of the viewer do I set the mainreport to?

0 Kudos

Just add that line of code anywhere in your app and it will be used.

I moved it to the Open Report section and confirmed it works there also... Commenting out the line and I again don't see some images..

0 Kudos

This should only be a property for the .NET viewer control and nothing else.  This should not affect anything but the .Net control.  It is as simple as adding a public setter and getter for the interpolation mode. The values of the property will be the interpolation enum in GDI+ that is it.  This should actually be able to be implemented into the .NET viewer control with less than 20 lines of code. Then when the control is drawn use the interpolation mode property to draw the control.  The default interpolation should be set to nearest neighbor like it is now.  This implementation should not require any menu or dialog changes to the c++ version of the software this involves just the .NET Viewer control. Also should not be a part of the toolbar or any menus.

You have many properties already.

DisplayBackgroundEdge

DisplayStatusBar

DisplayToolbar

EnableDrillDown

EnableRefresh

InitialFocus

ReportSource

and all of the Show properties

Should be able to Add

InterpolationMode

and use the GDI+ interpolation modes (enums) an exposed property in the .NET control. Nothing gets stored in the registry or anywhere it is a design and runtime property of the control. It will be added automatically to the Designer.cs when the control is added to the form.

I can help if it is needed.

0 Kudos

Yeah that is bad my customer is down until this fix is applied. That is a long time to not be able to do the work they are required to do.

0 Kudos

Hi Christopher,

I discovered R&D broke the fix I originally sent to them in some update in SP 14. If you go back to SP 13 it will get you going until SP 17 is out.

Don

0 Kudos

Thanks for the information Don, version 13 works but I keep getting an out of memory message any idea what I can do about that?

0 Kudos

Same issue then, try 14. Otherwise only option is to wait for 17.

0 Kudos

Is there a way I can get a hotfix?  I am installing a very large system next week.  They use this particular report daily.  There is no way they can wait until the end of May.  Thanks

former_member183750
Active Contributor
0 Kudos

Unfortunately, SAP does not release hot fixes - not for CRVS. So, end of May it will have to be.

- Ludek

Senior Support Engineer Product Support, Global Support Center Canada

Follow me on Twitter

Got Enhancement ideas? Use the SAP Idea Place

0 Kudos

When do you think 17 will be released?

0 Kudos

End of May is when it's scheduled for

0 Kudos

Thanks for the help Don.  Can you mention to them adding a property for interpolation mode.  It would not be very hard for them to add and it would improve the viewer 100%  This will allow the zoom to display better and images much better.  They can leave it defaulted to nearest neighbor. I want the high quality bicubic.  This will help with many of my applications.  GDI+ required the interpolation be set. GDI used the best quality.

0 Kudos

Hi Christopher,

I'm going to fix the interpolation mode issue. I need to confirm with you the solution first.

Is it enough for you if I set the default interpolation mode to high quality bicubic instead of adding a property?

To add a property need to change the menu. If you only hope to improve the quantity of the image, I think to set the default mode to high quality bicubic is enough.

SAP dev. Grace

0 Kudos

Setting the interpolation mode  to High Quality Bicubic is perfect for me, it will render my images in my reports much better and closer to the active X control.  The only reason I mentioned making it a property is because it will slow down the painting of the viewer and you might have some customers that complain about performance is all.  You currently have it set to nearest neighbor and that is the fastest GDI+ drawing.  I just wanted to make sure you didn't break it for other customers is all. I need the quality over the performance my customers expect to be able to see a preview of the actual report and nearest neighbor isn't good enough quality for that.  Guess I don't know what you mean by changing the menu, I would have expected that you create a property on the control and set the default to nearest neighbor. That makes it works the exact same what that it does now. Then the people that want the better quality can adjust it to all the interpolation modes. It wouldn't be any different than any of the other properties that are exposed now.

I really appreciate the change.

0 Kudos

Hi Grace,

Can you explain what you mean by Property menu? Are you suggesting you don't want to add a new property to the Report Options page and just set it as the default?

I'm concerned about introducing a regression issue. Can this but handled by a registry key? I think this may be a better way to add this enhanced feature.

Send me e-mail if you want to discuss direct?

Don

ido_millet
Active Contributor
0 Kudos

A registry entry is not ideal. A runtime property, as suggested by Christopher above, is easier to set in code (changing registry is a sensitive move in some environments).

0 Kudos

If DEV agrees it would likely be both, we can't change anything by default and for those not using the SDK they need to be able to use the new functionality also.

0 Kudos

That is perfect.  I can tell you it is not fixed It is getting memory exception error.  It works perfectly in the designer.  You need to open this in the newest .NET viewer. Go next and previous and you will see the exception.  The File is there whatever you did was perfect.  SO you can go look at it now

0 Kudos

Try this one:

Removed link

0 Kudos

This issue reminded me of an old case and I found it...

It was fixed in SP 10. If you can send me the report with saved data I believe I can replicate the issue then.

I have to go back through my e-mails now though, I think this problem had something to the with the graphic engine in Windows. It was easy to replicate just by paging through the report, got to next page then to last page then back to first then to page 10 and sometimes the image did not render...

I'll see if I can find the report I used to replicate the problem also...

I found the KBA I created - 1921124 - .NET Crystal Viewer losing images when paging back and forth really fast

It was fixed in SP 7 and 10.

Since I can duplicate the problem again in Build SP 17.2000 I'll escalate this once again.

Don

0 Kudos

Still need your report with saved data... I can't find the one I used 5 years ago....

The Designer uses GDI, .NET uses GDIPlus for the framework, there are known issues with GDIPlus, some we can fix/work around and some we cannot....

0 Kudos

That zip file has the Books.rpt with the saved data in the report.

0 Kudos

That zip file has the rpt with saved data and the tiff images included.  This issue you can resolve for sure I have had this same memory error before with a .net application I wrote in GDI Plus.

0 Kudos

Got them... and I do see the problem...

I know I discussed this with DEV once before but I can't find that specific thread.

I'll ping them again to see if they remember this one...

Thanks again

Don

0 Kudos

It is how they are clone the image from the file that causes the issue.

0 Kudos

Great, can you elaborate?

0 Kudos

Sure, I don't know what .net class and method they are using to lead the image into .net. If I knew what method they were using that would be helpful.

0 Kudos

Hi Christopher,

I escalated this to DEV - Incident 175343 2016 Paging through report with linked OLE

Should be fixed in SP 17.

Thanks again for the files...

Don

0 Kudos

Well I need to get this report to someone that can replicate it.  Everything we have tried doesn't work.  So I just need to send someone a simple report with saved data.  It has been impossible so far to get this report to anyone.

0 Kudos

I really need to get this to you somehow. So I can get it fixed I cannot delay another month my clients will go crazy.

0 Kudos

That link lets me download files just not upload them. I really need to get this to you somehow, I am running out of time.  I have to get this fixed my customer will not be able to function without it.

0 Kudos

Not that it is cut off just that I do not have that option to upload anything.

ido_millet
Active Contributor
0 Kudos

Can you replicate the problem using a dummy rpt with no data source but a bunch of images placed in RHa, RHb, ... sections with each image having a Graphic Location specified as a static "c:\temp\..." expression?

If so, perhaps you can provide access to that rpt and image files using DropBox (or similar approach).

That would allow others to try and replicate the problem.

0 Kudos

Don,

I can prove it is an issue with the viewer it is having a memory issue it shows up on the debug of .NET.  I need to get it fixed. So I need to get this to the developers or someone that can fix it. I have reproduced the error in a report.  I need to get that report to someone that can fix the issue with the viewer.  What do I need to do to make this happen? Please help me.  I have spend months on this and I am in the exact same place.

ido_millet
Active Contributor
0 Kudos

My message above suggest a way for you to allow others to replicate the problem.

If Don can replicate the problem on his machine, he would be able to escalate.  Without this, you won't see much progress.

If on the other hand we can't replicate the problem, it may be possible to identify what is unique about your use scenario.

0 Kudos

none of them have the advance feature for me.

0 Kudos

I do not have that option.

0 Kudos

Did you click Reply first?

What Browser are you using?

Try Firefox, the one I'm using.

0 Kudos

Where is the use advanced? I don't see it in the menu!

0 Kudos
0 Kudos

Please let me know where I can send the project. Thanks

0 Kudos

You can attach up to a 1 meg file to this Post.

Remove all of the file in \debug and \release folders to free up space and the zip the project up and then add a .txt file extension to the zip file.

Click on the Use Advanced editor and you can attach the file.

Make sure it has no private info, anyone will be able to download it.

Don

0 Kudos

By the way after that first error it throws more on each image I try to lead. A generic error occurred in GDI+ Exception caught System.Runtime.InteropServices.ExternalException.

ido_millet
Active Contributor
0 Kudos

Does the problem go away if you make sure the image matches the picture dimensions (in Crystal) precisely?  If so, there's a way to automatically solve this problem.

0 Kudos

Not really.  The .net viewer uses the low quality method to draw the screen.  The image looks ok at 100% but it still doesn't look near as good as it does in the designer or using windows image viewer or something like that.  Those applications use GDI and high quality drawing methods not nearest neighbor.  I will try anything you recommend at this point with the quality issue because even reports that have no images look terrible when resized smaller than 100 percent.

0 Kudos

Found it.  It throws an exception in debug mode. 'System.OutOFMemoryException' in System.Drawing.dll("Out of memory"). I am getting this message after 4 to 8 images are loaded. If I refresh it recovers apparently and then it lets me access 4 to 5 more images.  These images are not large at all. They are tiff bitonal images ranging 25k to 150K compressed.  So there is something going on in the .Net viewer that doesn't happen in the com control or designer.  I can send a project using the latest SDK and visual Studio 2015 using 4.5.2 .Net framework.  You can see it with your own eyes Thanks