error - Stimulsoft report with asp.net
error - Stimulsoft report with asp.net
I am trying to pass a parameter with one page in asp.net, but i am having some problems.
When I write a number in a text box and click to show the report, i see this message error:
"Object reference not set to an instance of an object."
The butto have this code:
Dim report As Stimulsoft.Report.StiReport = New Stimulsoft.Report.StiReport()
Try
report.Load("C:\report.mrt")
Catch ex As Exception
MsgBox("Load Error Report (Destination)")
End Try
report.Compile()
report.CompiledReport.DataSources.Item("employee").Parameters.Item("@id").ParameterValue = txtid.Text
report.Render()
StiWebViewer1.Report = report
StiWebViewer1.Visible = True
and in the datasource "employee" in the report - stimulsoft.net is:
select * from dbo.AC_employee where identifier = @id
I make only that, i need to make more things and how i resolve this problems?
Thanks,
Felipe Chimenti
When I write a number in a text box and click to show the report, i see this message error:
"Object reference not set to an instance of an object."
The butto have this code:
Dim report As Stimulsoft.Report.StiReport = New Stimulsoft.Report.StiReport()
Try
report.Load("C:\report.mrt")
Catch ex As Exception
MsgBox("Load Error Report (Destination)")
End Try
report.Compile()
report.CompiledReport.DataSources.Item("employee").Parameters.Item("@id").ParameterValue = txtid.Text
report.Render()
StiWebViewer1.Report = report
StiWebViewer1.Visible = True
and in the datasource "employee" in the report - stimulsoft.net is:
select * from dbo.AC_employee where identifier = @id
I make only that, i need to make more things and how i resolve this problems?
Thanks,
Felipe Chimenti
error - Stimulsoft report with asp.net
Hello Felipe.
Sorry for my automatically error. Instead of MsgDlg please write:
MessageBox.Show(ex.Message)
Also please be careful with assigning of the following default value of the id parameter as it might be not initialized.
report.CompiledReport.DataSources.Item("employee").Parameters.Item("@id").ParameterValue = 1
Because when the report objects are created txtid.Text might be not initialized.
also please change report.Render() to report.Render(false) for the Web because rendering dialog is not available in the web right now.
Thank you.
Sorry for my automatically error. Instead of MsgDlg please write:
MessageBox.Show(ex.Message)
Also please be careful with assigning of the following default value of the id parameter as it might be not initialized.
report.CompiledReport.DataSources.Item("employee").Parameters.Item("@id").ParameterValue = 1
Because when the report objects are created txtid.Text might be not initialized.
also please change report.Render() to report.Render(false) for the Web because rendering dialog is not available in the web right now.
Thank you.
error - Stimulsoft report with asp.net
But in the report, in the stimulsoft, i need to create a parameter...how we were making.....need to make another things?
Thanks a lot Edward,
Felipe Chimenti - Brasil.......
Thanks a lot Edward,
Felipe Chimenti - Brasil.......
error - Stimulsoft report with asp.net
I put this code below in the asp.net code:
report.CompiledReport.DataSources.Item("employee").Parameters.Item("@id").ParameterValue = 1
but the error continue appearing...
Dim report As Stimulsoft.Report.StiReport = New Stimulsoft.Report.StiReport()
Try
report.Load("C:\report.mrt")
Catch ex As Exception
MsgBox("Load Error Report (Destination)")
End Try
report.Compile()
report.CompiledReport.DataSources.Item("employee").Parameters.Item("@id").ParameterValue = 1
report.CompiledReport.DataSources.Item("employee").Parameters.Item("@id").ParameterValue = txtid.Text
report.Render(False)
StiWebViewer1.Report = report
StiWebViewer1.Visible = True
report.CompiledReport.DataSources.Item("employee").Parameters.Item("@id").ParameterValue = 1
but the error continue appearing...
Dim report As Stimulsoft.Report.StiReport = New Stimulsoft.Report.StiReport()
Try
report.Load("C:\report.mrt")
Catch ex As Exception
MsgBox("Load Error Report (Destination)")
End Try
report.Compile()
report.CompiledReport.DataSources.Item("employee").Parameters.Item("@id").ParameterValue = 1
report.CompiledReport.DataSources.Item("employee").Parameters.Item("@id").ParameterValue = txtid.Text
report.Render(False)
StiWebViewer1.Report = report
StiWebViewer1.Visible = True
error - Stimulsoft report with asp.net
Please see testing WebSite in the attachment. In that example you can see how to work with parameters in Web environment.
Please let me know if any helpis required.
For work it it requires NWind.mdb file which comes with a standard installation of Stimulsoft Reports.Net.
Thank you.
Please let me know if any helpis required.
For work it it requires NWind.mdb file which comes with a standard installation of Stimulsoft Reports.Net.
Thank you.
- Attachments
-
- 89.ParametersWeb.zip
- (6.03 KiB) Downloaded 184 times
error - Stimulsoft report with asp.net
Thanks a lot Edward,
For your help by the forum and by email.
huahauahuaha
Thanks,
Felipe Chimenti
For your help by the forum and by email.
huahauahuaha
Thanks,
Felipe Chimenti
error - Stimulsoft report with asp.net
You are welcome. 
Thank you.

Thank you.