How to cancel or delete row while printing out display

Posted by: hobbykitjr on 4 August 2017, 3:07 pm EST

  • Posted 4 August 2017, 3:07 pm EST

       Running Active Reports Build for VB6 (SP6) Version 9782.
    Im building a report from a Recordset and i want to include an option, that if the values are all 0, not to print out that line.
    The problem being i only know if i dont want to print it out once im in that sections(details) Format Event.

    I have looked for a way to (on Before_Print) Cancel printing this row, or afterwards delete that row but can't find it.
    For Simplicity i wont explain why i can't alter my Querey to not grab these rows, but is there anyway to do this?

    I have tried  setting the section to invisible but it will only work on the following row since it has already started printing.
    I have also tried (in Format) to move next in the recordset if i dont want to print this row out. But if the last row or rows are all 0's then it will eventually have to print out something.

    I appreciate anyone who can help answer if this is possible and explain how.
    Thanks in advance,
  • Replied 4 August 2017, 3:07 pm EST

            Thank you for your question. If I understand your question correctly there are few ways you could approach this situation.

    1)    Within your FetchData event perform a check to see if all of the data is 0 and if so skip adding it to the field (this would be an unbound approach).

    2)    Check the value of the textbox or label in the sections format event to see if it is 0, and if it is set the controls (not section) visibility to false or height to 0.

    I hope this helps. Please let me know if I can be of further assistance. Thank you!

  • Replied 4 August 2017, 3:07 pm EST

    In Playing i had thought of the FetchData Event but it still would attempt to write things out until i set the EOF paramter of the event to true as well.
    This fixed my problem but increased the wait time for the report heavily (Once all the calculations are completed and are not zero, they must be done again down in format)
    This works for now and i just added a disclaimer. Thanks for your reply,
  • Replied 4 August 2017, 3:07 pm EST

    Thank you for your reply. I'm happy to hear everything is working well now.

    Please let me know if i can be of further assistance. Thank you!
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels