ActiveReports 12
Compatibility Guidelines
ActiveReports 12 > ActiveReports User Guide > Upgrading Reports > Migrating from Previous Versions > Compatibility Guidelines

This topic guides you regarding the compatibility between the previous versions and ActiveReports 12. You may face issues related to following after the migration.

Show Method

In ActiveReports 6.0 and above, the Show method has been removed from the report class and as a result, the dependency to the main assembly (ActiveReports6.dll) and the viewer assembly (Viewer6.dll) is no longer available. Earlier, the main assembly and the viewer assembly in the execution environment were required to be added even for the applications that did not required preview. In ActiveReports 6 or above, you no longer need to add the viewer assembly.
If you are previewing reports using the following code in a previous version, you need to change it to the preview method that uses the Viewer component.

Before migration

Visual Basic

Copy Code
Private Sub Form1_Load(...) Handles MyBase.Load
 Dim rpt As New SampleReport
 rpt.Show()
End Sub

C#

Copy Code
private void Form1_Load(object sender, System.EventArgs e)
{
 SampleReport rpt = new SampleReport();
 rpt.Show();
}

In the following code, Form1 has been placed in the Viewer control. Here, if you set Document property of the report and then run the report, results obtained are similar to that with Show method.

After migration

Visual Basic

Copy Code
Private Sub Form1_Load(...) Handles MyBase.Load
 Dim rpt As New SampleReport
 Me.Viewer1.Document = rpt.Document
 rpt.Run()
End Sub

C#

Copy Code
private void Form1_Load(object sender, System.EventArgs e)
{
 SampleReport rpt = new SampleReport();
 this.viewer1.Document = rpt.Document;
 rpt.Run();
}

Print Method

In ActiveReports 7, the internal implementation of the Document.Print method has been changed. The Print method that was available in Document class upto ActiveReport 6 has been replaced by an extension method in PrintExtension class of Grapecity.ActiveReports namespace (GrapeCity.ActiveReports.Viewer.Win.v12.dll) introduced in ActiveReports 7. Therefore in ActiveReports 7 and above, you need to import namespace in order to use the Print method. For more details, see Print Methods.

Custom Toolbar

ActiveReports 7 onward, toolbar has been reformed to use ToolStrip class. Also, the Viewer feature has been added to the toolbar and as a result, the display order of toolbar buttons has also changed. For more details, see Customizing the Viewer Control.

In case you have set the toolbar as Hidden, modify the code as follows:

Before migration

Visual Basic

Copy Code
‘Code for ActiveReports 6
Me.Viewer1.Toolbar.Tools(23).Visible = False 'Hide the [Annotation] button
Me.Viewer1.Toolbar.Tools(4).Visible = False ‘Hide the copy button

C#

Copy Code
//Code for ActiveReports 6
this.Viewer1.Toolbar.Tools(23).Visible == false //Hide the [Annotation] button
this.Viewer1.Toolbar.Tools(4).Visible == false //Hide the copy button

After migration

Visual Basic

Copy Code

‘Viewer1.Toolbar.ToolStrip.Items.RemoveAt(37)
‘[Annotation] button is hidden in ActiveReports 7, we don't have to mention it.
 Viewer1.Toolbar.ToolStrip.Items.RemoveAt(5) ‘Hide the copy button

C#

Copy Code

//Viewer1.Toolbar.ToolStrip.Items.RemoveAt(37);
//[Annotation] button is hidden in ActiveReports 7, we don't have to mention it.
 Viewer1.Toolbar.ToolStrip.Items.RemoveAt(5); //Hide the copy button

In case you have set additional buttons in the toolbar through the code, you need to replace it with the new API code.

Before migration (from Version 6)

Visual Basic

Copy Code

'Delete the existing Annotation button and add [Add Custom Annotation] button

Dim image As System.Drawing.Icon
image = New System.Drawing.Icon(Me.GetType.Module.Assembly.GetManifestResourceStream("CustomAnnotations.NOTE16.ICO"))
Viewer1.Toolbar.Images.Images.Add(image)

Dim btn As DataDynamics.ActiveReports.Toolbar.Button
btn = New DataDynamics.ActiveReports.Toolbar.Button

btn.ButtonStyle = DataDynamics.ActiveReports.Toolbar.ButtonStyle.TextAndIcon

btn.ImageIndex = 14 'Add new image in Toolbar.Images
btn.Id = ToolIds.Annotation 'Set unique ID in the button
btn.Caption = "Custom Annotation"
btn.ToolTip = "Set confirmation mark"
Viewer1.Toolbar.Tools.RemoveAt(23) 'Delete the existing Annotation button.
Viewer1.Toolbar.Tools.Insert(23, btn)

