Hi,
Thanks for your reply. I get an NullReferenceException on the line:
Code: Select all
tbservice.ToolBar.PlaceOnControl();
This is my complete code (also tried to place your code before assigning my report to the designer):
Code: Select all
StiReport stiReport = new StiReport();
stiReport.Load(_Report.ReportObject.BinaryData);
DataSet set = AgendaItemManager.GetAllAgendaItemsDataTable(ViaContext, _Report.Ou, null, null);
stiReport.RegData(set);
stiDesigner.Report = stiReport;
StiService[] services = StiToolbarService.GetToolbarServices(stiDesigner);
foreach (StiToolbarService tbservice in services)
{
if (tbservice.ToolBar != null)
{
tbservice.ToolBar.Visible = true;
tbservice.ToolBar.PlaceOnControl();
}
}
StiDesignerConfigService designerConfig = Stimulsoft.Report.StiConfig.Services.GetService(typeof(StiDesignerConfigService)) as StiDesignerConfigService;
designerConfig.Save();
Stacktrace:
bei Stimulsoft.Controls.StiToolBar.PlaceOnControl()
bei srgits.Via.Desktop.AdminModule.Controls.ReportUserControl.UpdateView() in D:\win\VIA\Source\DesktopApp\Modules\Via.Desktop.AdminModule\Controls\ReportUserControl.cs:Zeile 142.
bei srgits.Via.Desktop.AdminModule.Controls.ReportUserControl.SetContext(Report report) in D:\win\VIA\Source\DesktopApp\Modules\Via.Desktop.AdminModule\Controls\ReportUserControl.cs:Zeile 67.
bei srgits.Via.Desktop.AdminModule.ModuleWorkItem.ExplorerView_AfterSelect(Object sender, TreeViewEventArgs e) in D:\win\VIA\Source\DesktopApp\Modules\Via.Desktop.AdminModule\ModuleWorkItem.cs:Zeile 212.
bei srgits.Via.Desktop.AdminModule.Views.ExplorerSmartPart.tvwTools_AfterSelect(Object sender, TreeViewEventArgs e) in D:\win\VIA\Source\DesktopApp\Modules\Via.Desktop.AdminModule\Views\ExplorerSmartPart.cs:Zeile 397.
bei System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
bei System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
bei System.Windows.Forms.TreeView.WmNotify(Message& m)
bei System.Windows.Forms.TreeView.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
bei System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
bei System.Windows.Forms.Control.WmNotify(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
bei System.Windows.Forms.UserControl.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
bei System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
bei System.Windows.Forms.Control.DefWndProc(Message& m)
bei System.Windows.Forms.TreeView.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.TreeView.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei Microsoft.Practices.CompositeUI.WinForms.FormShellApplication`2.Start() in D:\win\VIA\Source\Library\CompositeUI.WinForms\FormShellApplication.cs:Zeile 31.
bei Microsoft.Practices.CompositeUI.CabApplication`1.Run() in D:\win\VIA\Source\Library\CompositeUI\CabApplication.cs:Zeile 81.
bei Via.DesktopShell.Program.Main() in D:\win\VIA\Source\DesktopApp\Via.DesktopShell\Program.cs:Zeile 143.
bei System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()