Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExceptionMessage: Value does not fall within the expected range. (Parameter 'logFont'); #206

Open
jingzhou79 opened this issue Jan 9, 2025 · 6 comments

Comments

@jingzhou79
Copy link

Microsoft.Reporting.NETCore.Report.Render("PDF", deviceInfo)

##ExceptionMessage: Value does not fall within the expected range. (Parameter 'logFont');
##Source: Microsoft.ReportViewer.NETCore
##StackTrace: at Microsoft.Reporting.NETCore.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)
at Microsoft.Reporting.NETCore.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
at Microsoft.Reporting.NETCore.LocalReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
at Microsoft.Reporting.NETCore.Report.Render(String format, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
at Microsoft.Reporting.NETCore.Report.Render(String format, String deviceInfo)

@ADefWebserver
Copy link

I think he's going to need to see the code you used before the Render call.

@jingzhou79
Copy link
Author

       Main code:
         var _reportViewer = new LocalReport();
         // SetParameters and Add DataSources 
         var deviceInfo = "<DeviceInfo><SimplePageHeaders>false</SimplePageHeaders></DeviceInfo>";
          byte[] bytes;
          bytes = _reportViewer.Render("Excel", deviceInfo);            
          using (var fileStream = new FileStream("test.xls", FileMode.OpenOrCreate))
          {
              fileStream.Write(bytes, 0, bytes.Length);
          }			
     bytes = _reportViewer.Render("PDF", deviceInfo);
         using (var fileStream = new FileStream("test.pdf", FileMode.OpenOrCreate))
          {
              fileStream.Write(bytes, 0, bytes.Length);
          }

          _reportViewer.Render("Excel", deviceInfo)  was successful.

@ADefWebserver
Copy link

Is it possible to provide test.xls file and indicate the computer type (for example Linux) and .net version it was run on?

@lkosson
Copy link
Owner

lkosson commented Jan 9, 2025

Provide the InnerException (with full stack trace) of the LocalProcessingException.

@jingzhou79
Copy link
Author

It is deployed in a Linux environment netcore 8.0
test.xls

@ADefWebserver
Copy link

@jingzhou79 - I don't have a Linux environment, so I won't be able to reproduce. Perhaps @lkosson does.
He will need that InnerException (with full stack trace).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants