Hi team,
I use an object data source in my report and when I check the preview mode I get an error but if I use the report in report viewer in aspx and run the page i don't get any error.
first i want to know how to debug my business method when I use the preview mode in my report to not always have to run my aspx screen to do the debugging process.
second i want why i get this error, kindly find below the details :
my business method is very simple :
in my aspx code behind i do the below and it is working without the error:
I use an object data source in my report and when I check the preview mode I get an error but if I use the report in report viewer in aspx and run the page i don't get any error.
first i want to know how to debug my business method when I use the preview mode in my report to not always have to run my aspx screen to do the debugging process.
second i want why i get this error, kindly find below the details :
my business method is very simple :
[DataObjectMethod(DataObjectMethodType.Select)] public List<CreatedQRCodesCountBEL> GetCreatedQRCodesCount(int SuperAcctID) { //my code }
in my report i have one report parameter "SuperAcctID" and i just give it a default value no binding to data source:
An error has occurred while processing Report 'rptCreatedQRCodesCount':
An error occurred while invoking data retrieval method.
Try restarting Visual Studio. ------------- InnerException -------------
Exception has been thrown by the target of an invocation. -------------
InnerException ------------- Object reference not set to an instance of an object.
in my aspx code behind i do the below and it is working without the error:
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var objCreatedQRCodesCountReport = new rptCreatedQRCodesCount(); objCreatedQRCodesCountReport.ReportParameters["SuperAcctID"].Value = SuperAcctID.ToString(); radrvCreatedQRCodesCount.ReportSource = objCreatedQRCodesCountReport; } }
I hope you can help me.
Regards,
Mohammed