ActiveX Control Does Not Display Fully On MS Access Report Object

SpaceCoastLife
SpaceCoastLife used Ask the Experts™
on
Hello,

I am running into quite an unusual problem and was wondering if anyone has experienced this issue before. I have an ActiveX Control that I have made that uses a Picture Box and displays an image from Azure blob storage by converting that image's memory stream into an image. I use this ActiveX Control for a Microsoft Access 2002 application. This ActiveX Control works great on forms, but on reports it doesn't display fully (Please see attached images). Anyone know why?
ActiveXFullyDisplayed.PNG
ActiveXNotFullyDisplayed.PNG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
AndyAinscowFreelance programmer / Consultant

Commented:
print, preview or both?
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
image's memory stream into an image

 What kind of image?   Keep in mind that with printers, they don't draw the same as an image on the screen.    I see "Browne" in the second image; are you using something of Allen's to render this?

Jim.

Author

Commented:
What kind of image?

Hi Jim, thank you for your response and sorry for my delayed response. The "Image" is just an object. It can be of any type (.jpg, .jpeg, .png, etc...). The ActiveX Control is coded in C#.

public void DisplayAzureBlob(MemoryStream memoryStream)
        {
            if (memoryStream.Length > 0)
            {
                var image = Image.FromStream(memoryStream);
                AzurePicture.Image = image;
            }
            else
            {
                AzurePicture.Image = AzurePicture.BackgroundImage;
            }
        }

Open in new window


I see "Browne" in the second image; are you using something of Allen's to render this?

Something of Allen's? I am not quite sure what you mean. "Brown" is just a text field. It is the last name of the client that the ID Badge is for.
Should you be charging more for IT Services?

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
print, preview or both?

AndyAinscow,

Thank you for your response. It is happening in both print and print preview.
AndyAinscowFreelance programmer / Consultant

Commented:
OK - so less likely to be a printer problem in that case.

Could the memory stream not be completely filled?  (   --- Odd though if it always works on the form)
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
ActiveX Control that I have made

 Sorry, I missed that.

Something of Allen's? I am not quite sure what you mean. "Brown" is just a text field. It is the last name of the client that the ID Badge is for.

 Allen Browne has many Access tips, tricks, and code on his web site and I thought this might be related.  Although Stephan Lebans was the one that was really into the graphics processing with Access now that I think about it.

 As for the answer; I'm at a loss.  This is an area I've never played in.   I know Access is rather unique in it' requirements for Active-x controls.   I've been told that it doesn't have complete support for the iDispatch interface, but I'm not sure if that's correct or not.

 I do know for sure that many Active-x controls will not work with Access 100% correctly and that they must be specially written to support Access.  What that involves I don't know and there are only a handful of people that have done so, most long ago.

 Unfortunately, that does help much :(

  My only suggestions would be:

1. See if it's a result of a specific image type, and if so, avoid that by converting to something else.
2. Convert the image to a supported type if needed, stuff it in a file on disk, and then let Access load it using an image control.
3. Buy the commercial control dbPIX:

http://www.ammara.com/

 and then if it doesn't work, it's their problem<g>.  Note however this would still involve you getting the image into a disk file.

4. Try a different printer driver.

Jim.
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
There are two report settings BTW,

LayoutForPrint
FastLaserPrinting

That controls the rendering.  I don't think either applies here, but it would be easy enough to test.

and one thing I have run into in the past is a setting on the printer driver that applies is if it draws the page as a bit map.

AH, and one last thought; Make sure that control is on top and its background is not set to transparent.

Jim.

Author

Commented:
Could the memory stream not be completely filled?  (   --- Odd though if it always works on the form)

AndyAinscow,

That's what I was thinking. It wouldn't logically make sense that the memory stream wouldn't be completely filled if both the form and report are passing the exact same parameters to the exact same function.

Author

Commented:
I've been told that it doesn't have complete support for the iDispatch interface, but I'm not sure if that's correct or not.

Jim,

My ActiveX Control does implement this interface and I have no issues with calling the functions from MS Access that are declared in that interface.

stuff it in a file on disk, and then let Access load it using an image control.

This is actually the work-around that we are doing right now.

I have tried your other suggestions and messed around with the printer settings and still have no luck. :( .Does anything else come to mind?
AndyAinscowFreelance programmer / Consultant

Commented:
Just to clarify things.  Please confirm.
  • On a form this activex will always show correctly.

  • On a report it never works correctly.
  • On a report it works correctly at times and other times fails.
  • On a report it works correctly for some image types but not for others.
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
<<Does anything else come to mind?>>

 Sorry, but no, nothing else comes to mind.

Jim.

Author

Commented:
Just to clarify things.  Please confirm.
  • On a form this activex will always show correctly.

Yes.

  • On a report it never works correctly.

Yes.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial