cancel
Showing results for 
Search instead for 
Did you mean: 

Win32Exception by changing parameters

Former Member
0 Kudos

Hello,

I have a problem with the newest Version of Crystal Reports for .NET (13.0.10.1385).

If I change some parameters I get this Win32Exception:

System.ComponentModel.Win32Exception (0x80004005): Fehler beim Erstellen des Fensterhandles. (Error creating window handle)

   bei System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)

   bei System.Windows.Forms.Control.CreateHandle()

   bei System.Windows.Forms.TextBoxBase.CreateHandle()

   bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

   bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

   bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

   bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

   bei System.Windows.Forms.Control.CreateControl()

   bei System.Windows.Forms.Control.ControlCollection.Add(Control value)

   bei CrystalDecisions.Windows.Forms.ParameterUnit.AddEditControl(ParameterValue pv)

   bei CrystalDecisions.Windows.Forms.ParameterUnit.UpdateControls()

   bei CrystalDecisions.Windows.Forms.InteractiveParameterPanel.ShowAdvancedDialog(ParameterUnit pu)

   bei CrystalDecisions.Windows.Forms.InteractiveParameterPanel.pu_ShowAdvancedDialog(Object sender, EventArgs e)

   bei CrystalDecisions.Windows.Forms.ParameterUnit.OnShowAvancedDialog(EventArgs e)

   bei CrystalDecisions.Windows.Forms.ParameterUnit.editControl_ShowAdvancedDialog(Object sender, EventArgs e)

   bei CrystalDecisions.Windows.Forms.ParameterValueEditControl.CreateParameterValueEditControl()

   bei CrystalDecisions.Windows.Forms.ParameterValueEditControl.editControl_MouseDown(Object sender, MouseEventArgs e)

   bei System.Windows.Forms.Control.OnMouseDown(MouseEventArgs e)

   bei System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)

   bei System.Windows.Forms.Control.WndProc(Message& m)

   bei System.Windows.Forms.TextBoxBase.WndProc(Message& m)

   bei System.Windows.Forms.TextBox.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Can anyone help me, or will it be fixed in the near future?

Greets Rene

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hi Rene

Referencing: "If I change some parameters"

Can you be more specific or define the parameters that cause the issue? E.g.; how would I duplicate the issue? Also:

What OS are you using?

What database?

How are you connecting to the database?

What version is the database client?

Code used?

Version of CR assemblies referenced in your project?

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Can you be more specific or define the parameters that cause the issue? E.g.; how would I duplicate the issue?

- Dynamic multiple choice parameter, with two levels: usergroups and users

- Tried int-values (number) and string values (text), problem occures in both scenarios. About 500 list items in my case, shows only description, the actual value is hidden.

- A command delivers the values for the parameter, the sql statement looks like this:

select distinct u.usergroup_id [Group_id], u.name [GroupName], ugl2.assoc_id [Associate_id], a2.name [Associate_name], p.firstname +' '+p.lastname [Associate_FullName]

from [usergroup] u

inner join crm5.usergrouplink ugl on ugl.usergroup_id = u.usergroup_id

inner join crm5.usergrouplink ugl2 on ugl2.usergroup_id = ugl.usergroup_id

inner join crm5.associate a2 on a2.associate_id = ugl2.assoc_id

inner join crm5.person p on p.person_id = a2.person_id

- Report viewer loads parameter dialog, shows expected values

- Then when you enable the parameter quick-edit-bar on the left (4th icon) and try to edit the parameter by clicking the little icon the parameter dialog appears as intended and you can make changes.

- Note that the quick-edit-bar becomes very sluggy with lots of values, may be related to the problem.

- Remove a few items and confirm -> application crashes

What OS are you using? Windows NT 6.1 Enterprise Edition (Terminal Server) SP1 build 7601

What database? SQL Server 10.50.4321

How are you connecting to the database? ODBC

What version is the database client? SQL Server Native Client 10.0

Code used? see sql statement above

Version of CR assemblies referenced in your project? 12.2.2000.290 and 13.0.10.1385 (same issue)

0 Kudos

Hi Rene,

If you change parameters you must also VerifyDatabase() so that the report can update the what it expects to be there.

