Domanda

I have a winform application. In this application I am using active reports for reporting purpose. So in active report viewer I have added some buttons like Print, Export and Email. I am attaching a snapshot where I am adding these buttons.

enter image description here

And here is some code for how I am adding these buttons on Load event.

Code

My problem is that how to show image with these buttons in active reports as shown in attached image.

È stato utile?

Soluzione

The code used by you is not displayed in the posted query, however, following is the code snippet that can be used to add a custom button in the Viewer Toolbar along with the desired image:

Dim prnt_btn As New ToolStripButton
prnt_btn.Image = Image.FromFile("..\..\Print.jpg")
Viewer1.Toolbar.ToolStrip.Items.Insert(2, prnt_btn)

Altri suggerimenti

We can add this code for displaying the image with text in active report viewer. Use this code on Load event of viewer.

 viewer1.Toolbar.Images.Images.Add("myIcon",Image.FromFile(Application.StartupPath + @"\\icon.bmp")); 

  int myIcon = viewer1.Toolbar.Images.Images.IndexOfKey("myIcon"); 

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

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

  btn.ImageIndex = myIcon; 
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top