How to calculate date/time differences in Visual RPG for .NET
Back in the halcyon days of RPG II/III, calculating differences between two dates or times was enormously complex and took tons of code (does anyone else remember Paul Conte’s multi-part "Ultimate Date Routines" series in NEWS/400 magazine?). Well, that was then and this is now. .NET offers superb date calculation capabilities. Let’s take a brief look at how to use them. Let’s say you wanted to know how long it’s been since the Beatles’ US debut on Ed Sullivan’s stage on February 9th, 1964 and the last time they played together live on that blustery rooftop in London (with the late, great Billy Preston on the organ) on January 30th, […]
Working with the ASP.NET ListView and row and column clicks
See code on GitHub The ListView is a worthy alternative to the GridView control. With the ListView control, you are 100% in charge of the markup produced. This makes the ListView much better suited to pages where you need complete control over the markup, such as when you’re using a CSS framwork like BootStrap. However, the ListView’s model for determining row clicks is quite different from the GridView. This article shows how to determine what row and column got clicked with the ListView. The ListView’s OnItemCommand property The OnItemCommand binds an event handler subroutine to the ListView’s OnItemCommand event. Unlike a GridView, the ListView’s internal controls (those defined in the […]
Using FTP to send and receive IBM i source members
Occasionally you might need to send or receive a source member from/to your Windows PC and the IBM i. Assuming your IBM i has FTP enabled, it’s a snap to perform this task with Windows’ built-in FTP client. To further explore FTP on Windows, see the list of Windows FTP commands . To start FTP on Windows, open a DOS command line and type FTP and press enter. Use the following commands to receive or a send a member from and to the IBM i. Use these FTP commands to retrieve an IBM i source member to a PC file:
1 2 3 4 5 6 |
ftp open <IP address or server name> (Enter user ID and password as prompted) quote site namefmt 0 ascii get library/file.member pcfilename put pcfilename file.member |
The quote site namefmt 0 command enables the library/file.member naming for the ftp […]
Printing to PDF with ASNA Visual RPG for .NET
Distributing reports as PDF files is a very common practice in the enterprise. ASNA’s DataGate print files are designed to print to one of your installed Windows printers. Printing to PDF with AVR is therefore a pretty simple task of using a PDF print driver and then printing to that virtual printer. These drivers redirect print file output to a PDF file. For use with fat client Windows programs, you may get by with low-end, or even free, PDF print drivers. There are many of these available. However, in every case, these low-end drivers are single-threaded and not for use in the multi-threaded world of IIS. Alas, then, these drivers […]
The .NET Saga: From .NET Framework to .NET
In early 2002, Microsoft officially released .NET Framework 1.0 to the world. This was a big bet from Microsoft that aimed to replace the aging and ailing COM development model. .NET Framework was part: a competitive response to Java an amalgam of various languages and integrated developer tools an attempt to make it much easier to create enterprise Websites and Web services At its launch in 2002, Bill Gates described it as "the first fully integrated development environment for building XML Web services and next-generation Internet applications." As with everything else Microsoft did back then, .NET Framework ran only on the Windows platform. .NET Framework compilers don’t generate processor-specific instructions, […]
How to stretch ASP.NET session timeout
Most AVR-driven ASP.NET Websites use the Session object to save the state of some variables. For example, a customer number may be stashed in a Session variable like this:
1 |
Session['custom-number'] = 673 |
when the user requests a page (the same page or another page), that value is available for your logic to fetch and do something with. For example, let’s assume the user clicks a button to take the app to a new page and that page’s logic needs the current customer number. That number could be fetched in the code-behind like this:
1 |
CustNo = Int32.Parse(Session['customer-number']) |
(As an aside, session variables must also be converted to a specific type before assigning them to a typed […]
Tips for upgrading from ASNA Visual RPG Classic 4.x to 5.1
We’ve had several questions lately about upgrading from ASNA Visual RPG (AVR) 4.x to Visual RPG 5.1. Here are a few tips as you plan for that upgrade: Although AVR 5.0 is still supported, we strongly recommend upgrading from AVR 4.x to AVR 5.1. AVR 5.1 is compiled with a much new C++ compiler and positions you better for future Windows changes. AVR 5.1 does not coexist with AVR 4.0 or AVR 4.1. You need to remove any old versions before installing either the AVR 5.1 developer version or deployment. If you need to support both versions for development, we recommend using Windows virtual machines for each developer version. When […]
How to upgrade ASNA DataGate WebPak
The ASNA WebPak is the DataGate client for Windows Servers. It is to Windows servers what the Client Deployment binary is to Windows clients. The WebPak should be installed on any Web server on which you’ve deployed an AVR ASP.NET Website/Web services or Monarch migrations. Installing WebPak is very simple; you just run the WebPak’s executable to install it. Previously-created database names continue to work with a new WebPak install. A Web server does not need multiple versions of WebPak. Windows policies ensures that the highest installed version is always used at runtime–and installing a newer WebPak deletes the previously installed version. End DataGate IBM i end user jobs first […]
Working with numeric dates in AVR for .NET
Working with dates is something many RPG programs do extensively. In the old days of AVR Classic, we used to have to use lots of data structures and other special-case code to format dates, convert dates. It was also quite challenging to do date arithmetic and perform other sophisticated date manipulations. AVR for .NET’s Date, Time, and *TimeStamp help resolve all of these issues. However, many shops still store dates (and times) as numeric values in their database. This seems to preclude using some of .NET’s really great date handling and manipulation. This article changes that and shows how to integrate your numeric date and time values with .NET’s great date and time handling.
How to easily take an ASP.NET site offline
All Websites or Web servers need maintenance from time to time. This article shows a very simple little ASP.NET tip that can easily keep users from accessing your site during maintenance. This is something to consider doing anytime you need to upgrade your ASNA WebPak or DataGate for IBM i, or redeploy your Web app. To keep users from using your ASP.NET site while you’re doing maintenances or upgrades, all you need to is add an HTML file named app_offline.htm in the root of the site. The name is very important–it’s not case sensitive but it must be named exactly as shown (app-offline.html won’t work.) When this file is present, […]