473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to Hide Ole Objects on a Report if they are empty so as not to leave a big gap on

2
I have a report that has several ole objects in it attached to several Headings. Some objects may be left empty and I would like to hide them so that there are no big empty gaps on my report. I have used the following instructions, but it doesn't work unless I put the name of every object in the "On Format" line of the details section of my report e.g. =hidenullole([OPPhoto1])+hidenullole([OPPhoto2]) etc
Is there a way to check through every object on my report and hide the ones missing.
Instructions I have used: Create a module ->
Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Function HideNullOle (ctl As Control)
  3.    On Error Resume Next
  4.    ctl.visible = Not IsNull (ctl
  5.    If Err = 2427 Then ctl.visible = True
  6. End Function
I have also set the CanShrink to Yes in the details section of the report and the instructions say to put =hidenullole([ctl]) in the "On Format" line of the properties.
I have also added unbound text boxes on the report to overlap the photos etc.

If you understand what I am getting at, I would really appreciate some help.

Thanks
LH
Dec 17 '12 #1
3 3182
NeoPa
32,556 Expert Mod 16PB
Hi Linda. Are the gaps vertical or horizontal?

For horizontal gaps you could write some code that processes through all Controls in the report section and subtracts X units from the .Left property of all controls where .Left is greater than Y. X ==> The amount you want to move things left; Y==> The .Left of the hidden control.

Likewise, you can balance things towards the centre using similar logic if that suits better visually.

Vertical gaps are as straightforward if all within the same section. If going across sections then I have far too little information even to think about this.
Dec 17 '12 #2
Lindah
2
Thank you NeoPa,
They are the vertical gaps and I have managed to close the gaps in a very long-winded way using the instructions that I was first given. As you can tell I am not an expert in this but do like to find the answers on this site. So thank you very much.
LH
Dec 18 '12 #3
NeoPa
32,556 Expert Mod 16PB
Are these vertical gaps enclosed within a single section (EG. Detail; Group Header; Group Footer)?

Can you show us what you've got so far. You refer to "instructions you were first given", but I see no explanation of what that might mean (unless to my post #2) so it's not something that means anything to us.

I'm pleased to hear you find the site helpful. I'd like to be more so, but am a little frustrated by lack of understanding of what I'm trying to help with.
Dec 18 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mark Turney | last post by:
Problem: I have a vector full of two different derived class objects (class B and class C) that are derived from the same base class A. I want to loop through vector and invoke a member function...
2
by: Den | last post by:
I have a report where at the report footer, I have a field that sums up the total of a field in the report. My problem is, when the report is empty the field shows #error. Would someone tell me a...
1
by: BerkshireGuy | last post by:
Hello everyone, I have an agency report where the lines looks something like this: Agency Code Percent Sold Total Premium ------------------------------------------ J1 50% ...
7
by: Darin | last post by:
I have a report that sub-totals on a group, then grand-totals at the report footer. If there's only one group, the sub-total and grand total are redundant, so I only want to show one of them. I...
0
by: voroojak | last post by:
Hi I have some problem with report service in sql 2005. what ia mdoing is that when the report is generated first just show some columns and if they wants to see the details they have to click on...
5
by: Cyril044 | last post by:
Hi guys Me again. I just cant seem to get the hang of .NET 2005. I am having a problem with viewing reports. I manage to publish and install my program on the clients machine but now i have...
4
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I have created a report. This report needs to display records between two dates entered by the user. I put two text boxes on the report so I can enter the start and end date - I set them to use an...
2
by: talkaboutquality | last post by:
Need to define a macro as, say, #ifdef NEED_FUNCTION foo(x) #else #endif
3
by: Rhys Gottwald | last post by:
Hi All, I have a subreport that is going to be empty for some lines, so I want it to be hidden it on those lines. I have set the the report and page header to not visibel, set the can grow...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.