VARCHART XGantt - Frequently Asked Questions
1. What can be Done if Printing Problems Occur in my Gantt Chart?
If in a VARCHART ActiveX Gantt chart printing is impossible or if you cannot set up the printer, please verify whether the file vcprct32.dll exists. Also, please verify if the file can be located by the PATH settings, and if the Windows default printer was set up.
If the file vcprct32.dll does not exist, please contact the support of NETRONIC Software GmbH.
2. How to Make VARCHART XGantt Use a Modified INI file
Some of the Gantt chart settings in VARCHART ActiveX cannot be modified on the property pages. Still, you can adjust them by the INI file:
- Open the General property page. The Configuration file field shows the current configuration file (for example project.ini).
- Please click on the Browse button. The Load/Save dialog will open. Please enter a file name into the Temporary data file field to be used as a temporary dummy configuration file, such as dummy.ini. Click on Save.
- Now click on the OK or Apply button of the General property page. The configuration file dummy.ini will automatically be generated and applied.
- You can now modify your INI file which in our example is the project.ini, by some text file editor and save your changements.
- On the General property page, select the modified file in the Configuration file field (project.ini) and click on OK. Your modified INI file is being effective from now on.
3. How can Context Menus in a Gantt Chart be Disabled?
You can prevent a predefined context menu from popping up in a Gantt chart by setting the returnStatus to vcRetStatNoPopup. The below programming samples apply to the ActiveX edition and VB6:
//switching off the context menu of the diagram
Private Sub VcGantt1_OnDiagramRClick (ByVal x As Long, ByVal y As Long, returnStatus As Variant)
returnStatus = vcRetStatNoPopup
End Sub
//switching off the context menu of links
Private Sub VcGantt1_OnLinkRClickCltn (ByVal linkCltn As VcGanttLib.VcLinkCollection, ByVal x As Long, ByVal y As Long, returnStatus As Variant)
returnStatus = vcRetStatNoPopup
End Sub
//switching off the context menu of nodes
Private Sub VcGantt1_OnNodeRClick (ByVal node As VcGanttLib.VcNode, ByVal location As VcGanttLib.LocationEnum, ByVal x As Long, ByVal y As Long, returnStatus As Variant)
returnStatus = vcRetStatNoPopup
End Sub
4. What Prevents Nodes in a Gantt Chart from Being Generated Interactively?
Nodes in a Gantt chart can only be created interactively if:
- ... on the General property page the check box Allow creation of nodes and links was activated
- ... in the programing code the property AllowNewNodesAndLinks was not set to False
- ... the return status of the event OnNodeCreate was not set to vcRetStatFalse.
Sub Form_Load
VcGantt1.AllowNewNodesAndLinks = False
End Sub
5. How can VARCHART XGantt be Licensed?
If you wish to continue an expired license or to register a component for the first time, please open the Licensing dialog box on the General property page and click on the Request button.
Then the Request License Information dialog will open. Please enter your registration number, your name and the name of your company and click on Send email to NETRONIC. An email to NETRONIC will be generated automatically. As soon as we have received it, we will generate your license code and return it to you.
Please copy the license code to the text field of the licensing dialog and click on the button Activate License. Please leave the property pages of VARCHART XGantt by OK. Re-open some property page, make some change and store it. The new license will then be activated.
6. How to Integrate a License File into an ASP.NET Website Project of Visual Studio 2005
In a website project, Visual Studio 2005 stores the license information for XGantt ASP.NET to the file app_licenses.dll. When building a project (Build > Rebuild all), the file is not updated. If you received a new license file, it is necessary to go through the steps described below to enforce the acceptance of the new license:
- Open the project in VS 2005
- In the project explorer, click on the file NETRONIC.XGantt.Web.dll, which you can find in the directory bin. In the field Auto-refresh path the property window indicates the folder from which the file NETRONIC.XGantt.Web.dll is updated automatically.
- Please close VS 2005.
- Please copy the license file NETRONIC.XGantt.Web.VcGantt.lic to the folder mentioned in step 2.
- Please open the project in VS 2005.
- Please rebuild the project by clicking on Build > Rebuild all. The license file is now copied to the bin folder of the project.
Please close VS 2005 and re-open the project in VS 2005. - In the project explorer, please click on the file licenses.licx by using the right mouse button and select build runtime licenses from the pop-up menu. The file app_licenses.dll will be rebuilt and the new license information will be copied from the file NETRONIC.XGantt.Web.VcGantt.lic to the DLL file.
- Please close VS 2005 and re-open the project in VS 2005.
- Re-build the project by Build > Rebuild all once again.
7. What if Problems Occur with Registering?
If during registration of VARCHART XGantt an error message occurs "REGSVR32 Error Return: 0X0000007e", the file vcprct32.dll does not exist or is not stored in a directory specified by the PATH.
If during registration of VARCHART XGantt an error message occurs "REGSVR32 Error Return: 0X000000b6" and "Number 6877 not found in dynamic link library MFC42.DLL", the file mfc42.dll does not exist or is not stored in a directory specified by the PATH.
If one of the files does not exist, please contact the support of NETRONIC Software GmbH.
8. How to Unhide Overlapping Activities in a Gantt Chart
To avoid bottlenecks in holiday rosters or machine allocations, overlapping activities in a group can be made visible.
Activities in Gantt charts can overlap if the activities were grouped and if on the Sorting property page the Nodes in one line option was selected. With the Nodes in one line option, the activity groups can be collapsed and expanded. If a group was collapsed, overlapping activities cannot be detected in a Gantt chart. If a group is expanded, the activities are staggered so that overlapping activities become visible.
To make overlapping activities in a group visible, select the Nodes in one line option on the Sorting property page to display the activities of a group in one line. If the activities of a group overlap, they will be displayed in different lines of the Gantt chart even when the Nodes in One Line option is activated, allowing you to see collisions at a glance.
If the activities were collapsed, overlapping activities cannot be detected. Therefore you should deactivate the Modifications allowed option to inhibit the user to switch between these two types of display. When the Initially collapsed option is not activated, the groups will be displayed in their expanded states, i.e. overlapping activities can be instantly recognised as they are displayed below one another in separate lines.
9. How to Indicate the Vertical Height of the Group by a Color
1) Create a filter for each grouping level which selects for the title row of the group.
Filter conditions of grouping level 1:
<Group-/summary node >=1 AND <Grouping level>=1
Filter conditions of grouping level 2:
<Group-/summary node >=1 AND <Grouping level>=2
etc ...
2) Generate a table format (group title row) for each grouping level:
a) Please assign the filters of step 1 to the corresponding levels
b) For each level above, add a preceding "empty box": create a column and do not assign it a data field or constant text. Column 1 receives the color of grouping level 1, column 2 receives the color of grouping level 2, etc.
c) Behind the empty boxes put a cell named by the pre-defined <Group title>
d) Assign the color of the current level
3) Do analogous settings to the "Standardlist" table format of the base rows:
a) For each level above, add a preceding "empty box" that has the color of the corresponding level
b) Define all other cells required behind the empty boxes
c) Assign own base row colors to these cells
4) Separators:
a) In the column titles, only switch ON the two outer separation lines.
b) In all other formats, switch OFF both separation lines.
10. How to Move a Bar Into a Gantt Graph by Clicking in the Table
The event OnNodeLClick captures both, the node and the information InTable or InDiagram. If the table was clicked on (InTable), the relevant date of the node is retrieved and transferred to the VARCHART XGantt object using the ScrollToDate method.
Code Sample:
Private Sub VcGantt1_OnNodeLClick
(ByVal node As VcGanttLib.VcNode,
ByVal location As VcGanttLib.LocationEnum,
ByVal x As Long, ByVal y As Long,
returnStatus As Variant)
Dim myDataDef As VcDataDefinition
Dim myDataDefTable As VcDataDefinitionTable
Dim myDataField As VcDefinitionField
Dim myIndex As Integer
If location = vcInTable Then
// if the index of the field "Start" is unknown
Set myDataDef = VcGantt1.DataDefinition
Set myDataDefTable = myDataDef.DefinitionTable(vcMaindata)
Set myDataField = myDataDefTable.FieldByName("Start")
myIndex = myDataField.ID
VcGantt1.ScrollToDate node.DataField(myIndex), vcLeftAligned, 2
End If
End Sub
11. How to Delimit Time Scale Enlargement on Interactive Clicking
If you touch the time scale of a Gantt chart on the extreme left of the visible area while keeping the left mouse button depressed to zoom the timescale, you can easily reach a factor far in excess of 1000%. To control this, use the OnTimeScaleSectionRescale event. The below code sample shows how to allow for a twofold enlargement at maximum.
Private Sub VcGantt1_OnTimeScaleSectionRescale
(ByVal timeScale As VcGanttLib.VcTimeScale,
ByVal sectionIndex As Integer,
ByVal newBasicUnitWidth As Long,
returnStatus As Variant)
Dim nOldUnitWidth As Long
nOldUnitWidth = timeScale.Section(sectionIndex).UnitWidth
If newBasicUnitWidth > (2 * nOldUnitWidth) Then
timeScale.UnitWidth = (2 * nOldUnitWidth)
returnStatus = False
End If
End Sub
12. How to use VARCHART XGantt in Windows SharePoint
Please provide a web application that implements the required Gantt functionality inside an ASP.NET web page. A web part element called PageViewer displays your application in Windows SharePoint. You merely need to communicate a link to your web page to the element. You can then use the PageViewer within Windows SharePoint like any other web part element. You can place your application on the SharePoint server or on any other web server
13. Embedding XGantt.NET in WPF applications
The rich functionality of XGantt is also available in WPF applications. For integrating Windows Forms controls into WPF-Windows Microsoft offers the WindowsFormsHost control that lets you use the .NET edition of XGantt within a WPF-Windows as well. Please find below the description of two alternative approaches:
Precondition: Adding the necessary references
In both cases, to use the WindowsFormsHost control, the references to WindowsFormsIntegration, System.Windows.Forms and of course NETRONIC.XGantt have to be created. Besides, the file licenses.licx has to be added, containing the following entry:
NETRONIC.XGantt.VcGantt, NETRONIC.XGantt,
Version=4.2.0.000, Culture=neutral,
PublicKeyToken=3658bc8cab00a1a5
Alternative 1: Integration by way of XAML code of the WPF Windows (Window1.xaml)
This approach integrates XGantt within the XAML code:
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ne="clr-namespace:NETRONIC.XGantt;assembly=NETRONIC.XGantt"
Title="Hosting XGantt .NET in WPF" Height="400" Width="500">
<Grid x:Name="grid1">
<WindowsFormsHost Margin="41,27,36,30" Name="windowsFormsHost1">
<ne:VcGantt Name="vcGantt1" Height="300" Width="450">
</WindowsFormsHost>
</Grid>
</Window>
Alternative 2: Integration by way of Code-Behind of the WPF Windows (Window1.xaml.cs)
This approach does not integrate XGantt by way of using XAML code but by using code-behind in C#. For this reason, the XAML code does not contain any specific characteristics, it is just a standard description of a WPF Windows.
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Hosting XGantt .NET in WPF" Height="400" Width="500">
<Grid x:Name="grid1">
</Grid>
</Window>
Now the WindowsFormsHost object is created in code-behind and a VcGantt object is added to this object as child.
using System.Windows.Forms.Integration;using NETRONIC.XGantt;namespace WpfApplication1{
/// <summary></summary>
/// Interaction logic for Window1.xaml
/// </summary><//summary>
public partial class Window1 : Window
{
WindowsFormsHost windowsFormsHost1 = null;
VcGantt vcGantt1 = null;
public Window1()
{
InitializeComponent();
windowsFormsHost1 = new System.Windows.Forms.Integration.WindowsFormsHost();
vcGantt1 = new VcGantt();
windowsFormsHost1.Child = vcGantt1;
grid1.Children.Add(windowsFormsHost1);
}
}
}
Using the property pages for configuration
As, unfortunately, neither alternative offers the use of XGantt.NET's property pages, we recommend you to create a Windows form within the project so that this comfortable way of configuration is still available. You can then place another XGantt instance onto this form and carry out the desired settings on the property pages. This configuration can be exported as *.ini file and afterwards be reimported into the VcGantt object of the WPF Windows.
public Window1()
{
InitializeComponent();
…
VcGantt vcGantt1 = (VcGantt) windowsFormsHost1.Child; // needed with alternative 1 only!
vcGantt1.InitializeForWebService();
vcGantt1.ImportConfiguration("Name_of_Configuration_file.ini");
…
}
The NETRONIC components XNet.NET and XTree.NET can of course also be embedded in WPF applications in this way.
Helpful Links
- MSDN Library: "Walkthrough: Hosting a Windows Forms Control in Windows Presentation Foundation by Using XAML":
http://msdn.microsoft.com/en-us/library/ms742875.aspx - MSDN Library: "Walkthrough: Hosting a Windows Forms Control in Windows Presentation Foundation":
http://msdn.microsoft.com/en-us/library/ms751761.aspx


