Posted 18 March 2018, 8:41 pm EST
Hi,
I would like to use scripting in my Section Report.
I know how to write “simple scripts” and it works correctly in both Report Designer and in Report Preview when the report is generated.
I also know how to write “complex scripts” which use external libraries that are added to the script compilation engine via sectionReport.AddScriptReference() method and it works correctly in Report Preview when the report is generated.
However I also need the “complex scripts” work in Report Designer… but I cannot figure it out how to add script references. No matter what I do (I also tried to use .NET Reflection to add script reference to some private SectionReport instances inside GrapeCity assemblies)… I always get the following error when I switch to “Preview” Tab in Report Designer:
Exception details:
GrapeCity.ActiveReports.ReportScriptException: Report Script Compile Error on line 3:
The name ‘SomeClassName’ does not exist in the current context
at GrapeCity.ActiveReports.DDScripting.#NOn(String source, CompilerResults results, Nullable1 globalcodeline, Nullable
1 namedItemLine, IList`1 expressionLineList)
at GrapeCity.ActiveReports.DDScripting.#Vzb()
at GrapeCity.ActiveReports.DDScripting.#Szb(String methodName, Object parameters, Boolean& success)
at GrapeCity.ActiveReports.SectionReport.#izb()
at GrapeCity.ActiveReports.SectionReport.#1yb(Boolean bDelayedInit)
at GrapeCity.ActiveReports.SectionReport.Run(Boolean syncDocument)
at GrapeCity.ActiveReports.SectionReport.Run()
at GrapeCity.ActiveReports.Viewer.Win.Rpx.RpxReport.LoadDocument(SectionDocument document)
at GrapeCity.ActiveReports.Viewer.Win.Rdf.RdfDocumentReportBase.<>c__DisplayClass1a.#jNI()
at GrapeCity.ActiveReports.Viewer.Win.AsyncLoader.<>c__DisplayClass7.#cAz(Object , DoWorkEventArgs )
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
1 globalcodeline, Nullable
You can assume that I am using the script:
public void Detail_Format()
{
this.TextBox1.Text = SomeClassName.SomeClassMethod(“some_parameter”);
}
I am using AR 9.2.3032.0.
Can you please provide instruction how to achieve what I need.
Thank you.