Dear Sir,
I have an error like below :
'underscore' is not declared. It may be inaccessible due to its protection level.
'Landscape' is not declared. It may be inaccessible due to its protection level.
'PaperSize' is a class type and cannot be used as an expression.
'FromPage' is not declared. It may be inaccessible due to its protection level.
'ToPage' is not declared. It may be inaccessible due to its protection level.
When I convert from C# to VB.NET but The code I used in C# has no errors.
Please Guide me
Thanks
Code In VB..NET
Public Function GetExcelArray() As Byte()
`underscore is not declared.`
Return Report?.Render("Excel", Nothing, underscore, underscore, underscore, underscore, underscore)
End Function
Public Function GetDefaultPrinter() As PrintDocument
Return New PrintDocument With {
.DefaultPageSettings = {
`Landscape is not declared.`
Landscape = Report.GetDefaultPageSettings().IsLandscape,
`PaperSize is a class type and cannot be used as an expression.`
PaperSize = New PaperSize(Report.GetDefaultPageSettings().PaperSize.PaperName, Report.GetDefaultPageSettings().PaperSize.Width, Report.GetDefaultPageSettings().PaperSize.Height)
},
.PrinterSettings = {
`FromPage is not declared.`
FromPage = 1,
`ToPage is not declared`
ToPage = GetImage().Frames.Count
}
}
End Function
Code in C#
public byte[] GetExcelArray() => Report?.Render("Excel", null, out _, out _, out _, out _, out _);
public PrintDocument GetDefaultPrinter() => new PrintDocument
{
DefaultPageSettings =
{
Landscape = Report.GetDefaultPageSettings().IsLandscape,
PaperSize = new PaperSize(Report.GetDefaultPageSettings().PaperSize.PaperName,
Report.GetDefaultPageSettings().PaperSize.Width,
Report.GetDefaultPageSettings().PaperSize.Height)
},
PrinterSettings =
{
FromPage = 1,
ToPage = GetImage().Frames.Count
}
};