6

I have the url of the file as below. First I want to download content of the file. The file has drill down from SSRS configuration. After that I am opening a stream with the code app.Workbooks.Open(stream);

    using (var client = new WebClient())
    {
        var content = client.DownloadData(url); // Get Existing file

        Stream stream = new MemoryStream(content);
        stream.Position = 0;

        using (ExcelEngine xlsEngine = new ExcelEngine())
        {
            IApplication app = xlsEngine.Excel;
            IWorkbook workBook = app.Workbooks.Open(stream);
        }
    }

Syncfusion Version:

Syncfusion.XlsIO.Base, Version=15.4460.0.20

Question:

If I try to create a new workbook from existing stream (SSRS report has drill down) file I get the following error

object not set to an instance of an object
Vedran
  • 10,369
  • 5
  • 50
  • 57
Soner
  • 1,280
  • 3
  • 16
  • 40
  • 1
    Can it be that your download returns null, where exactly do you get the exception? – Walter Verhoeven Aug 15 '19 at 21:42
  • I get the error on the code line IWorkbook workBook = app.Workbooks.Open(stream); – Soner Aug 20 '19 at 08:02
  • 1
    try and save the stream to disk and open it in excel, do you get an error? – Walter Verhoeven Aug 20 '19 at 14:37
  • If i click to any line of the excel file , there appears a popup which shows credential information to type.Everything works perfect without the drill down column from the ssrs but with the drill down not possible. – Soner Aug 20 '19 at 16:29

1 Answers1

5

The issue is raised based on the worksheet data in your source document. So, it will be more easier to analyse, if you could share the below information

  1. The stack trace of the exception.
  2. The input document loaded as URL.
  3. Working version of Syncfusion Assemblies.

We have prepared simple sample to open the file retrieved from URL as stream and the sample can be downloaded from following link.

Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Sample84020950.zip

Regards,

Abirami.

  • The issue occured by drill down from SSRS report.Do you have any idea how to read drill down ssrs report ? – Soner Aug 09 '19 at 20:31
  • 1
    from memory an SSRS report should be in an XML document, used to be when I used to still use it, should be easy. We parsed the reports to find database table/view/procedure and column dependencies before approving changes – Walter Verhoeven Aug 21 '19 at 06:18