Can´t get value of report variable from code
Posted: Mon Mar 13, 2017 4:16 pm
My problem is this:
I have a project where a report is loaded from string via code vb,
This report has a variable whose value changes in the EndReport event, then when I retrieve that variable value via code in my project this is empty.
Not only this variable, also any other property of the rendered report, for example:
I also try to change the report name from the Report event: EndRender, but when I export it, it's show me the defaul name.
In nameFile file says:
Note: I'm rendering the report in server and show it on client side. I'm using 2016.2 version
I have a project where a report is loaded from string via code vb,
Code: Select all
Dim reporte as New StiReport
reporte.LoadFromString(definition)
Code: Select all
Dim counter as String
reporte.Render(False)
counter = reporte.Dictionary.Variables.Item("counter").Value
'Value of counter is "" but in report code is 415
Code: Select all
Dim empty as Boolean
reporte.Render(False)
empty = reporte.DataSources.Item(0).IsEmpty
'empty is true, but the report contains data :(
Code: Select all
'In report code
Public Sub Informe_BeginRender(ByVal sender As Object, ByVal e As System.EventArgs)
Me.ReportAlias="Test1"
Me.ReportName="Test1"
End Sub
'Then in my code
Dim reporte as New StiReport
reporte.LoadFromString(definition)
reporte.Render(False)
reporte.SavePackedDocument(nameFile)
Code: Select all
<ReportName>Report</ReportName> --> Should be "Test1"
<ReportAlias>Report</ReportAlias> --> Should be "Test1"