Click here to Skip to main content
15,911,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception

What I have tried:

.............................................................................................
Posted
Comments
Anisuzzaman Sumon 17-Aug-16 0:27am    
Show up your code
Member 12245539 17-Aug-16 1:07am    
On which PC I am developing. Crystal reporting showing fine. But If I take crystal report from another computer then It is error showing.

The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception
Member 12245539 17-Aug-16 3:54am    
try
{
//FeeReport
PreviewPage Page = new PreviewPage();
string str = "select ReceiptNo, S_Adm_No, paid_date, S_Adm_No, Class, S_Name, S_F_Name, Mode_Payment,ChqNo,ChqDated, For_the_Month , FHeadId, FHead, TotalAmount, SUM (Apr + May+Jun+Jul+Aug+Sep+Oct+Nov+[Dec]+Jan+Feb+Mar) as FEE from View_Fee_Receipt_Students where ReceiptNo='" + txt_Recp.Text + "' group by ReceiptNo, S_Adm_No, paid_date, S_Adm_No, Class, S_Name, S_F_Name, Mode_Payment,ChqNo,ChqDated, For_the_Month , TotalAmount, FHeadId, FHead ";
FeeReceipt FEE = new FeeReceipt();
SqlDataAdapter sda = new SqlDataAdapter(str, con);
DataSet ds = new DataSet();
sda.Fill(ds, "Receipt");
if (ds.Tables[0].Rows.Count == 0)
{
MessageBox.Show("No data found plz check", "Information", MessageBoxButtons.OK);
return;
}
FEE.SetDataSource(ds);
Page.crystalReportViewer1.ReportSource = FEE;
Page.MdiParent = Form1.ActiveForm;
Page.Show();
this.Hide();
}
catch (ApplicationException ex)
{
MessageBox.Show(ex.Message);
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900