Private Sub Viewer1_ToolClick(ByVal sender As Object, ByVal e As DataDynamics.ActiveReports.Toolbar.ToolClickEventArgs) Handles Viewer1.ToolClick

'Describe about the event fired while pressing the annotation button

End Sub

C#

Copy Code

//Delete the existing Annotation button and add [Add Custom Annotation] button

System.Drawing.Icon image = default(System.Drawing.Icon);
image = new System.Drawing.Icon(this.GetType.Module.Assembly.GetManifestResourceStream("CustomAnnotations.NOTE16.ICO"));
Viewer1.Toolbar.Images.Images.Add(image);

DataDynamics.ActiveReports.Toolbar.Button btn = default(DataDynamics.ActiveReports.Toolbar.Button);
btn = new DataDynamics.ActiveReports.Toolbar.Button();

btn.ButtonStyle = DataDynamics.ActiveReports.Toolbar.ButtonStyle.TextAndIcon;

btn.ImageIndex = 14; //Add new image in Toolbar.Images
btn.Id = ToolIds.Annotation;  //Set unique ID in the button
btn.Caption = "Custom Annotation";
btn.ToolTip = "Set confirmation mark";
Viewer1.Toolbar.Tools.RemoveAt(23);  //Delete the existing Annotation button.
Viewer1.Toolbar.Tools.Insert(23, btn);

private void Viewer1_ToolClick(object sender, DataDynamics.ActiveReports.Toolbar.ToolClickEventArgs e)
{
//Describe about the event fired while pressing the annotation button

}

 

 

After migration (from Version 6)

Visual Basic

Copy Code

'Delete the existing Annotation button and add [Add Custom Annotation] button

Dim image As System.Drawing.Icon
image = New System.Drawing.Icon(Me.GetType.Module.Assembly.GetManifestResourceStream("CustomAnnotations.NOTE16.ICO"))

Dim btn As New ToolStripButton("Custom Annotation")
btn.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText
btn.Image = image.ToBitmap
btn.ToolTipText = "Set confirmation mark"

‘Viewer1.Toolbar.ToolStrip.Items.RemoveAt(37) ‘The annotation button is by default hidden in ActiveReports 7, so it doesn't need description.
Viewer1.Toolbar.ToolStrip.Items.Add(btn)
‘Viewer1.Toolbar.ToolStrip.Items.Insert(37,btn) ‘Create event handler if you want to place button in a specified location during the button click.
AddHandler btn.Click, AddressOf tsbAnnotation_Click

Private Sub tsbAnnotation_Click(sender As Object, e As EventArgs)

‘Describe about the event fired while pressing the annotation button

End Sub

C#

Copy Code

//Delete the existing Annotation button and add [Add Custom Annotation] button

System.Drawing.Icon image = default(System.Drawing.Icon);
image = new System.Drawing.Icon(this.GetType.Module.Assembly.GetManifestResourceStream("CustomAnnotations.NOTE16.ICO"));

ToolStripButton btn = new ToolStripButton("Custom Annotation");
btn.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
btn.Image = image.ToBitmap;
btn.ToolTipText = "Set confirmation mark";

//Viewer1.Toolbar.ToolStrip.Items.RemoveAt(37); //The annotation button is by default hidden in ActiveReports 7, so it doesn't need description.
Viewer1.Toolbar.ToolStrip.Items.Add(btn);
//Viewer1.Toolbar.ToolStrip.Items.Insert(37,btn); //Create event handler if you want to place button in a specified location during the button click.
btn.Click += tsbAnnotation_Click;

private void tsbAnnotation_Click(object sender, EventArgs e)
{
//Describe about the event fired while pressing the annotation button
}

In C# code, remove the additional code of Viewer.ToolClick event handler in XXX.Designer.cs.

Control Borders

ActiveReports 6 or above does not provide support the use of control borders of the Line control. As a result, control border of the Line control set in the previous version will not get rendered after migrating to ActiveReports 7 or above.

You cannot set the control border in the following controls:

HTTP Handler (Professional edition only)

In ActiveReports 2 or above, the upper case and lower case characters of hyperlink strings used for directly referring the report layout file have been clearly distinguished. This may affect the working after the migration if upper case and lower case characters are not used correctly.

WebViewer Control (Professional edition only)

There are certain modifications in the properties available within the property window. In ActiveReports 1, you can use Report property to specify the report to be displayed. In ActiveReports 2 or above ReportName property has been introduced to replace Report property.
Please note that the Report property is removed from the property window but not from the WebViewer object, and hence there is no change in the code.

The type to set the Report property and ReportName property are different.