unable to evaluate expression because the code is optimized
unable to evaluate expression because the code is optimized
when i am using the below code
**************************************
BillDetails.mrt was designed with oracle db using oracle connection
***************************************************************************************
Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport();
report.Load(Server.MapPath("~/Reports/BillDetails.mrt"));
StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiOracleAdapterService());
StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiOracleDatabase());
string oracleConnection = "Data Source=******;User ID=******;Password=*******";
StiOracleDatabase stiDB = new StiOracleDatabase("OracleConnection", oracleConnection);
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(stiDB);
report.Compile();
//Stimulsoft.Report.Dictionary.StiVariable parameter = new Stimulsoft.Report.Dictionary.StiVariable("uspGetbillDetails", typeof(int));
//parameter.Value = "19";
//report.Dictionary.Variables["soa_id"] = parameter;
report["soa_id"] = 19;
report.Render();
// report.Show();
StiReportResponse.ResponseAsPdf(this, report);
i am getting an error as :
unable to evaluate expression because the code is optimized or native frame is on top of call stack at StiReportResponse.ResponseAsPdf(this, report); line.
in designer also if i run(preview) the report(parametarized report) its showing empty document.
please help me out
**************************************
BillDetails.mrt was designed with oracle db using oracle connection
***************************************************************************************
Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport();
report.Load(Server.MapPath("~/Reports/BillDetails.mrt"));
StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiOracleAdapterService());
StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiOracleDatabase());
string oracleConnection = "Data Source=******;User ID=******;Password=*******";
StiOracleDatabase stiDB = new StiOracleDatabase("OracleConnection", oracleConnection);
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(stiDB);
report.Compile();
//Stimulsoft.Report.Dictionary.StiVariable parameter = new Stimulsoft.Report.Dictionary.StiVariable("uspGetbillDetails", typeof(int));
//parameter.Value = "19";
//report.Dictionary.Variables["soa_id"] = parameter;
report["soa_id"] = 19;
report.Render();
// report.Show();
StiReportResponse.ResponseAsPdf(this, report);
i am getting an error as :
unable to evaluate expression because the code is optimized or native frame is on top of call stack at StiReportResponse.ResponseAsPdf(this, report); line.
in designer also if i run(preview) the report(parametarized report) its showing empty document.
please help me out
Re: unable to evaluate expression because the code is optimi
Hello,
Please send us a sample project which reproduce the issue for analysis.
Thank you.
Please send us a sample project which reproduce the issue for analysis.
Thank you.
Re: unable to evaluate expression because the code is optimi
PFA .
DB Details: oracle 11g . In default.aspx i have written the code .
while viewing pdf it is showing an empty pdf.
DB Details: oracle 11g . In default.aspx i have written the code .
while viewing pdf it is showing an empty pdf.
- Attachments
-
- DemoStimulsoft.rar
- demostimulsoft
- (2.5 MiB) Downloaded 171 times
Re: unable to evaluate expression because the code is optimi
Hello,
Please try to use the following code:
Thank you.
Please try to use the following code:
Code: Select all
Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport();
report.Load(Server.MapPath("~/Reports/BillDetails.mrt"));
StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiOracleAdapterService());
StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiOracleDatabase());
string oracleConnection = "Data Source=****;User ID=****;Password=****";
((StiOracleDatabase)report.Dictionary.Databases["Connection"]).ConnectionString = oracleConnection;
report.Dictionary.DataSource["uspGetbillDetails"].Paramaters["soa_id"].Value = "19";
report.Render();
report.ExportDocument(StiExportFormat.Pdf, "Reports/OrderDetails/ram.pdf");
Re: unable to evaluate expression because the code is optimi
hi ,
I have tried with the code which u have sent ,but its throwing below error at report.Render(); line
"Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed."
for the above error i have checked the application pool settings. my lapy is having windows 7 (64 bit version) and in iis in advanced settings, "enable-32 -bit application" was set to false.
is there any problem with ultimate installation ( i mean ultimate version is belongs to which bit.32 bit or 64 bit)
FYI : in my lapy stimulsoft was installed in following path : C:\Program Files (x86)\Stimulsoft Reports.Ultimate 2013.1 Trial (this means 32 0r 64)?
I have tried with the code which u have sent ,but its throwing below error at report.Render(); line
"Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed."
for the above error i have checked the application pool settings. my lapy is having windows 7 (64 bit version) and in iis in advanced settings, "enable-32 -bit application" was set to false.
is there any problem with ultimate installation ( i mean ultimate version is belongs to which bit.32 bit or 64 bit)
FYI : in my lapy stimulsoft was installed in following path : C:\Program Files (x86)\Stimulsoft Reports.Ultimate 2013.1 Trial (this means 32 0r 64)?
Re: unable to evaluate expression because the code is optimi
Hello,
According to the idea the x64 client version is required if you are using the application compiled with a compiler directive "x64". Try to compile your application with directive "x32" or "any cpu".
Also please see the following topic with the similar issue:
http://forum.stimulsoft.com/viewtopic.php?f=8&t=3502
Thank you.
According to the idea the x64 client version is required if you are using the application compiled with a compiler directive "x64". Try to compile your application with directive "x32" or "any cpu".
Also please see the following topic with the similar issue:
http://forum.stimulsoft.com/viewtopic.php?f=8&t=3502
Thank you.
Re: unable to evaluate expression because the code is optimi
hi ,
finally i got the solution.
there are several reasons for the issues behind the above code which i have posted.
1)StiOracleDatabase stiDB = new StiOracleDatabase("OracleConnection", oracleConnection);
In the above statement "OracleConnection" should be "Connection" . The reason behind is while designing mrt (report) i gave the name as connection but here i am trying with OracleConnection .it causes one issue.
2) my oracle is 64 bit .but the web application which i have developed in visual studio is running under 32 bit, why because by default visual studio will run under 32 bit. to solve this create an application in iis with the virtual path for the website and make sure that the pool assigned for the application is running with 64 bit.(i.e , pool ->advanced settings -> enable 32bit to false ).
thank u for your co-ordination aleksey
finally i got the solution.
there are several reasons for the issues behind the above code which i have posted.
1)StiOracleDatabase stiDB = new StiOracleDatabase("OracleConnection", oracleConnection);
In the above statement "OracleConnection" should be "Connection" . The reason behind is while designing mrt (report) i gave the name as connection but here i am trying with OracleConnection .it causes one issue.
2) my oracle is 64 bit .but the web application which i have developed in visual studio is running under 32 bit, why because by default visual studio will run under 32 bit. to solve this create an application in iis with the virtual path for the website and make sure that the pool assigned for the application is running with 64 bit.(i.e , pool ->advanced settings -> enable 32bit to false ).
thank u for your co-ordination aleksey
Re: unable to evaluate expression because the code is optimi
Hello,
Ok. Thank you for information.
Thank you.
Ok. Thank you for information.
Thank you.