Skip to Content
avatar image
Former Member

Invalid Pointer when setting setdatabaseLogOn C#

Hi.

I have created a crystal report with a sub report in it. When i tried to load it into the crystalreportviewer using C#, I get the "Invalid Pointer" error at SetDatabaseLogOn method. Below is the stacktrace. Please help:

at CrystalDecisions.ReportAppServer.Controllers.SubreportControllerClass.GetSubreport(String Name) at CrystalDecisions.CrystalReports.Engine.ReportDocument.GetSubreport(String subreportName) at CrystalDecisions.CrystalReports.Engine.Subreports..ctor(ReportDocument doc) at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_Subreports() at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDatabaseLogon(String user, String password, String server, String database, Boolean ignoreCase) at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDatabaseLogon(String user, String password, String server, String database) at ReserveIT.CrysRpt.LoadInvoice(Int32 cid, DateTime startDate, DateTime endDate, DateTime billingdate) in \\CrysRpt.cs:line 43 at ReserveIT.Reports.LoadCryRpt(Int32 cid, DateTime startDate, DateTime endDate, DateTime billingdate, Int32 reporttype) in \\Reports.xaml.cs:line 35 at ReserveIT.CustSelect.callinvoice() in \\CustSelect.xaml.cs:line 220 at ReserveIT.CustSelect.button1_Click(Object sender, RoutedEventArgs e) in \\CustSelect.xaml.cs:line 59 at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnKeyDown(KeyEventArgs e) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled) at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers) at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled) at System.Windows.Interop.ThreadMessageEventHandler.Invoke(MSG& msg, Boolean& handled) at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.ShowDialog()

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Apr 24, 2017 at 05:07 AM

    There was an parameter declaration error in one of the subreport that caused this exception. Fixed it and the code working fine.

    Add comment
    10|10000 characters needed characters exceeded