Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 19, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>When saveas to XLSX is not working according to its parameter</issue_title>
<issue_description>I have a report having pYear parameter and default value=2018.
In runtime when I run the report having parameter value=2017 and trying to saveas to xlsx format.It saveas report according to parameter value=2018.

In my application, there are different choices for saveas (pdf, xml, html, csv, rtf, tif, excell, mht)
PDF and TIF is working properly according to the choosen parameter, but others is working only for defalt parameter value.

Thaks in advance!!!

My vb.net code is below;
Public Sub RaporMenu(ByVal sender As Object, ByVal e As System.EventArgs)
'MsgBox(sender.ToString)
Select Case sender.ToString
Case "Open"
Dim dlg As New OpenFileDialog()
If (dlg.ShowDialog() <> DialogResult.OK) Then
Return
End If
rdlViewer.SourceFile = New Uri(dlg.FileName)
rdlViewer.Rebuild()

            Case "Save As"
                Dim dlg As New SaveFileDialog()
                dlg.Filter = "PDF files|*.pdf|XML files|*.xml|HTML files|*.html|CSV files|*.csv|RTF files|*.rtf|TIF files|*.tif|Excel files|*.xlsx|MHT files|*.mht"
                dlg.FileName = ".pdf"
                If (dlg.ShowDialog() <> DialogResult.OK) Then
                    Return
                End If
                Dim ext As String = ""
                Dim i As Integer = dlg.FileName.LastIndexOf(".")
                If i < 1 Then
                    ext = ""
                Else
                    ext = dlg.FileName.Substring(i + 1).ToLower()
                End If
                Dim type As New fyiReporting.RDL.OutputPresentationType
                Select Case ext
                    Case "pdf"
                        type = fyiReporting.RDL.OutputPresentationType.PDF
                    Case "xml"
                        type = fyiReporting.RDL.OutputPresentationType.XML
                    Case "html"
                        type = fyiReporting.RDL.OutputPresentationType.HTML
                    Case "htm"
                        type = fyiReporting.RDL.OutputPresentationType.HTML
                    Case "csv"
                        type = fyiReporting.RDL.OutputPresentationType.CSV
                    Case "rtf"
                        type = fyiReporting.RDL.OutputPresentationType.RTF
                    Case "mht"
                        type = fyiReporting.RDL.OutputPresentationType.MHTML
                    Case "mhtml"
                        type = fyiReporting.RDL.OutputPresentationType.MHTML
                    Case "xlsx"
                        type = fyiReporting.RDL.OutputPresentationType.Excel
                    Case "tif"
                        type = fyiReporting.RDL.OutputPresentationType.TIF
                    Case "tiff"
                        type = fyiReporting.RDL.OutputPresentationType.TIF
                    Case Else
                        MessageBox.Show(String.Format("{0} is not a valid file type. File extension must be PDF, XML, HTML, CSV, MHT, RTF, TIF, XLSX.", dlg.FileName),
                            "Invalid File Type", MessageBoxButtons.OK, MessageBoxIcon.Information)
                End Select                    

                rdlViewer.SaveAs(dlg.FileName, type)

            Case "Print"
                Dim pd As New PrintDocument
                pd.DocumentName = rdlViewer.SourceFile.LocalPath
                pd.PrinterSettings.FromPage = 1
                pd.PrinterSettings.ToPage = rdlViewer.PageCount
                pd.PrinterSettings.MaximumPage = rdlViewer.PageCount
                pd.PrinterSettings.MinimumPage = 1
                If rdlViewer.PageWidth > rdlViewer.PageHeight Then
                    pd.DefaultPageSettings.Landscape = True
                Else
                    pd.DefaultPageSettings.Landscape = False
                End If
                Dim dlg As New PrintDialog
                dlg.Document = pd
                dlg.AllowSelection = True
                dlg.AllowSomePages = True
                If (dlg.ShowDialog() = DialogResult.OK) Then
                    rdlViewer.Print(pd)
                End If
            Case "First Page"
                rdlViewer.PageCurrent = 1
            Case "Previous Page"
                If (rdlViewer.PageCurrent = 1) Then
                    Return
                Else
                    rdlViewer.PageCurrent -= 1
            ...

Fixes #170


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

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

Successfully merging this pull request may close these issues.

When saveas to XLSX is not working according to its parameter

2 participants