[Crystal Reports] Exception using version 11 [Object reference not set to an instance of an object]

Forge Component
(3)
Published on 2015-11-11 by Carlos Henriques
3 votes
Published on 2015-11-11 by Carlos Henriques

Has anyone been able to make this component work with Outsystems version 11? I followed all of the documentation. I created a plain report (only a text header) and uploaded it. I created a simple module to call the report.The first problem I see is that "Download" is client-side but "ExportToBinary" is server-side. Still, I tried to make a call to "ExportToBinary". The action is hit, but then an exception is raised stating "Object reference not set to an instance of an object." and that is far as I can get. I know my code value is correct because if I change it to anything else I get an exception about the report not existing. I've tried to set the ExportFormatId to other types as well, but same exception is raised. 

It seems to me like this extension is not compatible with OS 11, especially since it hasn't been updated since OS 9, but just thought I would put this out there in case anyone has found a way to make it work.

Joseph Robinson wrote:

Has anyone been able to make this component work with Outsystems version 11? I followed all of the documentation. I created a plain report (only a text header) and uploaded it. I created a simple module to call the report.The first problem I see is that "Download" is client-side but "ExportToBinary" is server-side. Still, I tried to make a call to "ExportToBinary". The action is hit, but then an exception is raised stating "Object reference not set to an instance of an object." and that is far as I can get. I know my code value is correct because if I change it to anything else I get an exception about the report not existing. I've tried to set the ExportFormatId to other types as well, but same exception is raised. 

It seems to me like this extension is not compatible with OS 11, especially since it hasn't been updated since OS 9, but just thought I would put this out there in case anyone has found a way to make it work.

Hey Joseph, Can you share the stack of this error? "Object reference not set to an instance of an object." is usually in the Service Center.


Sure Christian, here is the stack trace. While debugging, it halts in the 'ExportToBinary' server action in the Crystal Reports module.



Object reference not set to an instance of an object.
   at ssCrystalReports.RssExtensionCrystalReportsExtension.MssExportToStream(HeContext heContext, String inParamServer, String inParamDatabase, String inParamUsername, String inParamPassword, Int32 inParamExportFormat, String inParamReportFile, String inParamSelectionFormula, RecordList inParamParameters, RecordList inParamFormulas, Byte[]& outParamOutput)
   at ssCrystalReports.Actions.ActionExportToBinary(HeContext heContext, String inParamCode, Int32 inParamExportFormatId, String inParamDatabase, String inParamSelectionFormula, RLParameterList inParamParameters, RLFormulaList inParamFormulas, Byte[]& outParamBinaryData, String& outParamExtension)
   at ssCR_Test.RsseSpaceCrystalReports.MssExportToBinary(HeContext heContext, String inParamCode, Int32 inParamExportFormatId, String inParamDatabase, String inParamSelectionFormula, RecordList inParamParameters, RecordList inParamFormulas, Byte[]& outParamBinaryData, String& outParamExtension)
   at ssCR_Test.Actions.ActionExport(HeContext heContext)
   at ssCR_Test.Flows.FlowMainFlow.ScrnCR.CommandOk(HeContext heContext)



Object reference not set to an instance of an object.
   at OutSystems.NssCrystalReportsExtension.CssCrystalReportsExtension.MssExportToStream(String ssServer, String ssDatabase, String ssUsername, String ssPassword, Int32 ssExportFormat, String ssReportFile, String ssSelectionFormula, RLParameterRecordList ssParameters, RLFormulaRecordList ssFormulas, Byte[]& ssOutput)
   at ssCrystalReports.RssExtensionCrystalReportsExtension.MssExportToStream(HeContext heContext, String inParamServer, String inParamDatabase, String inParamUsername, String inParamPassword, Int32 inParamExportFormat, String inParamReportFile, String inParamSelectionFormula, RecordList inParamParameters, RecordList inParamFormulas, Byte[]& outParamOutput)



Solution

Joseph Robinson wrote:

Sure Christian, here is the stack trace. While debugging, it halts in the 'ExportToBinary' server action in the Crystal Reports module.



Object reference not set to an instance of an object.
   at ssCrystalReports.RssExtensionCrystalReportsExtension.MssExportToStream(HeContext heContext, String inParamServer, String inParamDatabase, String inParamUsername, String inParamPassword, Int32 inParamExportFormat, String inParamReportFile, String inParamSelectionFormula, RecordList inParamParameters, RecordList inParamFormulas, Byte[]& outParamOutput)
   at ssCrystalReports.Actions.ActionExportToBinary(HeContext heContext, String inParamCode, Int32 inParamExportFormatId, String inParamDatabase, String inParamSelectionFormula, RLParameterList inParamParameters, RLFormulaList inParamFormulas, Byte[]& outParamBinaryData, String& outParamExtension)
   at ssCR_Test.RsseSpaceCrystalReports.MssExportToBinary(HeContext heContext, String inParamCode, Int32 inParamExportFormatId, String inParamDatabase, String inParamSelectionFormula, RecordList inParamParameters, RecordList inParamFormulas, Byte[]& outParamBinaryData, String& outParamExtension)
   at ssCR_Test.Actions.ActionExport(HeContext heContext)
   at ssCR_Test.Flows.FlowMainFlow.ScrnCR.CommandOk(HeContext heContext)



Object reference not set to an instance of an object.
   at OutSystems.NssCrystalReportsExtension.CssCrystalReportsExtension.MssExportToStream(String ssServer, String ssDatabase, String ssUsername, String ssPassword, Int32 ssExportFormat, String ssReportFile, String ssSelectionFormula, RLParameterRecordList ssParameters, RLFormulaRecordList ssFormulas, Byte[]& ssOutput)
   at ssCrystalReports.RssExtensionCrystalReportsExtension.MssExportToStream(HeContext heContext, String inParamServer, String inParamDatabase, String inParamUsername, String inParamPassword, Int32 inParamExportFormat, String inParamReportFile, String inParamSelectionFormula, RecordList inParamParameters, RecordList inParamFormulas, Byte[]& outParamOutput)



If I'm not wrong, 'Object reference not set to an instance of an object.' is like the segmentation fault of Outsystems, so it doesn't look like it happens because of the inputs, as they are lists and strings. We would have to look in the code I suppose, but it doesn't seem to be supported anymore. It's meant for Outsystems 9, and had only 3 reviews.

If you have followed all of this, https://www.outsystems.com/forums/discussion/16632/how-to-export-report-to-binary/, then I really don't know what else can be done. Either the connection is poorly created, or else. If I may, what are you trying to do with Crystal Reports, maybe there is an alternative?


Solution

Thanks Christian. That was my thought as well. I drilled the error all the way down to the extension in Integration Services. I opened the code in Visual Studio and created a unit test for it. It seems like it was getting hung up on the Parameters and Formulas. The [HowTo] doesn't align with OS11 (I don't have OS9 experience so I don't know what has changed since then) and the component hasn't been updated in many years. I had just hoped that someone had used it recently and got it to work.

As for alternatives, we have plenty. We are rewriting all of our existing monoliths into OS and we're just evaluating reporting options. It looks like this one is off the table. 

I appreciate you trying to help Christian! Thank you!

Joseph Robinson wrote:

Thanks Christian. That was my thought as well. I drilled the error all the way down to the extension in Integration Services. I opened the code in Visual Studio and created a unit test for it. It seems like it was getting hung up on the Parameters and Formulas. The [HowTo] doesn't align with OS11 (I don't have OS9 experience so I don't know what has changed since then) and the component hasn't been updated in many years. I had just hoped that someone had used it recently and got it to work.

As for alternatives, we have plenty. We are rewriting all of our existing monoliths into OS and we're just evaluating reporting options. It looks like this one is off the table. 

I appreciate you trying to help Christian! Thank you!

I'm sorry for not being able to help more. If you could be bothered, consider marking this as a solution. Best of lucks.