Also, if the parameters are used in the report CR will simply delete them because the Mapping function is set to Auto, meaning if we can match CR simply deletes the parameter. This causes a crash because you may have used them in formula or somewhere else and now the report has no parameter.

Likely the cause of the crash.

You'll have to call a Report.Verifydatabase();

If that fails then the report will not run.

Problem is you can NOT change parameters on the fly in the command Object without updating the report also.

Try it in CR Designer, you'll see what CR expects and what happens when you change just the SQL.

What you'll have to do is get the Parameters collection and add/remove/modify the collection after changing the Command. Then use the VerifyDatabase to update all the references in the report.

See this Wiki for RAS samples:

NET RAS SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki

Don

Former Member
0 Kudos

Hi Don, thanks for your feedback, although I'm afraid I can't really follow, I guess you are talking about the SDK. I belive you misunderstood the nature of the bug, sorry if I didn't explain it properly.

Hope this screenshot will clear things up a bit: the whole bug is happening within the Crystal Reports Viewer, no external code is involved. It's all happening within the default ui.

former_member183750
Active Contributor
0 Kudos

Hi Rene

What do you mean by: "...no external code is involved."?

I don't see Don implying anything about an "external" code. Only things I see Don discussing are:

1) Reference to CR APIs for .NET.

2) Reference to how you may want to configure the report in the CR designer.

- Ludek

0 Kudos

Hi Rene,

That viewer is part of either a third party application you are using to view the reports or it could be you are using Business Object Enterprise and attempting to make changes somewhere...

So if is this a third party application you are using to view these reports then you need to ask the makers of it.

If you are using BI enterprise and publishing and running these reports through it then same answer as before.

So if running this update report in CR Designer or in BOE or some third party app using our SDK you can't change the SQL Command Parameters, or Crystal Parameters without verifying the report first in CR Designer. Then resaving it to BI/BOE

CR/BOE/BI assumes when you publish/run/preview the reports they have been verified before using them.

Hope that is clear...

If it is a third party app them please contact the makers of it for help update the reports with your new parameters.

Don

Former Member
0 Kudos

All right, I still believe you don't understand the problem, so I made a few videos of whats happening:

1.: Crystal Reports Viewer crashes: system.drawing

cr-viewer crash system.drawing - YouTube

2.: Crystal Reports Viewer crashes: system.windows.forms

cr-viewer crash system.windows.forms - YouTube

3.: Crystal Reports Designer works just fine (and much faster)

cr-designer ok - YouTube

Our software (HostService.exe) starts the Crystal Reports Viewer, but the crash happens within the Crystal Reports Viewer itself. Changin parameter values is a standard feature of the Crystal Reports Viewer.

former_member183750
Active Contributor
0 Kudos

Looking at the videos and seeing that CLR20R3 is involved:

I decided to do a b it of googling on the error. Almost invariably, the suggested solutions relate to some sort of an issue with the framework. Sample links:

.Net Framework 4 CLR20r3 Error

CLR20R3 involving mscorlib.dll; IO.FileNotFound - Windows 7

The following link may also prove to be of some use in troubleshooting the issue:

EventType clr20r3, P1 w3wp.exe – system.nullreferenceexception

Finally, is VB 6 involved in some way? (e.g.; shelling out, etc.)

- Ludek

Former Member
0 Kudos

No, VB6 isn't involved in any way!

Our own product in this case is the HostService.exe (it isn't a third party tool).

We use the CrystalReportViewer Control (Namespace: CrystalDecisions.Windows.Forms) to view the crystal report in our solution.

As you can see in the screenshots, the CrystalReportViewer in our HostService process get too many GDI-Objects (TaskManager).

How can we fix this bad issue?

0 Kudos

Ah, so it is a third party application, you are the third party...

So how are you managing the report objects and viewer control?

Closing and disposing is a must do as well as the GC.Collect.

How many iterations, report jobs, does it take to cause the issue?

Don


former_member183750
Active Contributor
0 Kudos

So, let's simplify this a bit.

I'd like you to create a new one line test app:

Throw the CR viewer on a form

On Page load: CrystalReportViewer1.ReportSource = <path to the report>

Run

The report will prompt for DB logon as well as the parameters. What happens in this app?

- Ludek

Answers (0)