Exception when creating preview on a server

I am having a bit of a problem with Preview and Drilldown.

The situation that we are in is that we have a solution that uses Crystal Report for reporting. We do want to phase that out and have been rebuilding few reports with LL. We however would like to continue to build and produce the report data on our server and send streamed preview files to the client. We do not want to store report “projects” on each client and we also like to minimize the footprint on each client.

The first attempt was to display reports on the client using the built in WPF control. That was OK until we found that Drilldown is not possible. Having searched for a solution for that I ended up noticing that this was not possible at the moment (have lost the link to the forum answer).

Then we looked into viewing the report in the Standalone viewer and got help in making the preview “drillable” - as suggested I have marked the report main property as “Embed Drilldown Report” and preview generated on the client makes the drilldown possible.

BUT when generating the preview file in our server we get an Exception. See below. Is it possible to generate the preview file in the server without any user interaction?
As far as I can see we have not set any property to invoke user actions, see code snippets below.

            string reportFilePath = _baseDirectory + @"bin\LLReports\" + repInfo.LLReportFile;
            using (ListLabel LL = new ListLabel())
            {
                LL.LicensingInfo = "xxxxxxxxxxxxxxxxxxx";
                LL.Variables.AddFromObject("info", reportModel.Info);
                LL.Variables.AddFromObject("employer", reportModel.Employer);
                LL.Variables.AddFromDictionary("parameters", reportModel.ReportParameters);
                //Allows the List and Label preview file to export into different data types
                LL.Core.LlSetOptionString(LlOptionString.EmbeddedExportFormats, "PDF;XLS;DOCX");
                LL.DataSource = new ObjectDataProvider(reportModel);
#if DEBUG
                LL.Debug = LlDebug.Enabled | LlDebug.LogToFile;
#endif
                var exportConfiguration = new ExportConfiguration(exportTarget, stream, reportFilePath);
                exportConfiguration.ExportOptions.Add(LlExportOption.DocxFloatingTableMode, "0");
                LL.Export(exportConfiguration);
                return stream;
            }

Best regards,
Árni

Hi Árni,

Could you create a log file of the process up to the exception you’re getting? That would help to troubleshoot the issue. The process of creating such a file is documented here:

Log file included:
ll-server.log (785.6 KB)

We tried to reproduce the mentioned behavior with the MVC Web Reporting Sample - without success. The sample is part of your List & Label installation:

..\combit\LL28\Samples\Microsoft .NET\.NET 6\ASP.NET\MVC Web Reporting Sample
..\combit\LL28\Samples\Microsoft .NET\.NET Framework 4\ASP.NET\C#\MVC Web Reporting Sample

Is it reproducible on your side using the samples? Analyzing the log file (thanks for uploading) a possible reason could be that “IncrementalPreview” is disabled. Please make sure that IncrementalPreview is set to true LL.IncrementalPreview = true; (which is the default). It should not be disabled. In that case LlPreviewDisplay() needs to be executed to open the *.LL file, but that makes no sense in a server environment.

It is set to false:

But not in our application. We do never set this property.

-Árni

Hi Árni,

could you please try to reproduce the behavior with our samples? Alternatively, if you you don’t mind we would like to ask whether you could contact our support to exchange further information.

Chris

HI, do you use any ReportParameters in your project? If yes, please try one test with a project that don´t have any ReportParameters

None at all. Thanks for the suggestion though :slight_smile:

Included is a stripped down testable version that mimics what we are doing.

Run the project (put in your own lic info) and press the Preview button on the test form and you will get the same error as we do.
TestingCombit.zip (864.6 KB)

Whereas if you press “Preview nodrill” then that report is correctly converted to a preview file and sent over to the client. But as expected without drilldown being enabled in preview.

Hope this helps.

Best regards,
Árni

Thank you for providing the sample code. We will have a closer look into the described behavior and we will provide a reply as soon as possible. Please be patient.

@Arni_Reginsson Good news to this case: with the upcoming Service Pack Release 28.004 (estimated for the next two weeks) the described behavior is no longer reproducible and solved.
Let us know if the issue is also solved on your end after you have tested it with the Service Pack 28.004. If you need a new version earlier, please create a new support case at the Support Center we can provide the modules.

Thank you that’s good news indeed. I will then wait on our side to publish the newly added report until our “December patch” that is published before December 10th. That should give us enough time to double-check your solution in the upcoming Service Pack.

Good work,
Árni

2 Likes

Thanks for the excellent repro, Árni, that helped a lot in tracing down the issue.

1 Like