on 02-14-2011 2:44 PM
So, I was having an issue similar to the thread at
Here is what i am doing currently:
DSN connection to a source via
Dim conn As New OdbcConnection("DSN=lalConnect")
and then
input = getfile()
While (Not (input.Contains(".rpt")))
MessageBox.Show(input & " is NOT a .rpt file")
input = getfile()
End While
ReportViewer.CrystalReportViewer1.ReportSource = input.ToString
I set the compiler to be for any CPU type (x86 || x64)
My error throws in the last line of the above code and would show message "An Error Occurred creating the form. See Exception.InnerException for details. The error is: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exceptiion."
I wasnt quite sure as to why this was happening, and as a side question, i wasnt sure how to connect my DSN connection to the report so it can properly pull information. could be a reason why it is throwing this error..?
Thanks everyone.
P.S.- If you need more information, i can post it.
Edited by: fallenreaper on Feb 14, 2011 4:38 PM
Information about the system:
windows 7 64bit
VS2010
version: 10
runtime: v2.0.50727
Crystal Reports
version:13.2000.0
runtime: v2.0.50727
References added: CrystalDecisions.CrystalReports.
Design
Engine
TemplateEngine
Edit: I also moved information into a new project/solution, and i was getting the same error, so it isnt simply solved similarly how another person did on this forums.
Edited by: fallenreaper on Feb 14, 2011 8:53 PM
Below is the output from the inner exception:
System.TypeInitializationException: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception. ---> System.BadImageFormatException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at CrystalDecisions.Shared.SharedUtils..cctor()
--- End of inner exception stack trace ---
at CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture()
at CrystalDecisions.Shared.LocaleManager..ctor()
at CrystalDecisions.Windows.Forms.CrystalReportViewer.InitReportViewer()
at CrystalDecisions.Windows.Forms.CrystalReportViewer..ctor()
at will.ReportViewer.InitializeComponent() in C:\Users\Fallenreaper\Documents\Visual Studio 2010\Projects\will\will\ReportViewer.Designer.vb:line 25
at will.ReportViewer..ctor()
Edited by: fallenreaper on Feb 14, 2011 9:32 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd suggest looking at a few resources and sample apps.
Sample apps:
https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
I'd suggest vbnet_win_dbengine to see info re. database logon. Also search these forums and use the search box at the top right of this web page. Lots of info on database logons. Vbnet_win_simplepreviewreport is a good example of loading a report.
Also, see the following;
Developer help files.
CRVS2010:
Report Application Server .NET API Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_api_en.zip
Report Application Server .NET SDK Developer Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_dg_en.zip
SAP Crystal Reports .NET API Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip
SAP Crystal Reports .NET SDK Developer Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip
CR2008:
http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm
http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_apiRef_12_en.chm
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]
I was looking at the example code within the links in your posts, and i has a question about them as it is shown in c# and vb
dim myDataSet as Dataset = DatasetConfiguration.customerdataset
as shown on [http://msdn.microsoft.com/en-us/library/ms227627%28v=vs.90%29.aspx"] in step 7 of "To instantiate and bind a non-embedded report to the CrystalReportViewer control"
I want to do something similar in vb.net, but when writing, it doesnt say that datasetconfiguration exists. I didnt know what i should be importing.
currently i have the following imported:
Imports MySql.Data.MySqlClient
Imports System.Configuration
Imports System.Text.RegularExpressions
Imports System.Data.Odbc
Imports System.Data
Imports CrystalDecisions.CrystalReports.Engine
What else am i missing to import or is it located under something else in vb.net???
Perhaps the better thing to look at will be the sample app vbnet_win_adodotnet.zip from https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
- Ludek
I had installed and did everything for that program and it was getting an error that i have seen in [] so if i am getting an error, i think it might be best to reinstall VS2010 in an attempt to cure my error? I figure it was a perfectly running demo, and i have seen that error many times today when working on and building my .net projects.
Ill reinstall tonight, and see if that works.
Of these issues, nothing seems to be working. I was unsure why none of this is working. I have recompiled, recreated projects, and approached from several angles, but it does not seem to work.
I still get the util's issue, and i dont know anymore then you all how to fix it. Assumed that this is just because of this being associated with a Microsoft Product.
I am still working on this issue every day, and so far, put over 100 hours into this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd suggest creating a phone case:
If it's CR bug, you'll get a refund.
- Ludek
Guys,
you must install the correct crystal report runtime (32 or 64) and this error will be resolved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.