Display reports with non-modal messagebox - vb.net

Am writing a VB.Net app written in VS2010. This displays some reports in several forms. (Am using Crystal Reports though this is incidental to the problem). The user needs to be able to check these, then confirm if he wishes to run the update process or abort.
My first idea was to ask the user to reply using a messagebox. But of course this is modal, so the user cannot browse through the reports.
I thought of other options but each seems to have problems:
- export the reports as PDFs, then display report in external Adobe Reader Window using System.Diagnostics.Process.Start("AcroRd32.exe", filename). This seems messy.
- create a non-modal message box or equivalent. This loses any concept of program flow, so am unconvinced by this
What ideas do you have please?

You should already be using a form to display the report(s). Put all the reports on the same form with scroll bars enabled and add a button to that form for the user to 'Update Process'.
You may come up with a better display based on how many reports you want the user to look at - like a drop down at the top with list of reports in it OR a radio button list on the left with reports listed etc.

Related

Make a VBA form appear in windows task bar

I am programming a little application (an overgrown macro really) in Visual Basic for Applications in Office 365. What it does is:
Displays one window that has a few input fields.
Once I fill out those fields with data I can press a button on the form and a summary in a nice graphical form is displayed in a second window (a second form is displayed using UserForm2.show).
The second user form can be updated with new data by typing in updated text in first form and updating the second form by pressing a button on the first form (in the form of UserForm2.TextField1.Text = UserForm1.Label1.Text.
Both forms are modeless so the user can work in Outlook whilst the forms are running.
All works fine except one caveat:
Both forms are not visible on the Windows Taskbar, in the Task Manager, but most importantly they are not visible as separate windows to teleconferencing software we are using. And this is the macro's sole purpose.
Question: Is it possible to make the entire macro (or just UserForm2) run as if it was a separate application, so it appears in the Task Bar as a separate window, and not an internal form running inside Outlook?
The idea is not to run it independently of Outlook (or Excel), but to make them visible to external programs.
I tried a few options available on the Internet, but none of them work, and honestly I do not know where to begin, or how to circumvent it if it is not possible to do directly within the available API. Can you advise?

VB.Net application halted while printing crystal report in client environment

I am currently developing a vb.net application in VS 2005, with crystal report XI. I have come across a a problem where my application halted while printing reports. There is no error in my application, it's just that I can't click on any part/menu in the application while printing. The user opens the printing window form from the menu item, the form opens, he clicks on the 'print' button and it will print directly to his printer without preview. After a successful printing session, a text message box will display 'Printing success!'. Only then the user can continue click on other part/menu of the application. It would be troublesome during printing a large number pages of report, because the user have to wait all the pages finished printing only then they can continue to click on other menu of the system. Fro example, when I execute the printing window form (let's say form A), other posting form (Form B) becomes freeze. Below is my code for calling the report and directly printing to their printer.
my code snippet
I have to use simplex and duplex because the users requested the reports to be one-sided pages. My question is how to allow users to click on other menu/doing other posting with the system while printing those large number pages of reports?
Thanks for any help/input.
Turns out what I wanted was a background worker

How to use vba to switch between open tabs in Lotus Notes?

I'm currently trying to generate multiple forms in lotus notes via VBA in a specific database and send them for processing. Due to several notes scripts running when creating/processing the various forms, the only theoretical way that I can imagine this to work would be to have the user open a form, so that the VBA script can tell it to do copies through a button in the form (via the Windows API), then cycle through the open forms, fill them out and submit them one by one.
So far so good, but I'd need to be able to cycle through all the open forms in Notes in order to find the form I want to fill out and set is as active window. I can't seem to find any API that allows a user to go through all the open tabs in a notes window. Would anyone be able to help me on this one, please?
Many thanks in advance.
What you want to do is not possible. There is no way to "cycle" windows via code in Lotus Notes / IBM Notes.
Better turn around your processing: Instead of opening a form for editing just fill it in the backend. Then you don't need Windows API- calls and the Clipboard at all.
of course you can open the filled form afterwards to let the user fill in additional information, but this is not necessary at all as you can also save the document in backend.

Dont hide a menu/menuitem on click

I am using vb.net and don't want to use WPF.
I have a menustrip having many menus.
These menus have many menuItems.
When I click on any menuItem I show a new form to the user.
When user finish his work and return to the main form he should be able to see the menu as it was while he left the main form.
I mean when I click on a menuItem the menu closes. But I don't want it to close.
It will likely be more confusing for your users having a menu that never closes because it defies expected behaviour. You are better off using one of the other controls suggested.
Every Operating System (Windows, Mac etc) define a standard set of controls for a reason - to enforce consistency and predictability across multiple applications. It's why you know to look to the menu to find a command. Microsoft, Apple etc all produce "design standards" documents that specify a baseline for the way that your user interacts with your app.
If a user selects something from the menu and the menu never closes, the user could well think that your application is broken.

VB.NET forms keep disappearing while system is in use

We have a "Core" system that we use to run the business and there are about 15-18 people using it at any one time. The program is written in VB.NET and has about 165 forms.
The way it works is when the user runs the program he/she is prompted to log in and if the login is successful a "Main" form is displayed with a number of menus (Customers, Suppliers...). From there they can click on the menus which open another form on top of the "Main" (the "Main" form needs to be visible in the background because it displays information that is relevant to the users while they are in other screens)
The issue we are having is that if the users have other programs open while using the "Core" system (Outlook, Word, Chrome, anything really) and switch to another program and then back to the system, it only displays the "Main" form and any other forms open on top disappear. The way we get around this is by switching back to the other programs they have open and clicking on the minimise button in the top right corner of the window until all the other programs are minimised, which only leaves the "Core" system visible. However this is becoming a nuisance to all the users (including myself and the other developer) and we really need to sort this issue out in order to keep out staff happy :)
I would appreciate any advice or pointers in the right direction which will help us solve this issue and please feel free to ask if you need any more information.
It seems you are creating the ChildForm from the MainForm but the ChildForm itself is showing itself with Me.ShowDialog(). What you should probably try is showing the form from the MainForm and passing the MainForm in as the parent. This should keep the form tied to it's parent and on top. For example:
childForm.showDialog(Me)
Where Me is the MainForm. This is the documentation for that method.
This is the important part:
Owner Type: System.Windows.Forms.IWin32Window
Any object that implements IWin32Window that represents the top-level window that will own the modal dialog box.
Does that make sense?
Changing code to show dialog will change behavior of your code little bit, like your main from execution will hold till you close child form
But you can you use only show as child (not dialog)
childForm.show (Me)
This will not change anything except whenever you click on main form it will display its entire children on it.