AR 14 PDF rendering error on .NET Core 3 running on Linux system

Posted by: maximilian.haag on 10 February 2020, 8:48 pm EST

    • Post Options:
    • Link

    Posted 10 February 2020, 8:48 pm EST

    Hello,

    I created a small .NET Core 3 project running the example lines for a PDF export from an RDLX report from the following link.

    https://www.grapecity.com/activereports/docs/v14/online/pdf-export.html

    I took some files from the sample projects “Invoice.rdlx” + “Invoice.csv”.

    On a W10 machine it is working fine and the .PDF is created, but on the Ubuntu 18 machine I am getting an “ArgumentNullException” at

    “reportDocument.Render(pdfRenderingExtension, outputProvider, pdfSetting);”

    at ```

    GrapeCity.ActiveReports.Document.PageDocument.GetRenderableReport(Boolean forceDataRefresh, Boolean forceParameterDataRefresh, CancellationToken token)

    at GrapeCity.ActiveReports.Document.PageDocument.Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings, Boolean forceDataRefresh, Boolean forceParameterDataRefresh, CancellationToken token)

    at GrapeCity.ActiveReports.Document.PageDocument.Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings, Boolean forceDataRefresh)

    at GrapeCity.ActiveReports.Document.PageDocument.Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings)

    The debugger notices that the PageDocument is empty:

    System.ArgumentNullException: Value cannot be null. (Parameter ‘stream’)

    at System.IO.StreamReader…ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean leaveOpen)

    at System.IO.StreamReader…ctor(Stream stream, Encoding encoding)

    at GrapeCity.BI.Data.DataProviders.Csv.CsvDataReader.c(CsvConnectionString id)

    at GrapeCity.BI.Data.DataProviders.Csv.CsvDataReader.b()

    at GrapeCity.BI.Data.DataProviders.Csv.CsvDataReader.f()

    at GrapeCity.BI.Data.DataProviders.Csv.CsvDataReader.Read()

    at GrapeCity.ActiveReports.Rendering.DataProcessing.RecordsAdapter.GetEnumerator()+MoveNext()

    at GrapeCity.Enterprise.Data.DataEngine.Extensions.EnumerableExtensions.MemoizedReadOnlyList

    1.CacheItem()    at GrapeCity.Enterprise.Data.DataEngine.Extensions.EnumerableExtensions.MemoizedReadOnlyList
    1.GetEnumerator()+MoveNext()

    at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable
    1 source, Boolean& found)    at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
    1 source)

    at GrapeCity.ActiveReports.Rendering.ReportDataProcessor.GetRecordSet(IList
    1 finalizers, BuildCommandFn buildCommandFn, DataParameter[] parameters, IDataSet dataSet, IExpressionContext expressionContext, CancellationToken token, IDictionary
    2 recordSetsCache)

    at GrapeCity.ActiveReports.Rendering.ReportDataProcessor.<>c__DisplayClass2_0.b__0(RecordSetKey key)

    at GrapeCity.ActiveReports.Rendering.Tools.FuncExtensions.c
    2.<Memoize>b__0(a x)    at GrapeCity.ActiveReports.Rendering.ReportContextBuilder.<>c__DisplayClass0_0.<MakeReportContextFn>b__0(Report def, DataParameter[] parameters)    at GrapeCity.Enterprise.Data.DataEngine.DataProcessing.DataProcessor.Run(Report report, ReportContextFn makeContext, DataParameter[] dataParameters, InteractiveSortState sortState)    at GrapeCity.ActiveReports.Rendering.EngineDataProcessor.FetchData(Report query, Func
    2 getContext, ResourceLocator resourceLocator, Func
    3 makeExpressionContext, CancellationToken token, DataParameter[] parameters, Func
    2 locateDataSource, Func`2 resolveCredentials, InteractiveSortState sortState, IDataProvidersFactory dpf)

    at cw.FetchData(PageReport pageReport, IExpressionContext evaluationContext, ReportStore reportStore, a makeContext, CancellationToken token, InteractiveSortState sortState, Boolean handleEmptyGroups)

    at cw.FetchData(PageReport report, Boolean handleEmptyGroups)

    at GrapeCity.ActiveReports.Document.PageDocument.get_IsEmpty()

    
    
    It seems that there are some problems with the automatically data provided by the CSV file loaded to the RDLX.
    If I take a static/empty RDLX report file the PDF export works.
    Maybe somebody else had some similar problems?
    
    Many thanks in advance, 
    Best regards.
  • Posted 10 February 2020, 11:16 pm EST

    I think I found the error.

    The relative path of the report connection string to the CSV didn’t work.

    If it is canged to absolute:

    report.Report.DataSources[0].ConnectionProperties.ConnectString = "Path=/home/.../Invoice.csv;Locale=en-US;TextQualifier=\";ColumnsSeparator=,;RowsSeparator=\\r\\n;HasHeaders=True";
    

    it works.

    Best regards.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels